Skip to content

Commit

Permalink
docs: build multi-version documentation (#327)
Browse files Browse the repository at this point in the history
* Build multi-version docs with 'mike'

Signed-off-by: Dmytro Bondar <[email protected]>

* Revert remote_branch option

---------

Signed-off-by: Dmytro Bondar <[email protected]>
  • Loading branch information
Dmytro Bondar authored Dec 3, 2024
1 parent afcba8d commit ba9b6c3
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 21 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
name: github-pages
on:
push:
branches:
- master
branches: [master]
tags: ["v*"]

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: actions/cache@v4
with:
key: ${{ github.ref }}
path: .cache
- run: pip install mkdocs-material
- run: pip install pillow cairosvg
- run: mkdocs gh-deploy --force

- name: Install dependencies
run: pip install mike mkdocs-material[imaging] mkdocs-minify-plugin

- name: Publish documentation
run: mike deploy --push --update-aliases ${{ github.ref_name }} latest
env:
GIT_COMMITTER_NAME: "github-actions[bot]"
GIT_COMMITTER_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
4 changes: 2 additions & 2 deletions docs/theme-overrides/layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ <h1>A beautiful and simple UI to manage your WireGuard peers and interfaces</h1>
<div class="md-container">
<div class="tx-hero__image">
<img
src="{{config.site_url}}assets/images/screenshot.png"
src="{{config.site_url}}/assets/images/screenshot.png"
alt=""
draggable="false"
>
Expand Down Expand Up @@ -356,7 +356,7 @@ <h3>More information about WireGuard</h3>
<div class="second-column">
<div class="image-wrapper">
<img
src="{{config.site_url}}assets/images/wg-tool.png"
src="{{config.site_url}}/assets/images/wg-tool.png"
alt=""
draggable="false"
>
Expand Down
25 changes: 15 additions & 10 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# build with MkDocs 1.5.3, mkdocs-material-9.4.7

---
site_name: WireGuard Portal
site_description: 'Manage WireGuard Peers and Interface using a beautiful and simple web UI.'
site_url: https://wgportal.org
repo_name: 'h44z/wg-portal'
repo_url: 'https://github.com/h44z/wg-portal'
copyright: 'Copyright &copy; 2023-2024 WireGuard Portal Project'
site_description: Manage WireGuard Peers and Interface using a beautiful and simple web UI.
site_url: https://wgportal.org/
repo_name: h44z/wg-portal
repo_url: https://github.com/h44z/wg-portal
copyright: Copyright &copy; 2023-2024 WireGuard Portal Project

extra_css:
- stylesheets/extra.css

theme:
name: material
custom_dir: docs/theme-overrides
Expand All @@ -18,15 +19,19 @@ theme:
favicon: assets/images/favicon-large.png
language: en
features:
- tabs
- instant
- navigation.instant
- navigation.tabs

plugins:
- search
#- social # disable until https://github.com/squidfunk/mkdocs-material/issues/6983 is resolved
- social
- minify:
minify_html: true

extra:
version:
provider: mike
default: latest
social:
- icon: fontawesome/brands/github-alt
link: https://github.com/h44z/wg-portal
Expand Down

0 comments on commit ba9b6c3

Please sign in to comment.