-
-
Notifications
You must be signed in to change notification settings - Fork 79.2k
Docs: migration from Hugo to Astro #41251
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4b23c7d to
fa28fc4
Compare
julien-deramond
commented
Feb 26, 2025
0fd6236 to
43a8c70
Compare
d3ee7d0 to
e9b5210
Compare
XhmikosR
reviewed
Apr 14, 2025
Co-authored-by: HiDeoo <[email protected]> Co-authored-by: Mark Otto <[email protected]>
4a89b70 to
88c5bde
Compare
|
Holy crap you did it! Woooo 🎉 |
17 tasks
10 tasks
This was referenced Aug 19, 2025
This was referenced Aug 26, 2025
This was referenced Sep 2, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is the result of a long process of migration from Hugo to Astro.
It's based on a previous work made with @HiDeoo a long time ago at #38319.
I've restarted from there and spent quite some time gathering all the commits from the main branch, and adapting everything so that the rendering is exactly the same as the one from https://twbs-bootstrap.netlify.app.
Shoutout also to @mdo for the helpful commits and reviews!
🌟 Netlify preview
Note
Last commit gathered: 99a0dc6 (April 11, 2025)
Placeholder Documentation Component
The placeholder documentation component (previously a shortcode) is slightly different for only one use case at https://deploy-preview-41251--twbs-bootstrap.netlify.app/docs/5.3/utilities/object-fit/#examples where the colors are different from https://twbs-bootstrap.netlify.app/docs/5.3/utilities/object-fit/#examples.
IMHO, this is an acceptable modification that avoids to have this specificity f52d4a3
ESLint Support - JS in MDX
Right now, it doesn't seem possible to handle things like
{/* <!-- eslint-disable whatever --> */}in a MDX file. So, I haven't added the JS check in MDX files.Sub-tasks
site/assets(must be the latest versions at the end).github/workflows/*site-newtositegh-pageswith the same process as before at first<ScssDocswherefile="site"-> find thesite-newreference so thatnpm run astro-buildbuilds correctly:in:rootat /docs/5.3/customize/css-variablesCode.astrofile -> it's apparently not needed as already handled<JsDocs>from 06f7c3b + 34c2725 + e2854b9 (compared tomainbranch)site/layouts/_default/examples.htmlwith integrity values etc.)index.astroexamples, double-check that the external scripts use the right versions and sha384, compared tomainbranchTODO(Astro migration)commentsdocs-vnuissues and reuse it everywhere like it was the case inmainbranchsw.js,CNAME, and mayb other "external" filesStackblitz
Syntax highlighting and code snippets
_syntax.scssfile that probably still have things related to Chroma.$or>PMprefixes for these languagesdocs/5.3/getting-started/download#yarn, we should have a$at each line<JsDocs><ScssDocs><Example code={}>with wrapping elementsDeployment
TODO(Astro migration)part from our.gitignorefilePostponed tasks
<ScssDocs>renders// scss-docs-startand// scss-docs-endin /customize/color-modes#sass-variables and shouldn't. It's because this is a special use case where there's a// scss-docs-start sass-dark-mode-varswrapper that can contains several// scss-docs-start theme-*-dark-variablesblocks...<ScssDocs>renders// scss-docs-start vr-variables(and// scss-docs-end) in /docs/5.3/content/typography and shouldn't/docs/5.3/examples/dashboard-rtl/and/docs/5.3/examples/dashboard-rtlbehave differently in dev mode, depending on whether the trailing slash is present. This affects CSS and JS not loading (the local server looks for/docs/5.3/examples/dashboard.cssfor instance), though the issue does not occur on production, on Netlify. Please note that when you're navigating in the website by following the links, it works well.<div class="bd-example">...</div>by<Example showMarkup={false} code={...} />astro check --root site,tsc -p site --noEmitResponsiveImage.astrocomponent to implement the equivalent of Hugo'simageConfigand calculate the width and height of the image automaticallyaria-labelto the anchor links in the docs (see 688d7e3). Could be suggested upstream as difficult to implement from our own code.deferlike in 45fe28c, or we keep the using scripts insite/assets/*&& rm -rf _site && cp -r site/dist _sitewas temporary to make Netlify works as it checks the built content in_site. It would need a live coding session with access to the Netlify account to change that.