Skip to content

Commit aadb8ba

Browse files
authored
Merge pull request #507 from Hacking-the-Cloud/nick.frichette/migrate-mkdocs-material
[codex] migrate MkDocs Material build
2 parents e565a0b + a139138 commit aadb8ba

5 files changed

Lines changed: 12 additions & 18 deletions

File tree

.github/workflows/build_v2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/setup-python@v5
1313
with:
1414
python-version: 3.x
15-
- run: pip install mkdocs-material
15+
- run: pip install "mkdocs-material>=9.7.0"
1616
- run: pip install mkdocs-minify-plugin
1717
- run: pip install mkdocs-awesome-pages-plugin
1818
- run: pip install mkdocs-redirects

.github/workflows/deploy_v2.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
if: github.event.repository.fork == false
1111
env:
12-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
12+
GH_TOKEN: ${{ github.token }}
1313
steps:
1414
- uses: actions/checkout@v4
1515
with:
@@ -25,13 +25,12 @@ jobs:
2525
mkdocs-material-
2626
- run: sudo apt-get update
2727
- run: sudo apt-get install -y libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev
28-
- run: pip install pillow cairosvg
28+
- run: pip install "mkdocs-material[imaging]>=9.7.0"
2929
- run: pip install mkdocs-minify-plugin
3030
- run: pip install mkdocs-awesome-pages-plugin
3131
- run: pip install mkdocs-redirects
3232
- run: pip install mkdocs-git-revision-date-localized-plugin
3333
- run: pip install mkdocs-git-committers-plugin-2
3434
- run: pip install mkdocs-rss-plugin
3535
- run: pip install --use-pep517 mkdocs-glightbox
36-
- run: pip install git+https://${{ secrets.GH_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git
37-
- run: mkdocs gh-deploy --force --config-file mkdocs.insiders.yml
36+
- run: mkdocs gh-deploy --force --config-file mkdocs.deploy.yml

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ __NOTE__: You do not have to run the Docker container to contribute. You can mak
3232

3333
## Using Cards
3434

35-
If you'd like to use a card, for [example](https://hackingthe.cloud/aws/post_exploitation/create_a_console_session_from_iam_credentials/) `Technique seen in the wild`, `Tools mentioned in this article`, etc, __please be aware that you would need a subscription for [Material for MKDocs](https://squidfunk.github.io/mkdocs-material/reference/grids/#using-card-grids) for the cards to be properly displayed on your local machine__. Simply copy and paste the template from the options below and it will be properly rendered on the site (we have a subscription to Material for MKDocs).
35+
If you'd like to use a card, for [example](https://hackingthe.cloud/aws/post_exploitation/create_a_console_session_from_iam_credentials/) `Technique seen in the wild`, `Tools mentioned in this article`, etc, copy and paste the template from the options below. Cards are supported by the public Material for MkDocs package used by the site.
3636

3737
### Card Templates
3838

dev.Dockerfile

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,25 @@
1-
# This Dockerfile is intended for local testing and requires a subscription to
2-
# Material for MkDocs to work. If you'd like to contribute to Hacking the Cloud
3-
# and need to setup a local env, you can use the normal "Dockerfile" in this repo.
4-
# Thank you!
1+
# This Dockerfile matches the deploy workflow, including social cards and
2+
# deploy-only MkDocs plugins.
53
FROM ubuntu
64

7-
ARG GH_TOKEN
8-
95
WORKDIR /docs
106

117
RUN apt update -y
128
RUN apt install -y libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev python3-pip python3 git
139
RUN pip install tzdata
14-
RUN pip install pillow cairosvg
10+
RUN pip install "mkdocs-material[imaging]>=9.7.0"
1511
RUN pip install mkdocs-minify-plugin
1612
RUN pip install mkdocs-awesome-pages-plugin
1713
RUN pip install mkdocs-redirects
1814
RUN pip install mkdocs-git-revision-date-localized-plugin
1915
RUN pip install mkdocs-git-committers-plugin-2
2016
RUN pip install mkdocs-rss-plugin
2117
RUN pip install --use-pep517 mkdocs-glightbox
22-
RUN pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
2318

2419
RUN git config --global --add safe.directory /docs &&\
2520
git config --global --add safe.directory /site
2621

2722
EXPOSE 8000
2823

2924
ENTRYPOINT ["mkdocs"]
30-
CMD ["serve", "--dev-addr=0.0.0.0:8000"]
25+
CMD ["serve", "--dev-addr=0.0.0.0:8000"]
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
INHERIT: mkdocs.yml
22
plugins:
3-
- social: # Added to .insiders.yml
4-
cards_layout_dir: layouts
5-
cards_layout: custom
3+
- social:
4+
cards_layout_dir: layouts
5+
cards_layout: custom
66
- search
77
- rss: # non-standard
88
length: 200

0 commit comments

Comments
 (0)