-
Notifications
You must be signed in to change notification settings - Fork 102
feat(astro): add support for footer override #423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
adds support for overriding the footer component, similar to the TopBar override setup. Users can now customize footer content such as legal terms, contact info, and copyrights. this change introduces `Footer.astro` and `FooterWrapper.astro` files to allow flexible slotting of footer items, improving customization for standalone tutorial deployments close #323
Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.
Deploying tutorialkit-demo-page with Cloudflare Pages Cloudflare Pages
67a5d3e
@AriPerkkio
AriPerkkio
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @RonithManikonda, looks good so far! 💯
There are still couple of places we need to update:
- Add the entrypoint here:
tutorialkit/packages/astro/package.json
Lines 16 to 25 in 2740bc9
- Mention the component here in the documentation:
tutorialkit/docs/tutorialkit.dev/src/content/docs/guides/overriding-components.mdx
Line 12 in 04ea97f
- Add types here:
tutorialkit/packages/astro/src/default/env-default.d.ts
Lines 10 to 15 in 04ea97f
- Add component here:
tutorialkit/packages/astro/src/vite-plugins/override-components.ts
Lines 1 to 129 in 2740bc9
extend the override-components plugin to allow customization of the Footer component. added a new `Footer` option to the `OverrideComponentsOptions` interface, updated the `load` function to export the Footer, and introduced a `resolveDefaultFooter` helper function to handle default paths based on the `defaultRoutes` option. BREAKING CHANGE: users upgrading to this version must update their `astro.config.ts` if they wish to customize the new Footer component. refer to the updated documentation for usage.
@AriPerkkio
AriPerkkio
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The FooterWrapper.astro should have following elements:
These should be passed to Footer with following named slots:
edit-page-linklesson-linkwebcontainers-link
So for example the Edit Page -link becomes something like
-<div class="pb-4 mt-8 border-b border-tk-border-secondary"> +<div slot="edit-page-link" class="pb-4 mt-8 border-b border-tk-border-secondary"> <a href={editPageLink} class="inline-flex flex-items-center text-tk-elements-link-secondaryColor hover:text-tk-elements-link-secondaryColorHover hover:underline"
Then in Footer.astro we would have those slots like:
<footer> <slot name="edit-page-link" /> <slot name="lesson-links" /> <slot name="webcontainers-link" /> </footer>
Then the FooterWrapper.astro should be used in TutorialContent.astro.
adds support for overriding the footer component via named slots (edit-page-link, lesson-links, webcontainers-link) in Footer.astro, enabling flexible customization of footer content in FooterWrapper.astro. updated TutorialContent.astro to use FooterWrapper.astro for rendering footer elements, aligning with the new slot-based structure. this change ensures consistent and modular handling of footer elements across tutorials. close #423
...itz/tutorialkit into ronith/overriding-footer
The Fragment component was causing a linter error when used with slots in Astro. Replaced it with a div element which is properly supported. closes #323
adds support for overriding the footer component, similar to the TopBar override setup. Users can now customize footer content such as legal terms, contact info, and copyrights.
this change introduces
Footer.astroandFooterWrapper.astrofiles to allow flexible slotting of footer items, improving customization for standalone tutorial deploymentsclose #323