Skip to content

Commit 95f0e4e

Browse files
committed
docs: adopted shadcn theme, added pages CI/CD, and tighten docs layout
1 parent f009749 commit 95f0e4e

6 files changed

Lines changed: 102 additions & 5 deletions

File tree

.github/workflows/docs.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Docs CI/CD
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: github-pages
19+
cancel-in-progress: true
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Python
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: "3.12"
32+
33+
- name: Configure Pages
34+
id: pages
35+
uses: actions/configure-pages@v5
36+
37+
- name: Install docs dependencies
38+
run: |
39+
python -m pip install --upgrade pip
40+
pip install -r requirements-docs.txt
41+
42+
- name: Build docs (strict)
43+
env:
44+
SITE_URL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/
45+
run: mkdocs build --strict
46+
47+
- name: Upload Pages artifact
48+
uses: actions/upload-pages-artifact@v3
49+
with:
50+
path: site
51+
52+
deploy:
53+
if: github.event_name != 'pull_request'
54+
needs: build
55+
runs-on: ubuntu-latest
56+
environment:
57+
name: github-pages
58+
url: ${{ steps.deployment.outputs.page_url }}
59+
steps:
60+
- name: Deploy to GitHub Pages
61+
id: deployment
62+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
site/
22
.DS_Store
33
__pycache__/
4+
.venv/

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ Every production script must include:
5151
Local docs workflow:
5252

5353
```bash
54-
python3 -m pip install mkdocs mkdocs-material
54+
python3 -m venv .venv
55+
source .venv/bin/activate
56+
python3 -m pip install --upgrade pip
57+
python3 -m pip install -r requirements-docs.txt
5558
mkdocs serve
5659
mkdocs build --strict
5760
```

docs/stylesheets/extra.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* Reduce excessive vertical spacing in article content. */
2+
article .typography h2 {
3+
margin-top: 1.5rem;
4+
margin-bottom: 0.5rem;
5+
}
6+
7+
article .typography h3 {
8+
margin-top: 1.1rem;
9+
margin-bottom: 0.4rem;
10+
}
11+
12+
article .typography p,
13+
article .typography ul,
14+
article .typography ol,
15+
article .typography pre,
16+
article .typography table,
17+
article .typography blockquote {
18+
margin-top: 0.6rem;
19+
}
20+
21+
article .typography li + li {
22+
margin-top: 0.2rem;
23+
}

mkdocs.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
site_name: DevOps Scripts Library
22
site_description: Industry-grade automation scripts for cloud, platform, CI/CD, databases, security, and SRE.
3-
site_url: https://github.com/rudraditya21/devops.scripts
3+
site_url: !ENV [SITE_URL, "http://127.0.0.1:8000/"]
4+
repo_url: https://github.com/rudraditya21/devops.scripts
45
repo_name: devops.scripts
56
docs_dir: docs
67
site_dir: site
78
strict: true
89

910
theme:
10-
name: mkdocs
11-
language: en
11+
name: shadcn
12+
show_title: true
13+
show_stargazers: true
14+
pygments_style: github-dark
1215

1316
plugins:
1417
- search
1518

19+
extra_css:
20+
- stylesheets/extra.css
21+
1622
markdown_extensions:
1723
- admonition
1824
- attr_list
@@ -21,7 +27,7 @@ markdown_extensions:
2127
- md_in_html
2228
- tables
2329
- toc:
24-
permalink: true
30+
permalink: false
2531

2632
nav:
2733
- Home: index.md

requirements-docs.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
mkdocs>=1.6,<2.0
2+
mkdocs-shadcn>=0.9,<1.0

0 commit comments

Comments
 (0)