Skip to content

Commit b61bbe7

Browse files
feat(docs): add prettier-plugin-bootstrap for automatic class sorting
Add prettier-plugin-bootstrap@^0.2.1 to automatically sort Bootstrap CSS classes following the framework's recommended order in site files. - Add plugin as dev dependency - Configure in site/.prettierrc.json (after prettier-plugin-astro) - Apply class sorting to 28 .astro site files (no functional changes) Signed-off-by: Pierluigi Lenoci <pierluigilenoci@gmail.com>
1 parent 5eeea39 commit b61bbe7

31 files changed

Lines changed: 119 additions & 97 deletions

package-lock.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@
167167
"postcss-cli": "^11.0.1",
168168
"prettier": "^3.8.3",
169169
"prettier-plugin-astro": "^0.14.1",
170+
"prettier-plugin-bootstrap": "^0.2.1",
170171
"rehype-autolink-headings": "^7.1.0",
171172
"remark": "^15.0.1",
172173
"remark-html": "^16.0.1",

site/.prettierrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"printWidth": 120,
55
"semi": false,
66
"singleQuote": true,
7-
"trailingComma": "none"
7+
"trailingComma": "none",
8+
"plugins": ["prettier-plugin-astro", "prettier-plugin-bootstrap"]
89
}

site/src/components/Ads.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2+
23
---
34

45
<script
56
is:inline
67
async
78
src="https://cdn.carbonads.com/carbon.js?serve=CKYIKKJL&placement=getbootstrapcom"
8-
id="_carbonads_js"
9-
></script>
9+
id="_carbonads_js"></script>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
23
---
34

45
<script src="../assets/stackblitz.js"></script>

site/src/components/DocsSidebar.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import { getSlug } from '@libs/utils'
77
const sidebar = getData('sidebar')
88
---
99

10-
<nav class="bd-links w-100" id="bd-docs-nav" aria-label="Docs navigation">
11-
<ul class="bd-links-nav list-unstyled mb-0 pb-3 pb-md-2 pe-lg-2">
10+
<nav class="w-100 bd-links" id="bd-docs-nav" aria-label="Docs navigation">
11+
<ul class="list-unstyled mb-0 pe-lg-2 pb-3 pb-md-2 bd-links-nav">
1212
{
1313
sidebar.map((group) => {
1414
const groupSlug = getSlug(group.title)

site/src/components/footer/Footer.astro

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import { getConfig } from '@libs/config'
44
import { getVersionedDocsPath } from '@libs/path'
55
---
66

7-
<footer class="bd-footer py-4 py-md-5 mt-5 bg-body-tertiary">
8-
<div class="container py-4 py-md-5 px-4 px-md-3 text-body-secondary">
7+
<footer class="mt-5 py-4 py-md-5 bg-body-tertiary bd-footer">
8+
<div class="container px-4 px-md-3 py-4 py-md-5 text-body-secondary">
99
<div class="row">
1010
<div class="col-lg-3 mb-3">
1111
<a
12-
class="d-inline-flex align-items-center mb-2 text-body-emphasis text-decoration-none"
12+
class="d-inline-flex align-items-center mb-2 text-decoration-none text-body-emphasis"
1313
href="/"
1414
aria-label="Bootstrap"
1515
>
@@ -32,7 +32,7 @@ import { getVersionedDocsPath } from '@libs/path'
3232
<li class="mb-2">Currently v{getConfig().current_version}.</li>
3333
</ul>
3434
</div>
35-
<div class="col-6 col-lg-2 offset-lg-1 mb-3">
35+
<div class="col-lg-2 col-6 offset-lg-1 mb-3">
3636
<h5>Links</h5>
3737
<ul class="list-unstyled">
3838
<li class="mb-2"><a href="/">Home</a></li>
@@ -43,7 +43,7 @@ import { getVersionedDocsPath } from '@libs/path'
4343
<li class="mb-2"><a href={getConfig().swag} target="_blank" rel="noopener">Swag Store</a></li>
4444
</ul>
4545
</div>
46-
<div class="col-6 col-lg-2 mb-3">
46+
<div class="col-lg-2 col-6 mb-3">
4747
<h5>Guides</h5>
4848
<ul class="list-unstyled">
4949
<li class="mb-2"><a href={getVersionedDocsPath('getting-started')}>Getting started</a></li>
@@ -53,7 +53,7 @@ import { getVersionedDocsPath } from '@libs/path'
5353
<li class="mb-2"><a href={getVersionedDocsPath('getting-started/vite')}>Vite</a></li>
5454
</ul>
5555
</div>
56-
<div class="col-6 col-lg-2 mb-3">
56+
<div class="col-lg-2 col-6 mb-3">
5757
<h5>Projects</h5>
5858
<ul class="list-unstyled">
5959
<li class="mb-2">
@@ -69,7 +69,7 @@ import { getVersionedDocsPath } from '@libs/path'
6969
</li>
7070
</ul>
7171
</div>
72-
<div class="col-6 col-lg-2 mb-3">
72+
<div class="col-lg-2 col-6 mb-3">
7373
<h5>Community</h5>
7474
<ul class="list-unstyled">
7575
<li class="mb-2">

site/src/components/head/Scss.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
23
---
34

45
<style is:global lang="scss">

site/src/components/head/ScssProd.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
23
---
34

45
<style is:global lang="scss">

site/src/components/header/LinkItem.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const { active, class: className, track, ...props } = Astro.props
1313
const content = await Astro.slots.render('default')
1414
---
1515

16-
<li class="nav-item col-6 col-lg-auto">
16+
<li class="col-lg-auto col-6 nav-item">
1717
<a
1818
aria-current={active ? true : undefined}
1919
class:list={['nav-link py-2 px-0 px-lg-2', className, { active }]}

0 commit comments

Comments
 (0)