🇫🇷 Version Francaise de cet article
Discovering MkDocs
I just discovered the MkDocs project. It allows you to transform Markdown files into static websites. You can also customize it with themes and plugins.
I wanted to create a POC (Proof of Concept) and eventually decided it was an opportunity to build a site to share my different procedures and my experiences with POCs that I do on a daily basis.
Here is my first article on how to create this site with MkDocs.
Installing MkDocs
I always recommend creating a Python venv.
This procedure was performed on a Linux OS (Pop!_OS 22.04).
Install the python mkdocs package
It seems that in our case, there is a PATH issue
[Optional] Debugging PATH Issue
This can be fixed by adding the following to the PATH:
Creating the blog project and starting it on localhost
Configure MkDocs and start a server that serves the site locally. This is convenient for testing as it updates automatically.
I place a Markdown file in the docs/ folder.
There you go, your Markdown file is rendered, but one step remains.
You can also create HTML files with this command :
Testing the HTML files opened directly in Firefox
Installing a template
I will install the "material" template with this command
I have tested other templates like Cinder Theme for MkDocs which are also very nice.
Activating the template
The site customization is done via the mkdocs.yml file, which we will edit:
I will rename the site, activate the template, and configure my menus with this code:
site_name: Be Cloud, code it !
theme:
name: material
logo: logo_b_cloud_code_it_transp.png
favicon: favicon.ico
nav:
- Accueil: index.md
- Articles: article/articles.md
- Procédure: procedure/procedure.md
- A Propos: a-propos.md
I also take the opportunity to add a logo and a favicon.
And the structure for the other pages of the site.
Adding comments
How to add Mastodon comments to MkDocs
Adding image zoom
Install this plugin
In the mkdocs.yml file, add
To Be continue
I rebuild and deliver this version of the site with this command
A quick FileZilla transfer and it's delivered.Comment
Commentez cet article de blog en utilisant un compte compatible Fediverse (Mastodon ou similaire).