@hagicode/hagilight-core 0.1.0-dev.148.1.e0c630e

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.
Files changed (205) hide show
  1. package/Analytics51LA.astro +17 -0
  2. package/Copyright.astro +9 -0
  3. package/Footer.astro +208 -0
  4. package/FooterAvatarPicker.astro +9 -0
  5. package/FooterBrand.astro +339 -0
  6. package/GoogleAnalytics.astro +30 -0
  7. package/PostHog.astro +11 -0
  8. package/PromotoBanner.astro +582 -0
  9. package/README.md +485 -0
  10. package/RootTransit.astro +599 -0
  11. package/assets/footer/avatar.avif +0 -0
  12. package/assets/footer/avatar.webp +0 -0
  13. package/assets/footer/manifest.json +237 -0
  14. package/data/comparison-articles/de-DE/claude-vs-hagicode.json +294 -0
  15. package/data/comparison-articles/de-DE/codebuddy-vs-hagicode.json +266 -0
  16. package/data/comparison-articles/de-DE/codex-vs-hagicode.json +266 -0
  17. package/data/comparison-articles/de-DE/copilot-vs-hagicode.json +266 -0
  18. package/data/comparison-articles/de-DE/deepagents-vs-hagicode.json +266 -0
  19. package/data/comparison-articles/de-DE/gemini-vs-hagicode.json +266 -0
  20. package/data/comparison-articles/de-DE/hermes-vs-hagicode.json +266 -0
  21. package/data/comparison-articles/de-DE/kimi-vs-hagicode.json +266 -0
  22. package/data/comparison-articles/de-DE/kiro-vs-hagicode.json +266 -0
  23. package/data/comparison-articles/de-DE/opencode-vs-hagicode.json +266 -0
  24. package/data/comparison-articles/de-DE/pi-vs-hagicode.json +282 -0
  25. package/data/comparison-articles/de-DE/qoder-vs-hagicode.json +266 -0
  26. package/data/comparison-articles/de-DE/reasonix-vs-hagicode.json +281 -0
  27. package/data/comparison-articles/en-US/claude-vs-hagicode.json +346 -0
  28. package/data/comparison-articles/en-US/codebuddy-vs-hagicode.json +322 -0
  29. package/data/comparison-articles/en-US/codex-vs-hagicode.json +321 -0
  30. package/data/comparison-articles/en-US/copilot-vs-hagicode.json +320 -0
  31. package/data/comparison-articles/en-US/deepagents-vs-hagicode.json +323 -0
  32. package/data/comparison-articles/en-US/dsh-vs-hagicode.json +323 -0
  33. package/data/comparison-articles/en-US/gemini-vs-hagicode.json +320 -0
  34. package/data/comparison-articles/en-US/hermes-vs-hagicode.json +323 -0
  35. package/data/comparison-articles/en-US/junie-vs-hagicode.json +323 -0
  36. package/data/comparison-articles/en-US/kimi-vs-hagicode.json +319 -0
  37. package/data/comparison-articles/en-US/kiro-vs-hagicode.json +319 -0
  38. package/data/comparison-articles/en-US/omp-vs-hagicode.json +345 -0
  39. package/data/comparison-articles/en-US/opencode-vs-hagicode.json +333 -0
  40. package/data/comparison-articles/en-US/pi-vs-hagicode.json +345 -0
  41. package/data/comparison-articles/en-US/qoder-vs-hagicode.json +323 -0
  42. package/data/comparison-articles/en-US/reasonix-vs-hagicode.json +344 -0
  43. package/data/comparison-articles/es-ES/claude-vs-hagicode.json +294 -0
  44. package/data/comparison-articles/es-ES/codebuddy-vs-hagicode.json +266 -0
  45. package/data/comparison-articles/es-ES/codex-vs-hagicode.json +266 -0
  46. package/data/comparison-articles/es-ES/copilot-vs-hagicode.json +266 -0
  47. package/data/comparison-articles/es-ES/deepagents-vs-hagicode.json +266 -0
  48. package/data/comparison-articles/es-ES/gemini-vs-hagicode.json +266 -0
  49. package/data/comparison-articles/es-ES/hermes-vs-hagicode.json +266 -0
  50. package/data/comparison-articles/es-ES/kimi-vs-hagicode.json +266 -0
  51. package/data/comparison-articles/es-ES/kiro-vs-hagicode.json +266 -0
  52. package/data/comparison-articles/es-ES/opencode-vs-hagicode.json +266 -0
  53. package/data/comparison-articles/es-ES/pi-vs-hagicode.json +281 -0
  54. package/data/comparison-articles/es-ES/qoder-vs-hagicode.json +266 -0
  55. package/data/comparison-articles/es-ES/reasonix-vs-hagicode.json +281 -0
  56. package/data/comparison-articles/fr-FR/claude-vs-hagicode.json +294 -0
  57. package/data/comparison-articles/fr-FR/codebuddy-vs-hagicode.json +266 -0
  58. package/data/comparison-articles/fr-FR/codex-vs-hagicode.json +266 -0
  59. package/data/comparison-articles/fr-FR/copilot-vs-hagicode.json +266 -0
  60. package/data/comparison-articles/fr-FR/deepagents-vs-hagicode.json +266 -0
  61. package/data/comparison-articles/fr-FR/gemini-vs-hagicode.json +266 -0
  62. package/data/comparison-articles/fr-FR/hermes-vs-hagicode.json +266 -0
  63. package/data/comparison-articles/fr-FR/kimi-vs-hagicode.json +266 -0
  64. package/data/comparison-articles/fr-FR/kiro-vs-hagicode.json +266 -0
  65. package/data/comparison-articles/fr-FR/opencode-vs-hagicode.json +266 -0
  66. package/data/comparison-articles/fr-FR/pi-vs-hagicode.json +281 -0
  67. package/data/comparison-articles/fr-FR/qoder-vs-hagicode.json +266 -0
  68. package/data/comparison-articles/fr-FR/reasonix-vs-hagicode.json +281 -0
  69. package/data/comparison-articles/ja-JP/claude-vs-hagicode.json +294 -0
  70. package/data/comparison-articles/ja-JP/codebuddy-vs-hagicode.json +266 -0
  71. package/data/comparison-articles/ja-JP/codex-vs-hagicode.json +266 -0
  72. package/data/comparison-articles/ja-JP/copilot-vs-hagicode.json +266 -0
  73. package/data/comparison-articles/ja-JP/deepagents-vs-hagicode.json +266 -0
  74. package/data/comparison-articles/ja-JP/gemini-vs-hagicode.json +266 -0
  75. package/data/comparison-articles/ja-JP/hermes-vs-hagicode.json +266 -0
  76. package/data/comparison-articles/ja-JP/kimi-vs-hagicode.json +266 -0
  77. package/data/comparison-articles/ja-JP/kiro-vs-hagicode.json +266 -0
  78. package/data/comparison-articles/ja-JP/opencode-vs-hagicode.json +266 -0
  79. package/data/comparison-articles/ja-JP/pi-vs-hagicode.json +281 -0
  80. package/data/comparison-articles/ja-JP/qoder-vs-hagicode.json +266 -0
  81. package/data/comparison-articles/ja-JP/reasonix-vs-hagicode.json +281 -0
  82. package/data/comparison-articles/ko-KR/claude-vs-hagicode.json +294 -0
  83. package/data/comparison-articles/ko-KR/codebuddy-vs-hagicode.json +266 -0
  84. package/data/comparison-articles/ko-KR/codex-vs-hagicode.json +266 -0
  85. package/data/comparison-articles/ko-KR/copilot-vs-hagicode.json +266 -0
  86. package/data/comparison-articles/ko-KR/deepagents-vs-hagicode.json +266 -0
  87. package/data/comparison-articles/ko-KR/gemini-vs-hagicode.json +266 -0
  88. package/data/comparison-articles/ko-KR/hermes-vs-hagicode.json +266 -0
  89. package/data/comparison-articles/ko-KR/kimi-vs-hagicode.json +266 -0
  90. package/data/comparison-articles/ko-KR/kiro-vs-hagicode.json +266 -0
  91. package/data/comparison-articles/ko-KR/opencode-vs-hagicode.json +266 -0
  92. package/data/comparison-articles/ko-KR/pi-vs-hagicode.json +281 -0
  93. package/data/comparison-articles/ko-KR/qoder-vs-hagicode.json +266 -0
  94. package/data/comparison-articles/ko-KR/reasonix-vs-hagicode.json +281 -0
  95. package/data/comparison-articles/pt-BR/claude-vs-hagicode.json +294 -0
  96. package/data/comparison-articles/pt-BR/codebuddy-vs-hagicode.json +266 -0
  97. package/data/comparison-articles/pt-BR/codex-vs-hagicode.json +266 -0
  98. package/data/comparison-articles/pt-BR/copilot-vs-hagicode.json +266 -0
  99. package/data/comparison-articles/pt-BR/deepagents-vs-hagicode.json +266 -0
  100. package/data/comparison-articles/pt-BR/gemini-vs-hagicode.json +266 -0
  101. package/data/comparison-articles/pt-BR/hermes-vs-hagicode.json +266 -0
  102. package/data/comparison-articles/pt-BR/kimi-vs-hagicode.json +266 -0
  103. package/data/comparison-articles/pt-BR/kiro-vs-hagicode.json +266 -0
  104. package/data/comparison-articles/pt-BR/opencode-vs-hagicode.json +266 -0
  105. package/data/comparison-articles/pt-BR/pi-vs-hagicode.json +281 -0
  106. package/data/comparison-articles/pt-BR/qoder-vs-hagicode.json +266 -0
  107. package/data/comparison-articles/pt-BR/reasonix-vs-hagicode.json +281 -0
  108. package/data/comparison-articles/ru-RU/claude-vs-hagicode.json +294 -0
  109. package/data/comparison-articles/ru-RU/codebuddy-vs-hagicode.json +266 -0
  110. package/data/comparison-articles/ru-RU/codex-vs-hagicode.json +266 -0
  111. package/data/comparison-articles/ru-RU/copilot-vs-hagicode.json +266 -0
  112. package/data/comparison-articles/ru-RU/deepagents-vs-hagicode.json +266 -0
  113. package/data/comparison-articles/ru-RU/gemini-vs-hagicode.json +266 -0
  114. package/data/comparison-articles/ru-RU/hermes-vs-hagicode.json +266 -0
  115. package/data/comparison-articles/ru-RU/kimi-vs-hagicode.json +266 -0
  116. package/data/comparison-articles/ru-RU/kiro-vs-hagicode.json +266 -0
  117. package/data/comparison-articles/ru-RU/opencode-vs-hagicode.json +266 -0
  118. package/data/comparison-articles/ru-RU/pi-vs-hagicode.json +281 -0
  119. package/data/comparison-articles/ru-RU/qoder-vs-hagicode.json +323 -0
  120. package/data/comparison-articles/ru-RU/reasonix-vs-hagicode.json +281 -0
  121. package/data/comparison-articles/zh-CN/claude-vs-hagicode.json +346 -0
  122. package/data/comparison-articles/zh-CN/codebuddy-vs-hagicode.json +322 -0
  123. package/data/comparison-articles/zh-CN/codex-vs-hagicode.json +321 -0
  124. package/data/comparison-articles/zh-CN/copilot-vs-hagicode.json +320 -0
  125. package/data/comparison-articles/zh-CN/deepagents-vs-hagicode.json +323 -0
  126. package/data/comparison-articles/zh-CN/dsh-vs-hagicode.json +323 -0
  127. package/data/comparison-articles/zh-CN/gemini-vs-hagicode.json +320 -0
  128. package/data/comparison-articles/zh-CN/hermes-vs-hagicode.json +323 -0
  129. package/data/comparison-articles/zh-CN/junie-vs-hagicode.json +323 -0
  130. package/data/comparison-articles/zh-CN/kimi-vs-hagicode.json +319 -0
  131. package/data/comparison-articles/zh-CN/kiro-vs-hagicode.json +319 -0
  132. package/data/comparison-articles/zh-CN/omp-vs-hagicode.json +345 -0
  133. package/data/comparison-articles/zh-CN/opencode-vs-hagicode.json +333 -0
  134. package/data/comparison-articles/zh-CN/pi-vs-hagicode.json +345 -0
  135. package/data/comparison-articles/zh-CN/qoder-vs-hagicode.json +323 -0
  136. package/data/comparison-articles/zh-CN/reasonix-vs-hagicode.json +344 -0
  137. package/data/comparison-articles/zh-Hant/claude-vs-hagicode.json +294 -0
  138. package/data/comparison-articles/zh-Hant/codebuddy-vs-hagicode.json +266 -0
  139. package/data/comparison-articles/zh-Hant/codex-vs-hagicode.json +266 -0
  140. package/data/comparison-articles/zh-Hant/copilot-vs-hagicode.json +266 -0
  141. package/data/comparison-articles/zh-Hant/deepagents-vs-hagicode.json +266 -0
  142. package/data/comparison-articles/zh-Hant/gemini-vs-hagicode.json +266 -0
  143. package/data/comparison-articles/zh-Hant/hermes-vs-hagicode.json +266 -0
  144. package/data/comparison-articles/zh-Hant/kimi-vs-hagicode.json +266 -0
  145. package/data/comparison-articles/zh-Hant/kiro-vs-hagicode.json +266 -0
  146. package/data/comparison-articles/zh-Hant/opencode-vs-hagicode.json +266 -0
  147. package/data/comparison-articles/zh-Hant/pi-vs-hagicode.json +281 -0
  148. package/data/comparison-articles/zh-Hant/qoder-vs-hagicode.json +266 -0
  149. package/data/comparison-articles/zh-Hant/reasonix-vs-hagicode.json +281 -0
  150. package/dist/analytics-events.d.ts +49 -0
  151. package/dist/analytics-events.js +113 -0
  152. package/dist/build-info-resolver.d.ts +8 -0
  153. package/dist/build-info-resolver.js +29 -0
  154. package/dist/build-info.d.ts +19 -0
  155. package/dist/build-info.js +60 -0
  156. package/dist/comparison-articles-source.d.ts +13 -0
  157. package/dist/comparison-articles-source.js +58 -0
  158. package/dist/comparison-articles.d.ts +127 -0
  159. package/dist/comparison-articles.js +260 -0
  160. package/dist/content-images.d.ts +126 -0
  161. package/dist/content-images.js +490 -0
  162. package/dist/favicon.d.ts +21 -0
  163. package/dist/favicon.js +27 -0
  164. package/dist/footer-avatar.d.ts +39 -0
  165. package/dist/footer-avatar.js +42 -0
  166. package/dist/footer-brand.d.ts +29 -0
  167. package/dist/footer-brand.js +86 -0
  168. package/dist/head.d.ts +7 -0
  169. package/dist/head.js +1 -0
  170. package/dist/link-policy.d.ts +33 -0
  171. package/dist/link-policy.js +93 -0
  172. package/dist/links.d.ts +70 -0
  173. package/dist/links.js +425 -0
  174. package/dist/posthog.d.ts +6 -0
  175. package/dist/posthog.js +17 -0
  176. package/dist/promotions.d.ts +50 -0
  177. package/dist/promotions.js +243 -0
  178. package/dist/promoto-banner.d.ts +14 -0
  179. package/dist/promoto-banner.js +499 -0
  180. package/dist/random-image.d.ts +69 -0
  181. package/dist/random-image.js +133 -0
  182. package/dist/related-sites.json +378 -0
  183. package/dist/root-transit.d.ts +12 -0
  184. package/dist/root-transit.js +221 -0
  185. package/dist/rss-footer-context.d.ts +6 -0
  186. package/dist/rss-footer-context.js +54 -0
  187. package/dist/rss-ownership.d.ts +26 -0
  188. package/dist/rss-ownership.js +63 -0
  189. package/dist/rss.d.ts +34 -0
  190. package/dist/rss.js +145 -0
  191. package/dist/seo-schema.d.ts +12 -0
  192. package/dist/seo-schema.js +20 -0
  193. package/dist/seo.d.ts +78 -0
  194. package/dist/seo.js +270 -0
  195. package/dist/site-metadata-ownership.d.ts +40 -0
  196. package/dist/site-metadata-ownership.js +72 -0
  197. package/dist/site-metadata-writer.d.ts +25 -0
  198. package/dist/site-metadata-writer.js +55 -0
  199. package/dist/site-metadata.d.ts +113 -0
  200. package/dist/site-metadata.js +256 -0
  201. package/dist/splash-images.d.ts +75 -0
  202. package/dist/splash-images.js +186 -0
  203. package/favicon.ico +0 -0
  204. package/logo.png +0 -0
  205. package/package.json +172 -0
@@ -0,0 +1,17 @@
1
+ ---
2
+ interface Props {
3
+ siteId: string;
4
+ }
5
+
6
+ const { siteId } = Astro.props;
7
+ if (!siteId?.trim()) throw new Error('Analytics51LA requires a siteId prop.');
8
+ ---
9
+
10
+ {import.meta.env.PROD && (
11
+ <>
12
+ <script is:inline charset="UTF-8" id="LA_COLLECT" src="https://sdk.51.la/js-sdk-pro.min.js"></script>
13
+ <script is:inline define:vars={{ siteId }}>
14
+ LA.init({ id: siteId, ck: siteId, autoTrack: true, hashMode: true, screenRecord: true });
15
+ </script>
16
+ </>
17
+ )}
@@ -0,0 +1,9 @@
1
+ ---
2
+ interface Props {
3
+ name: string;
4
+ }
5
+
6
+ const { name } = Astro.props;
7
+ ---
8
+
9
+ <span>© {new Date().getFullYear()} {name}</span>
package/Footer.astro ADDED
@@ -0,0 +1,208 @@
1
+ ---
2
+ import Copyright from './Copyright.astro';
3
+ import FooterBrand from './FooterBrand.astro';
4
+ import { siteLinkGaAttributes } from './dist/analytics-events.js';
5
+ import { resolveSiteLinks, type SiteLinksOptions } from './dist/links.js';
6
+ import { resolveRssFooterLinks } from './dist/rss-footer-context.js';
7
+ import { buildInfoFromLocals, buildInfoItems, type BuildInfo } from './dist/build-info.js';
8
+
9
+ interface Props {
10
+ locale?: string;
11
+ links?: SiteLinksOptions;
12
+ buildInfo?: BuildInfo;
13
+ /** Show the decorative avatar in the brand block. Defaults to `true`. */
14
+ avatar?: boolean;
15
+ /** Swap the avatar for one random pool entry per page view. Defaults to `true`. */
16
+ randomAvatar?: boolean;
17
+ }
18
+
19
+ const { locale: propLocale, links, buildInfo: propBuildInfo, avatar, randomAvatar } = Astro.props;
20
+ const locale = propLocale ?? Astro.currentLocale ?? 'en-US';
21
+ const footerLinks = resolveRssFooterLinks(Astro.locals, locale, links);
22
+ const buildItems = buildInfoItems(propBuildInfo ?? buildInfoFromLocals(Astro.locals));
23
+ const sitemapOverride = footerLinks.overrides?.sitemap;
24
+ const resolvedLinks = resolveSiteLinks(locale, {
25
+ ...footerLinks,
26
+ // Without a declared siteUrl, the page's own Astro site excludes its catalog entry.
27
+ siteUrl: footerLinks.siteUrl ?? Astro.site?.href,
28
+ overrides: {
29
+ ...footerLinks.overrides,
30
+ sitemap: {
31
+ ...sitemapOverride,
32
+ href: sitemapOverride?.href ?? `${import.meta.env.BASE_URL}sitemap-index.xml`,
33
+ },
34
+ },
35
+ });
36
+ ---
37
+
38
+ <footer class="hagilight-footer">
39
+ <FooterBrand locale={resolvedLinks.locale} links={resolvedLinks.quick} avatar={avatar} randomAvatar={randomAvatar} />
40
+ <div class="hagilight-footer__sections">
41
+ {resolvedLinks.relatedSites.length > 0 && (
42
+ <section>
43
+ <h2>{resolvedLinks.labels.relatedSites}</h2>
44
+ <nav aria-label={resolvedLinks.labels.navigation.relatedSites}>
45
+ <ul>
46
+ {resolvedLinks.relatedSites.map((site) => (
47
+ <li>
48
+ <a href={site.href} target={site.target} rel={site.rel}>{site.name}</a>
49
+ </li>
50
+ ))}
51
+ </ul>
52
+ </nav>
53
+ </section>
54
+ )}
55
+ <section>
56
+ <h2>{resolvedLinks.labels.quickLinks}</h2>
57
+ <nav aria-label={resolvedLinks.labels.navigation.quickLinks}>
58
+ <ul>
59
+ {resolvedLinks.quick.map((link) => (
60
+ <li>
61
+ <a
62
+ href={link.href}
63
+ target={link.target}
64
+ rel={link.rel}
65
+ aria-label={link.ariaLabel}
66
+ {...siteLinkGaAttributes(link, 'footer')}
67
+ >{link.label}</a>
68
+ </li>
69
+ ))}
70
+ </ul>
71
+ </nav>
72
+ </section>
73
+ <section>
74
+ <h2>{resolvedLinks.labels.community}</h2>
75
+ <nav aria-label={resolvedLinks.labels.navigation.community}>
76
+ <ul>
77
+ {resolvedLinks.community.map((link) => (
78
+ <li>
79
+ <a
80
+ href={link.href}
81
+ target={link.target}
82
+ rel={link.rel}
83
+ aria-label={link.ariaLabel}
84
+ {...siteLinkGaAttributes(link, 'footer')}
85
+ >{link.label}</a>
86
+ </li>
87
+ ))}
88
+ </ul>
89
+ </nav>
90
+ </section>
91
+ </div>
92
+ <nav class="hagilight-footer__filings" aria-label={resolvedLinks.labels.navigation.filings}>
93
+ {resolvedLinks.filings.map((link) => (
94
+ <a
95
+ href={link.href}
96
+ target={link.target}
97
+ rel={link.rel}
98
+ aria-label={link.ariaLabel}
99
+ >{link.label}</a>
100
+ ))}
101
+ </nav>
102
+ <p class="hagilight-footer__copyright">
103
+ <Copyright name="HagiCode" />
104
+ {Astro.slots.has('attribution') && (
105
+ <>
106
+ {' | '}
107
+ <span class="hagilight-footer__attribution"><slot name="attribution" /></span>
108
+ </>
109
+ )}
110
+ {buildItems.map((item) => (
111
+ <>
112
+ {' | '}
113
+ <span
114
+ class="hagilight-footer__build"
115
+ data-build-field={item.field}
116
+ title={item.title}
117
+ data-build-commit={item.title}
118
+ >{item.label}: {item.datetime ? <time datetime={item.datetime}>{item.text}</time> : item.text}</span>
119
+ </>
120
+ ))}
121
+ </p>
122
+ </footer>
123
+
124
+ <style>
125
+ .hagilight-footer {
126
+ border-top: 1px solid var(--hagilight-footer-border, currentColor);
127
+ color: var(--hagilight-footer-color, inherit);
128
+ padding: 1.5rem 1rem 1rem;
129
+ }
130
+
131
+ .hagilight-footer__sections {
132
+ display: grid;
133
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
134
+ gap: 1.5rem;
135
+ margin: 0 auto 1.5rem;
136
+ max-width: 72rem;
137
+ }
138
+
139
+ .hagilight-footer section {
140
+ min-width: 0;
141
+ }
142
+
143
+ .hagilight-footer h2 {
144
+ margin: 0 0 0.75rem;
145
+ font-size: 0.95rem;
146
+ font-weight: 650;
147
+ }
148
+
149
+ .hagilight-footer ul {
150
+ display: grid;
151
+ gap: 0.5rem;
152
+ margin: 0;
153
+ padding: 0;
154
+ list-style: none;
155
+ }
156
+
157
+ .hagilight-footer a {
158
+ color: inherit;
159
+ text-decoration: none;
160
+ text-underline-offset: 0.2em;
161
+ }
162
+
163
+ .hagilight-footer a:hover {
164
+ text-decoration: underline;
165
+ }
166
+
167
+ .hagilight-footer a:focus-visible {
168
+ border-radius: 0.125rem;
169
+ outline: 2px solid currentColor;
170
+ outline-offset: 0.2rem;
171
+ }
172
+
173
+ .hagilight-footer__filings {
174
+ display: flex;
175
+ flex-wrap: wrap;
176
+ justify-content: center;
177
+ gap: 0.75rem 1.5rem;
178
+ border-top: 1px solid var(--hagilight-footer-border, currentColor);
179
+ padding-top: 1rem;
180
+ text-align: center;
181
+ }
182
+
183
+ .hagilight-footer__copyright {
184
+ margin: 1rem 0 0;
185
+ font-size: 0.8rem;
186
+ text-align: center;
187
+ }
188
+
189
+ .hagilight-footer__attribution {
190
+ overflow-wrap: anywhere;
191
+ }
192
+
193
+ .hagilight-footer__build {
194
+ overflow-wrap: anywhere;
195
+ }
196
+
197
+ @media (max-width: 40rem) {
198
+ .hagilight-footer__sections {
199
+ grid-template-columns: 1fr;
200
+ gap: 1.25rem;
201
+ }
202
+
203
+ .hagilight-footer__filings {
204
+ justify-content: flex-start;
205
+ gap: 0.75rem 1rem;
206
+ }
207
+ }
208
+ </style>
@@ -0,0 +1,9 @@
1
+ ---
2
+ // Rendered only when the footer avatar's random option is on, so a site that turns it off ships no picker script.
3
+ ---
4
+
5
+ <script>
6
+ import { mountRandomImages } from './dist/random-image.js';
7
+
8
+ void mountRandomImages(document);
9
+ </script>
@@ -0,0 +1,339 @@
1
+ ---
2
+ import { siteLinkGaAttributes } from './dist/analytics-events.js';
3
+ import type { SiteLink } from './dist/links.js';
4
+ import { pickFooterBrandLinks, resolveFooterBrand } from './dist/footer-brand.js';
5
+ import { footerAvatarImageAttributes, resolveFooterAvatarOptions } from './dist/footer-avatar.js';
6
+ import { randomPoolAttribute, randomPoolFromManifest } from './dist/random-image.js';
7
+ import avatarAvif from './assets/footer/avatar.avif';
8
+ import avatarWebp from './assets/footer/avatar.webp';
9
+ import avatarManifest from './assets/footer/manifest.json';
10
+ import FooterAvatarPicker from './FooterAvatarPicker.astro';
11
+
12
+ interface Props {
13
+ /** The locale `resolveSiteLinks` returned, so copy and links always agree. */
14
+ locale?: string;
15
+ /** The footer's resolved quick links; the calls to action come from here. */
16
+ links: readonly SiteLink[];
17
+ /** Show the decorative avatar. Defaults to `true`. */
18
+ avatar?: boolean;
19
+ /** Swap the avatar for one random pool entry per page view. Defaults to `true`. */
20
+ randomAvatar?: boolean;
21
+ }
22
+
23
+ const { locale, links, avatar, randomAvatar } = Astro.props;
24
+ const brand = resolveFooterBrand(locale);
25
+ const { primary, secondary } = pickFooterBrandLinks(links);
26
+ const avatarOptions = resolveFooterAvatarOptions({ avatar, randomAvatar });
27
+ const avatarPool = avatarOptions.randomAvatar ? randomPoolFromManifest(avatarManifest.pool) : undefined;
28
+ ---
29
+
30
+ <section class="hagilight-brand" lang={brand.locale} aria-labelledby="hagilight-brand-title">
31
+ <div class="hagilight-brand__lead">
32
+ <div class="hagilight-brand__title">
33
+ {avatarOptions.avatar && (
34
+ <picture class="hagilight-brand__avatar" data-random-pool={avatarPool && randomPoolAttribute(avatarPool)}>
35
+ <source type="image/avif" srcset={avatarAvif.src} />
36
+ <source type="image/webp" srcset={avatarWebp.src} />
37
+ <img src={avatarWebp.src} {...footerAvatarImageAttributes()} />
38
+ </picture>
39
+ )}
40
+ <h2 class="hagilight-brand__headline" id="hagilight-brand-title">{brand.headline}</h2>
41
+ </div>
42
+ <div class="hagilight-brand__body">
43
+ <p class="hagilight-brand__summary">{brand.summary}</p>
44
+ {(primary || secondary) && (
45
+ <div class="hagilight-brand__actions">
46
+ {primary && (
47
+ <a
48
+ class="hagilight-brand__primary"
49
+ href={primary.href}
50
+ target={primary.target}
51
+ rel={primary.rel}
52
+ aria-label={primary.ariaLabel}
53
+ {...siteLinkGaAttributes(primary, 'footer_brand')}
54
+ >
55
+ <span>{primary.label}</span>
56
+ <svg class="hagilight-brand__arrow" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true" focusable="false">
57
+ <path d="M2.5 8h10M8.5 3.5 13 8l-4.5 4.5" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" />
58
+ </svg>
59
+ </a>
60
+ )}
61
+ {secondary && (
62
+ <a
63
+ class="hagilight-brand__secondary"
64
+ href={secondary.href}
65
+ target={secondary.target}
66
+ rel={secondary.rel}
67
+ aria-label={secondary.ariaLabel}
68
+ {...siteLinkGaAttributes(secondary, 'footer_brand')}
69
+ >{secondary.label}</a>
70
+ )}
71
+ </div>
72
+ )}
73
+ </div>
74
+ </div>
75
+ <dl class="hagilight-brand__pillars">
76
+ {brand.pillars.map((pillar, index) => (
77
+ <div class="hagilight-brand__pillar" data-pillar={pillar.id} style={`--hagilight-brand-i: ${index}`}>
78
+ <dt>{pillar.label}</dt>
79
+ <dd>{pillar.description}</dd>
80
+ </div>
81
+ ))}
82
+ </dl>
83
+ {avatarOptions.randomAvatar && <FooterAvatarPicker />}
84
+ </section>
85
+
86
+ <style>
87
+ .hagilight-brand {
88
+ --_heading: var(--sl-color-white, currentColor);
89
+ --_muted: var(--hagilight-footer-muted, var(--sl-color-gray-2, var(--ifm-color-emphasis-700, color-mix(in srgb, currentColor 72%, transparent))));
90
+ --_rule: var(--hagilight-footer-border, var(--sl-color-gray-5, var(--ifm-color-emphasis-300, color-mix(in srgb, currentColor 28%, transparent))));
91
+ container: hagilight-brand / inline-size;
92
+ display: grid;
93
+ gap: 2.25rem;
94
+ margin: 0 auto 2rem;
95
+ max-width: 72rem;
96
+ padding-block: 1rem 2.25rem;
97
+ border-bottom: 1px solid var(--_rule);
98
+ }
99
+
100
+ /* Korean breaks between words, not inside them. */
101
+ .hagilight-brand:lang(ko) {
102
+ overflow-wrap: break-word;
103
+ word-break: keep-all;
104
+ }
105
+
106
+ .hagilight-brand__lead {
107
+ display: grid;
108
+ grid-template-columns: minmax(0, 1fr);
109
+ gap: 1.5rem 3.5rem;
110
+ }
111
+
112
+ .hagilight-brand__title {
113
+ display: flex;
114
+ align-items: center;
115
+ gap: 1.25rem;
116
+ min-width: 0;
117
+ }
118
+
119
+ /* The decorative avatar keeps a fixed 64 px box, so a random swap never moves the headline. */
120
+ .hagilight-brand__avatar {
121
+ display: block;
122
+ flex: none;
123
+ width: 64px;
124
+ height: 64px;
125
+ }
126
+
127
+ .hagilight-brand__avatar img {
128
+ display: block;
129
+ width: 100%;
130
+ height: 100%;
131
+ border-radius: 0.5rem;
132
+ object-fit: cover;
133
+ }
134
+
135
+ /* Hidden in a brand block narrower than 360 px, where the headline needs the full width. */
136
+ @container hagilight-brand (max-width: 359.98px) {
137
+ .hagilight-brand__avatar {
138
+ display: none;
139
+ }
140
+ }
141
+
142
+ .hagilight-brand__headline {
143
+ margin: 0;
144
+ color: var(--_heading);
145
+ font-size: clamp(1.75rem, 1.1rem + 2.6vw, 3rem);
146
+ font-size: clamp(1.75rem, 1rem + 3.2cqi, 3rem);
147
+ font-weight: 700;
148
+ letter-spacing: -0.02em;
149
+ line-height: 1.12;
150
+ text-wrap: balance;
151
+ }
152
+
153
+ .hagilight-brand__headline:lang(zh),
154
+ .hagilight-brand__headline:lang(ja),
155
+ .hagilight-brand__headline:lang(ko) {
156
+ letter-spacing: 0;
157
+ line-height: 1.25;
158
+ }
159
+
160
+ .hagilight-brand__body {
161
+ display: grid;
162
+ gap: 1.25rem;
163
+ justify-items: start;
164
+ min-width: 0;
165
+ }
166
+
167
+ .hagilight-brand__summary {
168
+ margin: 0;
169
+ max-width: 62ch;
170
+ color: var(--_muted);
171
+ font-size: 1rem;
172
+ line-height: 1.65;
173
+ text-wrap: pretty;
174
+ }
175
+
176
+ .hagilight-brand__actions {
177
+ display: flex;
178
+ flex-wrap: wrap;
179
+ align-items: center;
180
+ gap: 0.25rem 1.5rem;
181
+ }
182
+
183
+ .hagilight-brand__primary,
184
+ .hagilight-brand__secondary {
185
+ display: inline-flex;
186
+ align-items: center;
187
+ min-height: 2.75rem;
188
+ color: var(--_heading);
189
+ text-decoration: none;
190
+ }
191
+
192
+ .hagilight-brand__primary {
193
+ gap: 0.6rem;
194
+ border: 2px solid currentColor;
195
+ border-radius: 0.5rem;
196
+ padding-inline: 1.1rem;
197
+ font-weight: 650;
198
+ transition: background-color 180ms ease-out;
199
+ }
200
+
201
+ .hagilight-brand__primary:hover {
202
+ background-color: color-mix(in srgb, currentColor 10%, transparent);
203
+ }
204
+
205
+ .hagilight-brand__arrow {
206
+ flex: none;
207
+ transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
208
+ }
209
+
210
+ .hagilight-brand__primary:hover .hagilight-brand__arrow,
211
+ .hagilight-brand__primary:focus-visible .hagilight-brand__arrow {
212
+ transform: translateX(0.3rem);
213
+ }
214
+
215
+ .hagilight-brand__secondary {
216
+ text-decoration: underline;
217
+ text-decoration-thickness: 1px;
218
+ text-underline-offset: 0.3em;
219
+ }
220
+
221
+ .hagilight-brand__secondary:hover {
222
+ text-decoration-thickness: 2px;
223
+ }
224
+
225
+ .hagilight-brand a:focus-visible {
226
+ border-radius: 0.25rem;
227
+ outline: 2px solid currentColor;
228
+ outline-offset: 0.25rem;
229
+ }
230
+
231
+ .hagilight-brand__pillars {
232
+ display: grid;
233
+ grid-template-columns: minmax(0, 1fr);
234
+ gap: 1.25rem;
235
+ margin: 0;
236
+ padding: 0;
237
+ }
238
+
239
+ .hagilight-brand__pillar {
240
+ position: relative;
241
+ margin: 0;
242
+ padding-top: 1rem;
243
+ border-top: 1px solid var(--_rule);
244
+ }
245
+
246
+ /* The heavy rule that the scroll-driven reveal draws over the hairline track. */
247
+ .hagilight-brand__pillar::before {
248
+ content: '';
249
+ position: absolute;
250
+ inset: -1px 0 auto;
251
+ height: 2px;
252
+ background: var(--_heading);
253
+ transform-origin: left center;
254
+ }
255
+
256
+ .hagilight-brand__pillar dt {
257
+ margin: 0 0 0.4rem;
258
+ color: var(--_heading);
259
+ font-size: 1.05rem;
260
+ font-weight: 650;
261
+ }
262
+
263
+ .hagilight-brand__pillar dd {
264
+ margin: 0;
265
+ max-width: none;
266
+ color: var(--_muted);
267
+ font-size: 0.9rem;
268
+ line-height: 1.6;
269
+ text-wrap: pretty;
270
+ }
271
+
272
+ /* Breakpoints follow the width the footer is given, not the viewport: Starlight's content pane is narrow. */
273
+ @container hagilight-brand (min-width: 40rem) {
274
+ .hagilight-brand__pillars {
275
+ grid-template-columns: repeat(3, minmax(0, 1fr));
276
+ gap: 1.5rem 2.5rem;
277
+ }
278
+
279
+ .hagilight-brand__pillar dd {
280
+ max-width: 34ch;
281
+ }
282
+ }
283
+
284
+ @container hagilight-brand (min-width: 52rem) {
285
+ .hagilight-brand__lead {
286
+ grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
287
+ align-items: end;
288
+ }
289
+ }
290
+
291
+ /*
292
+ * The one authored moment: as the footer scrolls into view the headline is uncovered from
293
+ * its baseline and the three pillar rules draw in left to right, one after another.
294
+ * Without scroll-driven animation, or with reduced motion, everything is simply shown.
295
+ */
296
+ @media (prefers-reduced-motion: no-preference) {
297
+ @supports (animation-timeline: view()) {
298
+ .hagilight-brand__headline {
299
+ animation-name: hagilight-brand-uncover;
300
+ animation-timing-function: linear;
301
+ animation-fill-mode: both;
302
+ animation-timeline: view();
303
+ animation-range: entry 0% entry 80%;
304
+ }
305
+
306
+ .hagilight-brand__pillar::before {
307
+ animation-name: hagilight-brand-draw;
308
+ animation-timing-function: linear;
309
+ animation-fill-mode: both;
310
+ animation-timeline: view();
311
+ animation-range:
312
+ entry calc(10% + var(--hagilight-brand-i, 0) * 14%)
313
+ entry calc(70% + var(--hagilight-brand-i, 0) * 14%);
314
+ }
315
+ }
316
+ }
317
+
318
+ @keyframes hagilight-brand-uncover {
319
+ from {
320
+ clip-path: inset(0 0 100% 0);
321
+ transform: translateY(0.4em);
322
+ }
323
+
324
+ to {
325
+ clip-path: inset(0 0 -0.2em 0);
326
+ transform: none;
327
+ }
328
+ }
329
+
330
+ @keyframes hagilight-brand-draw {
331
+ from {
332
+ transform: scaleX(0);
333
+ }
334
+
335
+ to {
336
+ transform: scaleX(1);
337
+ }
338
+ }
339
+ </style>
@@ -0,0 +1,30 @@
1
+ ---
2
+ interface Props {
3
+ measurementId: string;
4
+ }
5
+
6
+ const { measurementId } = Astro.props;
7
+ if (!measurementId?.trim()) throw new Error('GoogleAnalytics requires a measurementId prop.');
8
+ const scriptUrl = `https://www.googletagmanager.com/gtag/js?id=${encodeURIComponent(measurementId)}`;
9
+ // Astro wraps a script that receives template variables in an IIFE, which would keep gtag out of
10
+ // the global scope and silently disable the click-event listener below. Assign window.gtag explicitly.
11
+ const initScript = [
12
+ 'window.dataLayer = window.dataLayer || [];',
13
+ 'window.gtag = function gtag(){ window.dataLayer.push(arguments); };',
14
+ "window.gtag('js', new Date());",
15
+ `window.gtag('config', ${JSON.stringify(measurementId).replace(/</g, '\\u003c')});`,
16
+ ].join('\n');
17
+ ---
18
+
19
+ {import.meta.env.PROD && (
20
+ <>
21
+ <script async src={scriptUrl}></script>
22
+ <script is:inline set:html={initScript}></script>
23
+ </>
24
+ )}
25
+
26
+ <script>
27
+ import { installGaEventTracking } from './dist/analytics-events.js';
28
+
29
+ installGaEventTracking();
30
+ </script>
package/PostHog.astro ADDED
@@ -0,0 +1,11 @@
1
+ ---
2
+ import { posthogInitScript } from './dist/posthog.js';
3
+
4
+ interface Props {
5
+ apiKey?: string;
6
+ }
7
+
8
+ const script = posthogInitScript(Astro.props.apiKey);
9
+ ---
10
+
11
+ {import.meta.env.PROD && <script is:inline set:html={script}></script>}