Skip to content

Commit 80f014c

Browse files
feat(footer): surface RSS link through SiteFooter wrapper
Introduce a SiteFooter component that wraps the hagilight Footer and injects a localized Docs Blog RSS extra link, then migrate all page templates from Footer to SiteFooter and update the homepage banner test assertion. Co-Authored-By: Hagicode <noreply@hagicode.com> Signed-off-by: newbe36524 <newbe36524@hotmail.com>
1 parent 762029a commit 80f014c

7 files changed

Lines changed: 48 additions & 11 deletions

File tree

‎src/components/SiteFooter.astro‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
import Footer from '@hagicode/hagilight/Footer';
3+
import { getLinkWithLocale } from '@/lib/shared/links';
4+
import type { SiteLocale } from '@/i18n/locale-metadata';
5+
6+
interface Props {
7+
locale: SiteLocale;
8+
}
9+
10+
const { locale } = Astro.props;
11+
const docsBlogRssLabels: Record<SiteLocale, string> = {
12+
'en-US': 'Docs Blog RSS',
13+
'zh-CN': '文档博客 RSS',
14+
'zh-Hant': '文件部落格 RSS',
15+
'ja-JP': 'Docs ブログ RSS',
16+
'ko-KR': 'Docs 블로그 RSS',
17+
'de-DE': 'Docs-Blog-RSS',
18+
'fr-FR': 'Flux RSS du blog Docs',
19+
'es-ES': 'RSS del blog de Docs',
20+
'pt-BR': 'RSS do blog Docs',
21+
'ru-RU': 'RSS блога Docs',
22+
};
23+
---
24+
25+
<Footer
26+
locale={locale}
27+
links={{
28+
extraLinks: {
29+
quick: [{
30+
id: 'docs-blog-rss',
31+
label: docsBlogRssLabels[locale],
32+
href: getLinkWithLocale('rss', locale),
33+
external: true,
34+
}],
35+
},
36+
}}
37+
/>

‎src/components/about/AboutSnapshotDocument.astro‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import AnalyticsScripts from '@/components/AnalyticsScripts.astro';
33
import GoogleAnalytics from '@/components/GoogleAnalytics.astro';
44
import MicrosoftStoreBadgeScript from '@/components/MicrosoftStoreBadgeScript.astro';
5-
import Footer from '@hagicode/hagilight/Footer';
5+
import SiteFooter from '@/components/SiteFooter.astro';
66
import Navbar from '@/components/home/Navbar';
77
import SeoAlternateLinks from '@/components/SeoAlternateLinks.astro';
88
import type { AboutPageModel } from '@/lib/about-page-model';
@@ -80,7 +80,7 @@ const interactiveCopy = getHomepageInteractiveCopy(currentLocale);
8080
languageSwitcherCopy={interactiveCopy.languageSwitcher}
8181
/>
8282
<AboutSnapshotPage model={model} />
83-
<Footer locale={model.locale} />
83+
<SiteFooter locale={model.locale} />
8484
<AnalyticsScripts />
8585
</body>
8686
</html>

‎src/components/structured-article/StructuredArticlePage.astro‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
import GoogleAnalytics from '@/components/GoogleAnalytics.astro';
33
import MicrosoftStoreBadgeScript from '@/components/MicrosoftStoreBadgeScript.astro';
4-
import Footer from '@hagicode/hagilight/Footer';
4+
import SiteFooter from '@/components/SiteFooter.astro';
55
import Navbar from '@/components/home/Navbar';
66
import SeoAlternateLinks from '@/components/SeoAlternateLinks.astro';
77
import DesktopHero from '@/components/desktop/DesktopHero';
@@ -119,6 +119,6 @@ const heroTagline = t('desktopHero.tagline');
119119
</section>
120120
</div>
121121
</main>
122-
<Footer locale={locale} />
122+
<SiteFooter locale={locale} />
123123
</body>
124124
</html>

‎src/page-templates/ContainerPage.astro‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import MicrosoftStoreBadgeScript from '@/components/MicrosoftStoreBadgeScript.as
55
import '@/styles/homepage.css';
66
import '@/styles/container.css';
77
import Navbar from '@/components/home/Navbar';
8-
import Footer from '@hagicode/hagilight/Footer';
8+
import SiteFooter from '@/components/SiteFooter.astro';
99
import FeatureIcon from '@/components/desktop/FeatureIcon.astro';
1010
import FeatureTagIcon from '@/components/desktop/FeatureTagIcon.astro';
1111
import SeoAlternateLinks from '@/components/SeoAlternateLinks.astro';
@@ -123,7 +123,7 @@ const dockerComposeDocsUrl = getLinkWithLocale('dockerCompose', locale);
123123
</section>
124124
</main>
125125

126-
<Footer locale={locale} />
126+
<SiteFooter locale={locale} />
127127
<AnalyticsScripts />
128128
</body>
129129
</html>

‎src/page-templates/DesktopPage.astro‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import GoogleAnalytics from '@/components/GoogleAnalytics.astro';
44
import '@/styles/homepage.css';
55
import '@/styles/desktop.css';
66
import Navbar from '@/components/home/Navbar';
7-
import Footer from '@hagicode/hagilight/Footer';
7+
import SiteFooter from '@/components/SiteFooter.astro';
88
import DesktopHero from '@/components/desktop/DesktopHero';
99
import FeatureIcon from '@/components/desktop/FeatureIcon.astro';
1010
import MicrosoftStoreBadgeScript from '@/components/MicrosoftStoreBadgeScript.astro';
@@ -159,7 +159,7 @@ const canonicalUrl = getAbsoluteSiteUrl('/desktop/', locale, siteBase);
159159

160160
</main>
161161

162-
<Footer locale={locale} />
162+
<SiteFooter locale={locale} />
163163
<AnalyticsScripts />
164164
</body>
165165
</html>

‎src/page-templates/HomePage.astro‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import ShowcaseSection from '@/components/home/ShowcaseSection';
66
import VideoShowcase from '@/components/home/VideoShowcase';
77
import PricingComparisonSection from '@/components/home/PricingComparisonSection';
88
import PromotoBanner from '@hagicode/hagilight/PromotoBanner';
9-
import Footer from '@hagicode/hagilight/Footer';
9+
import SiteFooter from '@/components/SiteFooter.astro';
1010
import LunarNewYearDecorations from '@/components/home/LunarNewYearDecorations';
1111
import AnalyticsScripts from '@/components/AnalyticsScripts.astro';
1212
import GoogleAnalytics from '@/components/GoogleAnalytics.astro';
@@ -123,7 +123,7 @@ const canonicalUrl = getAbsoluteSiteUrl('/', locale, siteBase);
123123
</main>
124124

125125
<PromotoBanner locale={locale} />
126-
<Footer locale={locale} />
126+
<SiteFooter locale={locale} />
127127
<AnalyticsScripts />
128128
</body>
129129
</html>

‎src/page-templates/HomePage.banner.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe('homepage promotion integration', () => {
77

88
expect(source).toContain("import PromotoBanner from '@hagicode/hagilight/PromotoBanner'");
99
expect(source.match(/<PromotoBanner locale=\{locale\} \/>/gu)).toHaveLength(1);
10-
expect(source.indexOf('<PromotoBanner')).toBeLessThan(source.indexOf('<Footer'));
10+
expect(source.indexOf('<PromotoBanner')).toBeLessThan(source.indexOf('<SiteFooter'));
1111
expect(source).not.toContain('PromoteCard');
1212
});
1313
});

0 commit comments

Comments
 (0)