Skip to content

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 1 commit into from
Apr 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
**/dist/
**/vendor/
/_site/
/site/public/
/js/coverage/
/site/static/sw.js
/site/static/docs/**/assets/sw.js
/site/layouts/partials/
7 changes: 6 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,12 @@
},
{
"files": [
"site/assets/js/**"
"site/src/assets/application.js",
"site/src/assets/partials/*.js",
"site/src/assets/search.js",
"site/src/assets/snippets.js",
"site/src/assets/stackblitz.js",
"site/src/plugins/*.js"
],
"parserOptions": {
"sourceType": "module",
Expand Down
32 changes: 16 additions & 16 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to Bootstrap

Looking to contribute something to Bootstrap? **Here's how you can help.**
Looking to contribute something to Bootstrap? **Heres how you can help.**

Please take a moment to review this document in order to make the contribution
process easy and effective for everyone involved.
Expand Down Expand Up @@ -33,14 +33,14 @@ restrictions:

## Issues assignment

The core team will be looking at the open issues, analyze them, and provide guidance on how to proceed. **Issues won't be assigned to anyone outside the core team.** However, contributors are welcome to participate in the discussion and provide their input on how to best solve the issue, and even submit a PR if they want to. Please wait that the issue is ready to be worked on before submitting a PR, we don't want to waste your time.
The core team will be looking at the open issues, analyze them, and provide guidance on how to proceed. **Issues wont be assigned to anyone outside the core team.** However, contributors are welcome to participate in the discussion and provide their input on how to best solve the issue, and even submit a PR if they want to. Please wait that the issue is ready to be worked on before submitting a PR, we dont want to waste your time.

Please keep in mind that the core team is small, has limited resources and that we are not always able to respond immediately. We will try to provide feedback as soon as possible, but please be patient. If you don't get a response immediately, it doesn't mean that we are ignoring you or that we don't care about your issue or PR. We will get back to you as soon as we can.
Please keep in mind that the core team is small, has limited resources and that we are not always able to respond immediately. We will try to provide feedback as soon as possible, but please be patient. If you dont get a response immediately, it doesnt mean that we are ignoring you or that we dont care about your issue or PR. We will get back to you as soon as we can.


## Issues and labels

Our bug tracker utilizes several labels to help organize and identify issues. Here's what they represent and how we use them:
Our bug tracker utilizes several labels to help organize and identify issues. Heres what they represent and how we use them:

- `browser bug` - Issues that are reported to us, but actually are the result of a browser-specific bug. These are diagnosed with reduced test cases and result in an issue opened on that browser's own bug tracker.
- `confirmed` - Issues that have been confirmed with a reduced test case and identify a bug in Bootstrap.
Expand All @@ -64,7 +64,7 @@ Good bug reports are extremely helpful, so thanks!
Guidelines for bug reports:

0. **[Validate your HTML](https://html5.validator.nu/)** to ensure your
problem isn't caused by a simple error in your own code.
problem isnt caused by a simple error in your own code.

1. **Use the GitHub issue search** — check if the issue has already been
reported.
Expand All @@ -77,7 +77,7 @@ Guidelines for bug reports:
These [v4 CodePen](https://codepen.io/team/bootstrap/pen/yLabNQL) and [v5 CodePen](https://codepen.io/team/bootstrap/pen/qBamdLj) are helpful templates.


A good bug report shouldn't leave others needing to chase you up for more
A good bug report shouldnt leave others needing to chase you up for more
information. Please try to be as detailed as possible in your report. What is
your environment? What steps will reproduce the issue? What browser(s) and OS
experience the problem? Do other browsers show the bug differently? What
Expand Down Expand Up @@ -109,16 +109,16 @@ Sometimes bugs reported to us are actually caused by bugs in the browser(s) them
| Vendor(s) | Browser(s) | Rendering engine | Bug reporting website(s) | Notes |
| ------------- | ---------------------------- | ---------------- | ------------------------------------------------------ | -------------------------------------------------------- |
| Mozilla | Firefox | Gecko | <https://bugzilla.mozilla.org/enter_bug.cgi> | "Core" is normally the right product option to choose. |
| Apple | Safari | WebKit | <https://bugs.webkit.org/enter_bug.cgi?product=WebKit> | In Apple's bug reporter, choose "Safari" as the product. |
| Apple | Safari | WebKit | <https://bugs.webkit.org/enter_bug.cgi?product=WebKit> | In Apples bug reporter, choose "Safari" as the product. |
| Google, Opera | Chrome, Chromium, Opera v15+ | Blink | <https://bugs.chromium.org/p/chromium/issues/list> | Click the "New issue" button. |
| Microsoft | Edge | Blink | <https://developer.microsoft.com/en-us/microsoft-edge/> | Go to "Help > Send Feedback" from the browser |


## Feature requests

Feature requests are welcome. But take a moment to find out whether your idea
fits with the scope and aims of the project. It's up to _you_ to make a strong
case to convince the project's developers of the merits of this feature. Please
fits with the scope and aims of the project. Its up to _you_ to make a strong
case to convince the projects developers of the merits of this feature. Please
provide as much detail and context as possible.


Expand All @@ -131,8 +131,8 @@ commits.
**Please ask first** before embarking on any **significant** pull request (e.g.
implementing features, refactoring code, porting to a different language),
otherwise you risk spending a lot of time working on something that the
project's developers might not want to merge into the project. For trivial
things, or things that don't require a lot of your time, you can go ahead and
projects developers might not want to merge into the project. For trivial
things, or things that dont require a lot of your time, you can go ahead and
make a PR.

Please adhere to the [coding guidelines](#code-guidelines) used throughout the
Expand All @@ -144,7 +144,7 @@ any dist files (`dist/` or `js/dist`).** Those files are automatically generated
edit the source files in [`/bootstrap/scss/`](https://github.com/twbs/bootstrap/tree/main/scss)
and/or [`/bootstrap/js/src/`](https://github.com/twbs/bootstrap/tree/main/js/src) instead.

Similarly, when contributing to Bootstrap's documentation, you should edit the
Similarly, when contributing to Bootstraps documentation, you should edit the
documentation source files in
[the `/bootstrap/site/content/docs/` directory of the `main` branch](https://github.com/twbs/bootstrap/tree/main/site/content/docs).
**Do not edit the `gh-pages` branch.** That branch is generated from the
Expand Down Expand Up @@ -187,7 +187,7 @@ included in the project:

5. Commit your changes in logical chunks. Please adhere to these [git commit
message guidelines](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
or your code is unlikely be merged into the main project. Use Git's
or your code is unlikely be merged into the main project. Use Gits
[interactive rebase](https://help.github.com/articles/about-git-rebase/)
feature to tidy up your commits before making them public.

Expand Down Expand Up @@ -228,15 +228,15 @@ includes code changes) and under the terms of the
[Adhere to the Code Guide.](https://codeguide.co/#html)

- Use tags and elements appropriate for an HTML5 doctype (e.g., self-closing tags).
- Use CDNs and HTTPS for third-party JS when possible. We don't use protocol-relative URLs in this case because they break when viewing the page locally via `file://`.
- Use CDNs and HTTPS for third-party JS when possible. We dont use protocol-relative URLs in this case because they break when viewing the page locally via `file://`.
- Use [WAI-ARIA](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) attributes in documentation examples to promote accessibility.

### CSS

[Adhere to the Code Guide.](https://codeguide.co/#css)

- When feasible, default color palettes should comply with [WCAG color contrast guidelines](https://www.w3.org/TR/WCAG/#distinguishable).
- Except in rare cases, don't remove default `:focus` styles (via e.g. `outline: none;`) without providing alternative styles. See [this A11Y Project post](https://www.a11yproject.com/posts/2013-01-25-never-remove-css-outlines/) for more details.
- Except in rare cases, dont remove default `:focus` styles (via e.g. `outline: none;`) without providing alternative styles. See [this A11Y Project post](https://www.a11yproject.com/posts/2013-01-25-never-remove-css-outlines/) for more details.

### JS

Expand All @@ -255,4 +255,4 @@ Run `npm run test` before committing to ensure your changes follow our coding st
By contributing your code, you agree to license your contribution under the [MIT License](../LICENSE).
By contributing to the documentation, you agree to license your contribution under the [Creative Commons Attribution 3.0 Unported License](https://creativecommons.org/licenses/by/3.0/).

Prior to v3.1.0, Bootstrap's code was released under the Apache License v2.0.
Prior to v3.1.0, Bootstraps code was released under the Apache License v2.0.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
### Checklist

<!-- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
<!-- If youre unsure about any of these, dont hesitate to ask. Were here to help! -->

- [ ] I have read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/main/.github/CONTRIBUTING.md)
- [ ] My code follows the code style of the project _(using `npm run lint`)_
Expand Down
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Ignore docs files
/_site/
# Hugo files
/resources/
/.hugo_build.lock

# Numerous always-ignore extensions
*.diff
Expand Down Expand Up @@ -41,3 +38,9 @@ Thumbs.db
/dist-sass/
/js/coverage/
/node_modules/

# Site
/site/dist
/site/node_modules
/site/.astro
/site/public
12 changes: 12 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Prettier is only used for the website

site/.astro
site/dist
site/public
site/src/assets
site/src/scss
site/src/pages/**/*.md
site/src/pages/**/*.mdx
site/src/content/**/*.mdx
site/src/layouts/RedirectLayout.astro
site/static
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
**/dist/
**/vendor/
/_site/
/site/public/
/js/coverage/
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Examples of unacceptable behavior include:
any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address,
- Publishing others private information, such as a physical or email address,
without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Our default branch is for development of our Bootstrap 5 release. Head to the [`

- [Quick start](#quick-start)
- [Status](#status)
- [What's included](#whats-included)
- [Whats included](#whats-included)
- [Bugs and feature requests](#bugs-and-feature-requests)
- [Documentation](#documentation)
- [Contributing](#contributing)
Expand Down Expand Up @@ -74,9 +74,9 @@ Read the [Getting started page](https://getbootstrap.com/docs/5.3/getting-starte
[![Sponsors on Open Collective](https://img.shields.io/opencollective/sponsors/bootstrap?logo=opencollective&logoColor=fff)](#sponsors)


## What's included
## Whats included

Within the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations.
Within the download youll find the following directories and files, logically grouping common assets and providing both compiled and minified variations.

<details>
<summary>Download contents</summary>
Expand Down Expand Up @@ -132,7 +132,7 @@ Within the download you'll find the following directories and files, logically g
```
</details>

We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified CSS and JS (`bootstrap.min.*`). [Source maps](https://web.dev/articles/source-maps) (`bootstrap.*.map`) are available for use with certain browsers' developer tools. Bundled JS files (`bootstrap.bundle.js` and minified `bootstrap.bundle.min.js`) include [Popper](https://popper.js.org/docs/v2/).
We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified CSS and JS (`bootstrap.min.*`). [Source maps](https://web.dev/articles/source-maps) (`bootstrap.*.map`) are available for use with certain browsers developer tools. Bundled JS files (`bootstrap.bundle.js` and minified `bootstrap.bundle.min.js`) include [Popper](https://popper.js.org/docs/v2/).


## Bugs and feature requests
Expand All @@ -142,18 +142,18 @@ Have a bug or a feature request? Please first read the [issue guidelines](https:

## Documentation

Bootstrap's documentation, included in this repo in the root directory, is built with [Hugo](https://gohugo.io/) and publicly hosted on GitHub Pages at <https://getbootstrap.com/>. The docs may also be run locally.
Bootstraps documentation, included in this repo in the root directory, is built with [Astro](https://astro.build/) and publicly hosted on GitHub Pages at <https://getbootstrap.com/>. The docs may also be run locally.

Documentation search is powered by [Algolia's DocSearch](https://docsearch.algolia.com/).

### Running documentation locally

1. Run `npm install` to install the Node.js dependencies, including Hugo (the site builder).
1. Run `npm install` to install the Node.js dependencies, including Astro (the site builder).
2. Run `npm run test` (or a specific npm script) to rebuild distributed CSS and JavaScript files, as well as our docs assets.
3. From the root `/bootstrap` directory, run `npm run docs-serve` in the command line.
4. Open `http://localhost:9001/` in your browser, and voilà.

Learn more about using Hugo by reading its [documentation](https://gohugo.io/documentation/).
Learn more about using Astro by reading its [documentation](https://docs.astro.build/en/getting-started/).

### Documentation for previous releases

Expand All @@ -173,7 +173,7 @@ Editor preferences are available in the [editor config](https://github.com/twbs/

## Community

Get updates on Bootstrap's development and chat with the project maintainers and community members.
Get updates on Bootstraps development and chat with the project maintainers and community members.

- Follow [@getbootstrap on X](https://x.com/getbootstrap).
- Read and subscribe to [The Official Bootstrap Blog](https://blog.getbootstrap.com/).
Expand Down
2 changes: 1 addition & 1 deletion build/change-version.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const DRY_RUN = process.argv.includes('--dry') || process.argv.includes('--dry-r
// These are the files we only care about replacing the version
const FILES = [
'README.md',
'hugo.yml',
'config.yml',
'js/src/base-component.js',
'package.js',
'scss/mixins/_banner.scss',
Expand Down
4 changes: 2 additions & 2 deletions build/generate-sri.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url))

sh.config.fatal = true

const configFile = path.join(__dirname, '../hugo.yml')
const configFile = path.join(__dirname, '../config.yml')

// Array of objects which holds the files to generate SRI hashes for.
// `file` is the path from the root folder
// `configPropertyName` is the hugo.yml variable's name of the file
// `configPropertyName` is the config.yml variable's name of the file
const files = [
{
file: 'dist/css/bootstrap.min.css',
Expand Down
7 changes: 6 additions & 1 deletion build/vnu-jar.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ execFile('java', ['-version'], (error, stdout, stderr) => {
// Per https://www.w3.org/TR/html-aria/#docconformance having "aria-disabled" on a link is
// NOT RECOMMENDED, but it's still valid - we explain in the docs that it's not ideal,
// and offer more robust alternatives, but also need to show a less-than-ideal example
'An “aria-disabled” attribute whose value is “true” should not be specified on an “a” element that has an “href” attribute.'
'An “aria-disabled” attribute whose value is “true” should not be specified on an “a” element that has an “href” attribute.',
// A `code` element with the `is:raw` attribute coming from remark-prismjs (Astro upstream possible bug)
Copy link
Member Author

@julien-deramond julien-deramond Mar 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workaround for withastro/astro#13400

'Attribute “is:raw” is not serializable as XML 1.0.',
'Attribute “is:raw” not allowed on element “code” at this point.',
// Astro's expecting trailing slashes on HTML tags such as <br />
'Trailing slash on void elements has no effect and interacts badly with unquoted attribute values.'
].join('|')

const args = [
Expand Down
56 changes: 56 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
title: "Bootstrap"
baseURL: "https://getbootstrap.com"

docsDir: "site"

subtitle: "The most popular HTML, CSS, and JS library in the world."
description: "Powerful, extensible, and feature-packed frontend toolkit. Build and customize with Sass, utilize prebuilt grid system and components, and bring projects to life with powerful JavaScript plugins."
authors: "Mark Otto, Jacob Thornton, and Bootstrap contributors"

current_version: "5.3.5"
current_ruby_version: "5.3.5"
docs_version: "5.3"
rfs_version: "v10.0.0"
github_org: "https://github.com/twbs"
repo: "https://github.com/twbs/bootstrap"
x: "getbootstrap"
opencollective: "https://opencollective.com/bootstrap"
blog: "https://blog.getbootstrap.com/"
themes: "https://themes.getbootstrap.com/"
icons: "https://icons.getbootstrap.com/"
swag: "https://cottonbureau.com/people/bootstrap"

analytics:
fathom_site: "ITUSEYJG"

algolia:
app_id: "AK7KMZKZHQ"
api_key: "3151f502c7b9e9dafd5e6372b691a24e"
index_name: "bootstrap"

download:
source: "https://github.com/twbs/bootstrap/archive/v5.3.5.zip"
dist: "https://github.com/twbs/bootstrap/releases/download/v5.3.5/bootstrap-5.3.5-dist.zip"
dist_examples: "https://github.com/twbs/bootstrap/releases/download/v5.3.5/bootstrap-5.3.5-examples.zip"

cdn:
# See https://www.srihash.org for info on how to generate the hashes
css: "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
css_hash: "sha384-SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZApcHrRKUc4W0kG879m7"
css_rtl: "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.rtl.min.css"
css_rtl_hash: "sha384-q8+l9TmX3RaSz3HKGBmqP2u5MkgeN7HrfOJBLcTgZsQsbrx8WqqxdA5PuwUV9WIx"
js: "https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"
js_hash: "sha384-VQqxDN0EQCkWoxt/0vsQvZswzTHUVOImccYmSyhJTp7kGtPed0Qcx8rK9h9YEgx+"
js_bundle: "https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
js_bundle_hash: "sha384-k6d4wzSIapyDyv1kpU366/PK5hCdSbCRGRCMv+eplOQJWyd1fbcAu9OCUj5zNLiq"
popper: "https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"
popper_hash: "sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r"
popper_esm: "https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/esm/popper.min.js"

anchors:
min: 2
max: 5

toc:
min: 2
max: 6
Loading
Loading