-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
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
docs: migration to Astro #41251
base: main
Are you sure you want to change the base?
docs: migration to Astro #41251
Conversation
4b23c7d
to
fa28fc4
Compare
package.json
Outdated
"watch-js-docs": "nodemon --watch site/assets/js/ --ext js --exec \"npm run js-lint\"" | ||
"watch-js-docs": "nodemon --watch site/assets/js/ --ext js --exec \"npm run js-lint\"", | ||
"astro-dev": "astro dev --root site-new", | ||
"astro-build": "astro build --root site-new && rm -rf _site && cp -r site-new/dist _site", |
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.
&& rm -rf _site && cp -r site/dist _site
is temporary to make Netlify works as it checks the built content in _site
0fd6236
to
43a8c70
Compare
5dbe338
to
50499fe
Compare
aliases: "/migration/" | ||
toc: true | ||
--- | ||
|
||
## v5.3.6 |
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.
I've added it like it was done from Jekyll to Hugo back then, but it can't be removed if not necessary.
50499fe
to
c06bb9f
Compare
12faac7
to
a8933af
Compare
1fd6040
to
d3ee7d0
Compare
Co-authored-by: HiDeoo <494699+HiDeoo@users.noreply.github.com> Co-authored-by: Mark Otto <markdotto@gmail.com>
d3ee7d0
to
e9b5210
Compare
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-new
tosite
gh-pages
with the same process as before at first<ScssDocs
wherefile="site"
-> find thesite-new
reference so thatnpm run astro-build
builds correctly<ScssDocs>
renders// scss-docs-start
and// scss-docs-end
in /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-vars
wrapper that can contains several// scss-docs-start theme-*-dark-variables
blocks...<ScssDocs>
renders// scss-docs-start vr-variables
(and// scss-docs-end
) in /docs/5.3/content/typography and shouldn't:
in:root
at /docs/5.3/customize/css-variablesCode.astro
file -> it's apparently not needed as already handled<JsDocs>
from 06f7c3b + 34c2725 + e2854b9 (compared tomain
branch)site/layouts/_default/examples.html
with integrity values etc.)index.astro
examples, double-check that the external scripts use the right versions and sha384, compared tomain
branchTODO(Astro migration)
commentsdocs-vnu
issues and reuse it everywhere like it was the case inmain
branchsw.js
,CNAME
, and mayb other "external" filesStackblitz
Syntax highlighting and code snippets
_syntax.scss
file that probably still have things related to Chroma.$
or>PM
prefixes 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.gitignore
filePostponed tasks
/docs/5.3/examples/dashboard-rtl/
and/docs/5.3/examples/dashboard-rtl
behave 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.css
for 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 --noEmit
ResponsiveImage.astro
component to implement the equivalent of Hugo'simageConfig
and calculate the width and height of the image automaticallyaria-label
to the anchor links in the docs (see 688d7e3). Could be suggested upstream as difficult to implement from our own code.defer
like in 45fe28c, or we keep the using scripts insite/assets/*