Skip to content
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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

docs: migration to Astro #41251

wants to merge 1 commit into from

Conversation

julien-deramond
Copy link
Member

@julien-deramond julien-deramond commented Feb 26, 2025

This PR migrates our documentation to Astro based on previous work at #38319.

🌟 Netlify preview

Note

Last commit gathered: 5605e96 (March 8, 2025)

Sub-tasks

  • Fix Netlify deployment
  • From the previous work, updated this branch with commits from 1fe9067; the previous PR stopped around March 2023 so I started to gather commits from begining of March 2023.
  • Double-check the content of what comes from site/assets (must be the latest versions at the end)
  • Fix linting
    • Add && astro check --root site && tsc -p site --noEmit to the astro-lint script
  • Bump Astro dependencies (see c49f234)
    • Migrate to modern way of handling Astro websites (check migration guides)? Or could wait for another PR?
  • Re-enable progressively .github/workflows/*
  • Move from site-new to site
  • Change scripts names to use old ones OR migrate the entire documentation to build and deploy the website
  • Get rid of all Hugo references (files, mentions, etc.), or adapt them in the documentation
  • The documentation generated/built must work within the gh-pages with the same process as before at first
  • Check /docsref page
  • Check Placeholder component precisely (see for instance f52d4a3)
  • Handle this change precisely: f8a56da
  • For all <ScssDocs where file="site" -> find the site-new reference so that npm run astro-build builds correctly
  • Double-check the rendering of all pages
    • Special check for the migration page (including the diff rendering)
  • Check more in detail 1729bcc compared to the new Code.astro file
  • Double-check the rendering of <JsDocs> from 06f7c3b + 34c2725 + e2854b9 (compared to main branch)
  • Double-check 74c6f2b has been correctly reintegrated
  • Check if there's anything to do with e468daa#diff-90090845e271c47d4fb564334a22156612e18b9bbc61397ed6dcc29bb6ddb20a (site/layouts/_default/examples.html with integrity values etc.)
  • Check 688d7e3 so that we maybe add the aria-label if not present by default in Astro
  • In index.astro examples, double-check that the external scripts and links have been set with the latest version + integrity
  • We didn't use defer (see 45fe28c); do we need that with Astro?
  • Handle correctly the sitemap (see 9480a3d + 72d3b6e)
  • Render image hook? (see 2ba7dae#diff-14181aac55c6feb7b2a6e08c61d78e3f31be6f31b6e206a365cdcc3e9d0b5934)
  • Check all TODO(Astro migration) comments
  • eslint must work with .md AND .mdx files to check the JS that is contained in the code snippets (Markdown code)
  • Check Mark's feedback (March, 8) -> "One thing I've noticed is I think I need to kill server often when rebuilding Bootstrap CSS"
  • Missing search bar in the homepage (compared to https://twbs-bootstrap.netlify.app/)

Stackblitz

  • Basic HTML/CSS examples
  • Basic components like Accordions
  • More complex examples like Tooltips, Popovers, etc. don't work. The JS file is correctly uploaded to StackBlitz, but doesn't do anything.

Syntax highlighting

  • Clean up the _syntax.scss file that probably still have things related to Chroma.

  • The colors are reactive to light/dark mode, but aren't exactly the same as Bootstrap. It might be re-plugged or handled differently to have the same rendering

  • Add $ or >PM prefixes for these languages

  • Diff code is highlighted with colors

  • At docs/5.3/getting-started/download#yarn, we should have a $ at each line:

    Screenshot 2025-03-05 at 22 38 19

  • At docs/5.3/docsref, there are extra spaces (that should be automatically removed by reindenting the content of <ScssDocs> and <JsDocs>)

    Screenshot 2025-03-05 at 22 39 31

  • Identation issues when we use stuff like:

    <Example code={`<div class="accordion" id="accordionExample">
    <div class="accordion-item">
      <h2 class="accordion-header">

    that renders

    Screenshot 2025-03-05 at 22 41 26

Deployment

Optional

  • /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.

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",
Copy link
Member Author

@julien-deramond julien-deramond Feb 26, 2025

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

@julien-deramond julien-deramond force-pushed the main-jd-docs-astro branch 25 times, most recently from 0fd6236 to 43a8c70 Compare March 3, 2025 21:01
@julien-deramond julien-deramond force-pushed the main-jd-docs-astro branch 8 times, most recently from 3ba5166 to 15a51b2 Compare March 5, 2025 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant