@hagicode/hagilight-starlight 0.6.1-dev.74.1.7df157f → 0.6.1-dev.75.1.60c438f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ArticlePromotion.astro +19 -3
- package/Footer.astro +17 -2
- package/Header.astro +2 -1
- package/package.json +2 -2
package/ArticlePromotion.astro
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { Image } from 'astro:assets';
|
|
3
|
+
import { gaEventAttributes } from '@hagicode/hagilight-core/analytics-events';
|
|
3
4
|
import { resolveSiteLinks } from '@hagicode/hagilight-core/links';
|
|
4
5
|
import { getArticlePromotionCopy } from './dist/article-promotion.js';
|
|
5
6
|
import {
|
|
@@ -24,6 +25,8 @@ const storeHref = linkHref('microsoftStore', 'https://apps.microsoft.com/detail/
|
|
|
24
25
|
const downloadsHref = linkHref('downloadClient', 'https://www.hagicode.com/');
|
|
25
26
|
const storeProductId = resolveMicrosoftStoreProductId(storeHref);
|
|
26
27
|
const badgeLanguage = resolveMicrosoftStoreBadgeLanguage(lang);
|
|
28
|
+
const showcaseTag = (category: 'download' | 'navigation', label: string, url?: string) =>
|
|
29
|
+
gaEventAttributes({ category, label, location: 'article_promotion', url });
|
|
27
30
|
|
|
28
31
|
// Keyed by the ids in assets/showcase/manifest.json and in the copy catalog's gallery.
|
|
29
32
|
const galleryImages: Record<string, ImageMetadata> = {
|
|
@@ -49,10 +52,18 @@ const gallery = copy.gallery.flatMap((item) => {
|
|
|
49
52
|
<p class="hagilight-article-promotion__lead">{copy.lead}</p>
|
|
50
53
|
<p class="hagilight-article-promotion__tagline">{copy.subheadline}</p>
|
|
51
54
|
<div class="hagilight-article-promotion__actions">
|
|
52
|
-
<a
|
|
55
|
+
<a
|
|
56
|
+
class="hagilight-article-promotion__cta hagilight-article-promotion__cta--primary"
|
|
57
|
+
href={homeHref}
|
|
58
|
+
{...showcaseTag('navigation', 'home')}
|
|
59
|
+
>
|
|
53
60
|
{copy.visitLabel}
|
|
54
61
|
</a>
|
|
55
|
-
<a
|
|
62
|
+
<a
|
|
63
|
+
class="hagilight-article-promotion__cta hagilight-article-promotion__cta--secondary"
|
|
64
|
+
href={docsHref}
|
|
65
|
+
{...showcaseTag('navigation', 'productDocs')}
|
|
66
|
+
>
|
|
56
67
|
{copy.docsLabel}
|
|
57
68
|
</a>
|
|
58
69
|
</div>
|
|
@@ -111,6 +122,7 @@ const gallery = copy.gallery.flatMap((item) => {
|
|
|
111
122
|
language={badgeLanguage}
|
|
112
123
|
aria-label={copy.windowsStoreAriaLabel}
|
|
113
124
|
title={copy.windowsStoreAriaLabel}
|
|
125
|
+
{...showcaseTag('download', 'microsoftStore', storeHref)}
|
|
114
126
|
>
|
|
115
127
|
<a
|
|
116
128
|
class="hagilight-article-promotion__store-fallback"
|
|
@@ -119,7 +131,11 @@ const gallery = copy.gallery.flatMap((item) => {
|
|
|
119
131
|
title={copy.windowsStoreAriaLabel}
|
|
120
132
|
>{copy.windowsStoreLabel}</a>
|
|
121
133
|
</ms-store-badge>
|
|
122
|
-
<a
|
|
134
|
+
<a
|
|
135
|
+
class="hagilight-article-promotion__downloads"
|
|
136
|
+
href={downloadsHref}
|
|
137
|
+
{...showcaseTag('download', 'downloadClient')}
|
|
138
|
+
>{copy.allDownloadsLabel}</a>
|
|
123
139
|
</div>
|
|
124
140
|
</div>
|
|
125
141
|
|
package/Footer.astro
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import Copyright from '@hagicode/hagilight-core/Copyright';
|
|
3
3
|
import DefaultFooter from '@astrojs/starlight/components/Footer.astro';
|
|
4
|
+
import { siteLinkGaAttributes } from '@hagicode/hagilight-core/analytics-events';
|
|
4
5
|
import { resolveSiteLinks, type SiteLinksOptions } from '@hagicode/hagilight-core/links';
|
|
5
6
|
import manifest from './package.json';
|
|
6
7
|
|
|
@@ -61,7 +62,14 @@ const resolvedLinks = resolveSiteLinks(currentLanguage ?? locale, {
|
|
|
61
62
|
<nav aria-label={resolvedLinks.labels.navigation.quickLinks}>
|
|
62
63
|
<ul>
|
|
63
64
|
{resolvedLinks.quick.map((link) => (
|
|
64
|
-
<li
|
|
65
|
+
<li>
|
|
66
|
+
<a
|
|
67
|
+
href={link.href}
|
|
68
|
+
target={link.target}
|
|
69
|
+
rel={link.rel}
|
|
70
|
+
{...siteLinkGaAttributes(link, 'footer')}
|
|
71
|
+
>{link.label}</a>
|
|
72
|
+
</li>
|
|
65
73
|
))}
|
|
66
74
|
</ul>
|
|
67
75
|
</nav>
|
|
@@ -71,7 +79,14 @@ const resolvedLinks = resolveSiteLinks(currentLanguage ?? locale, {
|
|
|
71
79
|
<nav aria-label={resolvedLinks.labels.navigation.community}>
|
|
72
80
|
<ul>
|
|
73
81
|
{resolvedLinks.community.map((link) => (
|
|
74
|
-
<li
|
|
82
|
+
<li>
|
|
83
|
+
<a
|
|
84
|
+
href={link.href}
|
|
85
|
+
target={link.target}
|
|
86
|
+
rel={link.rel}
|
|
87
|
+
{...siteLinkGaAttributes(link, 'footer')}
|
|
88
|
+
>{link.label}</a>
|
|
89
|
+
</li>
|
|
75
90
|
))}
|
|
76
91
|
</ul>
|
|
77
92
|
</nav>
|
package/Header.astro
CHANGED
|
@@ -4,6 +4,7 @@ import Search from 'virtual:starlight/components/Search';
|
|
|
4
4
|
import SiteTitle from 'virtual:starlight/components/SiteTitle';
|
|
5
5
|
import SocialIcons from 'virtual:starlight/components/SocialIcons';
|
|
6
6
|
import ThemeSelect from 'virtual:starlight/components/ThemeSelect';
|
|
7
|
+
import { siteLinkGaAttributes } from '@hagicode/hagilight-core/analytics-events';
|
|
7
8
|
import { resolveSiteLinks, type SiteLinksOptions } from '@hagicode/hagilight-core/links';
|
|
8
9
|
import LanguageChooser from './LanguageChooser.astro';
|
|
9
10
|
|
|
@@ -29,7 +30,7 @@ const shouldRenderSearch =
|
|
|
29
30
|
<div class="sl-hidden md:sl-flex print:hidden right-group">
|
|
30
31
|
<nav class="header-links" aria-label="Site navigation">
|
|
31
32
|
{resolvedLinks.header.map((link) => (
|
|
32
|
-
<a href={link.href} target={link.target} rel={link.rel}>{link.label}</a>
|
|
33
|
+
<a href={link.href} target={link.target} rel={link.rel} {...siteLinkGaAttributes(link, 'header')}>{link.label}</a>
|
|
33
34
|
))}
|
|
34
35
|
</nav>
|
|
35
36
|
<div class="sl-flex social-icons">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hagicode/hagilight-starlight",
|
|
3
|
-
"version": "0.6.1-dev.
|
|
3
|
+
"version": "0.6.1-dev.75.1.60c438f",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Starlight plugin and components for HagiCode documentation",
|
|
6
6
|
"repository": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"assets/showcase/*"
|
|
54
54
|
],
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@hagicode/hagilight-core": "0.6.1-dev.
|
|
56
|
+
"@hagicode/hagilight-core": "0.6.1-dev.75.1.60c438f"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@astrojs/starlight": "^0.42.4",
|