feat: add footer to the hub page
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
import { getDictionary } from '../i18n';
|
||||||
|
import type { Locale } from '../i18n/locale';
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
locale: Locale;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { locale } = Astro.props;
|
||||||
|
const t = getDictionary(locale);
|
||||||
|
const year = new Date().getFullYear();
|
||||||
|
---
|
||||||
|
<footer class="site-footer">
|
||||||
|
<p>© {year} {t.footer.text}</p>
|
||||||
|
</footer>
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
import BaseLayout from '../../layouts/BaseLayout.astro';
|
import BaseLayout from '../../layouts/BaseLayout.astro';
|
||||||
import Header from '../../components/Header.astro';
|
import Header from '../../components/Header.astro';
|
||||||
|
import Footer from '../../components/Footer.astro';
|
||||||
import ServiceCard from '../../components/ServiceCard.astro';
|
import ServiceCard from '../../components/ServiceCard.astro';
|
||||||
import { getDictionary } from '../../i18n';
|
import { getDictionary } from '../../i18n';
|
||||||
import { services } from '../../i18n/services';
|
import { services } from '../../i18n/services';
|
||||||
@@ -22,4 +23,5 @@ const t = getDictionary(locale);
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
|
<Footer locale={locale} />
|
||||||
</BaseLayout>
|
</BaseLayout>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
import BaseLayout from '../../layouts/BaseLayout.astro';
|
import BaseLayout from '../../layouts/BaseLayout.astro';
|
||||||
import Header from '../../components/Header.astro';
|
import Header from '../../components/Header.astro';
|
||||||
|
import Footer from '../../components/Footer.astro';
|
||||||
import ServiceCard from '../../components/ServiceCard.astro';
|
import ServiceCard from '../../components/ServiceCard.astro';
|
||||||
import { getDictionary } from '../../i18n';
|
import { getDictionary } from '../../i18n';
|
||||||
import { services } from '../../i18n/services';
|
import { services } from '../../i18n/services';
|
||||||
@@ -22,4 +23,5 @@ const t = getDictionary(locale);
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
|
<Footer locale={locale} />
|
||||||
</BaseLayout>
|
</BaseLayout>
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { describe, it, expect, beforeAll } from 'vitest';
|
||||||
|
import { execSync } from 'node:child_process';
|
||||||
|
import { readFileSync } from 'node:fs';
|
||||||
|
|
||||||
|
describe('footer', () => {
|
||||||
|
beforeAll(() => {
|
||||||
|
execSync('npm run build', { stdio: 'inherit' });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders the current year and brand name on both locales', () => {
|
||||||
|
const en = readFileSync('dist/en/index.html', 'utf-8');
|
||||||
|
const fr = readFileSync('dist/fr/index.html', 'utf-8');
|
||||||
|
const yearPattern = /©\s*\d{4}\s*Ombrora/;
|
||||||
|
expect(en).toMatch(yearPattern);
|
||||||
|
expect(fr).toMatch(yearPattern);
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user