Set up new website structure with MkDocs
MkDocs
- https://www.mkdocs.org/
- https://github.com/mkdocs/mkdocs
- https://github.com/mkdocs/catalog
- https://repology.org/badge/vertical-allrepos/python:mkdocs.svg
- https://repology.org/badge/vertical-allrepos/mkdocs.svg
- Used by substrate-interface, Textual, Pipx, and Ruff
- Allows to build markdown docs from the repository
- Very simple static framework website written in Python
Tasks
MkDocs initial set-up
-
Read the User Guide -
pyproject.toml: Introducemkdocsdependencies indocgroup -
Set-up initial project mkdocs.yml -
Move mdfiles to defaultdocsdirectory -
Set symlinks for changelog, contributing(, readme) -
Choose theme: material -
Set favicon -
Night/day switch
-
-
Set-up navigation with current content
Deployment
poetry install --only docs
poetry run mkdocs build -d public
-
Support website/documentation per releases and development one with Mike: - Drop-down support to switch between ie
v0.12andmain -
Mike git commits changes to pagesbranch. Add.gitlab-ci.ymlon this branch to publish the website and its’s multiple versions (no need schedule) -
On pagesbranch: basic.gitlab-ci.ymlto copy the content into apublicdirectory and publish to GitLab Pages via apagesjob - GitLab Pages implementation, will come later in the Community edition
- https://pypi.org/project/lightweight-versioned-gitlab-pages/
- https://stackoverflow.com/questions/55596789/deploying-gitlab-pages-for-different-branches/58915486#58915486
-
Version path /0.12issue with GitLab/Nginx deployment for hard-coded links- We should always use a relative link as stated in: GH issue, MkDocs doc
- not
[](/path.md)(absolute breaks version).[](path.md)if in the same directory otherwise[](./path.md)
- Drop-down support to switch between ie
- only on
mainbranch andtag? SetRELEASEvariable to0.12or to0.20-dev. - how to handle the coverage and website deployments?
mkdocs-coverage-
websitejobneeds:tests:3.12:covjob artifact - https://stackoverflow.com/a/64008569
- handle coverage display on
mainbranch, don’t displayCoveragetab when on release branch? Always display.
-
Protect pagesbranch -
Update coverage badge link to website coverage path -
Adapt GitLab Pages deployment: Ansible role, now from Silkaj repository - NixOS configuration works with three paths
clients/python/silkaj
- NixOS configuration works with three paths
Document contribution
-
How to install mkdocs, serve the docs, build locally - Link mkdocs, material, mike, coverage, gitlab … docs
Set up structure and use existing content
-
Fix mkdocs servewarnings-
Update links in release notes, contributing(, readme) -
README.mdCONTRIBUTING.md: update links to the URL of this website
-
-
Create index/main page inspired from Textual one -
Clean and proofread current documentation - move container usage (and poetry installation) to install section? Advanced installation, somehow contributing stuff. Nope?
-
enable syntax highlight, fix code block where we don’t want it -
enable code block copy where needed -
Id anchors in changelog -
Move CHANGELOG.mdtodocs/changelog.md, with the{ id=0.11.0 }it might get ugly looking at it on GitLab. Same forCONTRIBUTING.md, Drop them from GitLab "syntax", not sure for the logos -
create CHANGELOG.mdandCONTRIBUTING.mdreferring to those pages on the website
-
-
structure docsfolder:usage,contributing -
Introduce mdformat-mkdocsto format with four spaces bullet points -
Keep mikeprefix_pathtopublic, serving to http://localhost:8000/pages (needs doc precision) or selectversion.json,latest, and0.12items in the artifact -
Integrate generated coverage with mkdocs-coverage -
Changelog with mkdocs-gitlab-plugin: -
Blog tab containing releases notes: -
Move releases_notesdirectory indocs/blogdirectory -
Set up built-in mkdocs-materialblog (notmkdocs-blogging-plugin)- Yaml frontmatter kept:
mdformat-frontmatter
- Yaml frontmatter kept:
-
Add excerpts -
Add authors -
Local author profile picture not available from archive, category slug, set up url formats -
Issue to display local avatar: relative not working between mkdocs-materialandmike- Found a "dirty" hack which works with
mike, but not when serving withmkdocs, to be investigated further later
- Found a "dirty" hack which works with
-
-
Set up categories/tags for the releases and RC testing to separated them
-
-
Add badge to readme and GitLab repo badges -
disable fonts coming from Google gstatic -
Retrieve valuable content from current and Vue websites (no real value left: intro text maybe?) -
Activate search engine
Archive current websites
-
Archive two other websites repositories - https://git.duniter.org/websites/silkaj_website
- https://git.duniter.org/websites/doc_silkaj
Set them as archives. Visible in the archived tab. Redirect, saying that the website is now in Silkaj repository
Thank Manutopik for the Vue website solution which wasn’t retained. I prefer MkDocs: it’s written in Python, it’s simple, (no JS), I have full control over it
Finalization
-
Clean local history -
push changes -
protect pagesbranch -
Check the CI manages to publish on pagesbranch- a commit is added to
pagesbranch once a.pyordocs/**.mdfile changes. When there is no changes, the changelog has its date updated. - schedule pipeline won’t have the requirements to trigger
websitejob, since no.pynor.mdfile was changed. Let’s see how it goes. There is nowebsitejob, andpagesbranch does not get a new "empty" commit. Let’s not create lot’s of useless commits onpagesbranch.
- a commit is added to
-
Remove commented line in CI, so it only pushed from mainbranch -
Review changes -
Push clean pagesbranch -
Switch Infra config of https://silkaj.duniter.org to this website: admins/duniter-infra!101
Edited by Moul