Add a Footer
This chapter guides you how to add a custom footer to all pages.
- Add footer component: Add a new Astro component file to your project under
src/components/Footer.astro
. - Implement footer: Implement your footer component using HTML and Tailwind CSS. Here is an example:
------<footerclass="flex h-36 w-full items-center justify-center bg-gray-800 px-4 text-gray-200 md:px-8">{Astro.locals.i18n.t("x.footer.text")}</footer>
- Add translations: If your footer uses translation keys like in the example above, add the translations to
src/translations
. - Set footer in configuration: Inside
astro.config.mjs
add afooterComponent
property to the LightNet integration. This needs to reference the component created in step 1:astro.config.mjs export default defineConfig({integrations: [lightnet({// ...footerComponent: "./src/components/Footer.astro",}),],})