From 84594e7c3a07f7c5a6d2db0ff700047d1b266aef Mon Sep 17 00:00:00 2001 From: Noa Himesaka Date: Fri, 7 Nov 2025 18:20:29 +0900 Subject: [PATCH] Migrate to Zensical (#654) * feat: migrate to Zensical * feat: new gh build * fix: workflow permissions * feat: use our logo * fix: replace mkdocs in requirement.txt with Zensical * feat: use actual redirect * misc: replace logo with small one * Revert "misc: replace logo with small one" This reverts commit d38932865bb03d9204c7d4ef29ffef8ce0e3f6c7. * Remove unused filter --------- Co-authored-by: Aditya Garg --- .github/workflows/deploy.yml | 26 +- .gitignore | 3 +- mkdocs.yml | 24 +- redirs/dkms/index.html | 13 + redirs/wifi/index.html | 13 + requirements.txt | 4 +- theme/assets/images/t2linux-logo-large.svg | 352 +++++++++++++++++++++ theme/main.html | 9 +- 8 files changed, 426 insertions(+), 18 deletions(-) create mode 100644 redirs/dkms/index.html create mode 100644 redirs/wifi/index.html create mode 100644 theme/assets/images/t2linux-logo-large.svg diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a784fe6..c131801 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,6 +3,10 @@ on: push: branches: - master +permissions: + contents: read + pages: write + id-token: write jobs: lint: @@ -18,12 +22,16 @@ jobs: name: Deploy docs runs-on: ubuntu-latest steps: - - name: Checkout master - uses: actions/checkout@v5 - - - name: Deploy docs - uses: mhausenblas/mkdocs-deploy-gh-pages@1.26 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CUSTOM_DOMAIN: wiki.t2linux.org - EXTRA_PACKAGES: build-base + - uses: actions/configure-pages@v5 + - uses: actions/checkout@v5 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - run: pip install zensical + - run: zensical build --clean + - run: bash -c "echo 'wiki.t2linux.org' > build/CNAME" + - run: bash -c "cp -r redirs/* build/guides" + - uses: actions/upload-pages-artifact@v4 + with: + path: build + - uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index bbd21eb..1af54f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ # mkdocs -build/ \ No newline at end of file +build/ +.DS_Store \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 0c869b5..0e467a3 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,13 +1,30 @@ -# To build the documentation use `build.py` +# To build the documentation use Zensical site_name: t2linux wiki site_author: the t2linux.org contributors site_url: https://t2linux.org/ -copyright: "© 2021-2024 t2linux.org CC-BY-SA-4.0" +copyright: "© 2021-2025 t2linux.org CC-BY-SA-4.0" theme: palette: - scheme: slate + - media: "(prefers-color-scheme)" + toggle: + icon: material/brightness-auto + name: Switch to light mode + + # Palette toggle for light mode + - media: "(prefers-color-scheme: light)" + scheme: default + toggle: + icon: material/brightness-7 + name: Switch to dark mode + + # Palette toggle for dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + toggle: + icon: material/brightness-4 + name: Switch to system preference name: material custom_dir: theme font: false @@ -18,6 +35,7 @@ theme: - content.code.copy - navigation.top favicon: assets/images/icon.png + logo: assets/images/t2linux-logo-large.svg docs_dir: docs site_dir: build diff --git a/redirs/dkms/index.html b/redirs/dkms/index.html new file mode 100644 index 0000000..20d4322 --- /dev/null +++ b/redirs/dkms/index.html @@ -0,0 +1,13 @@ + + + + + Redirecting... + + + + + +You're being redirected to a new destination. + + diff --git a/redirs/wifi/index.html b/redirs/wifi/index.html new file mode 100644 index 0000000..bc21eb7 --- /dev/null +++ b/redirs/wifi/index.html @@ -0,0 +1,13 @@ + + + + + Redirecting... + + + + + +You're being redirected to a new destination. + + diff --git a/requirements.txt b/requirements.txt index 6a4dee2..33f30ff 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,4 @@ # This file contains the direct dependencies required for building the docs # To install them all run 'pip install -r requirements.txt' in the same directory -mkdocs == 1.6.1 -mkdocs-material == 9.6.23 -mkdocs-redirects == 1.2.2 +zensical == 0.0.4 diff --git a/theme/assets/images/t2linux-logo-large.svg b/theme/assets/images/t2linux-logo-large.svg new file mode 100644 index 0000000..1877b50 --- /dev/null +++ b/theme/assets/images/t2linux-logo-large.svg @@ -0,0 +1,352 @@ + + + + diff --git a/theme/main.html b/theme/main.html index 2964a4a..7261f5d 100644 --- a/theme/main.html +++ b/theme/main.html @@ -1,5 +1,10 @@ {% extends "base.html" %} {% block announce %} - Join our Discord Server -{% endblock %} \ No newline at end of file + + Join our Discord Server +{% endblock %}