Le dessous de mon blog avec le code permettant de le générer depuis des fichiers écrits en Markdown. L'architecture de ce code est inspirée d'un site de Lee Tusman. https://samoule.nohost.me/blog/
  • Shell 39.4%
  • HTML 29.5%
  • CSS 25.3%
  • JavaScript 5.8%
Find a file
samoule_android e58f6dc023 04-18-pasmarche
2026-04-22 16:46:50 +02:00
assets prettify: on ajoute des cartes 2026-04-06 23:52:32 +02:00
items@9455465101 04-18-pasmarche 2026-04-22 16:46:50 +02:00
templates 04-18-pasmarche 2026-04-22 16:46:50 +02:00
.gitignore bump items repo 2026-01-27 13:16:21 +01:00
.gitmodules test push 2026-02-06 12:50:16 +01:00
403.md test avec la config et le nouveau site 2026-04-05 13:05:31 +02:00
404.md test avec la config et le nouveau site 2026-04-05 13:05:31 +02:00
a-propos.md prettify: on ajoute des cartes 2026-04-06 23:03:13 +02:00
build.sh debug display image 2026-04-05 16:58:36 +02:00
config.yaml test avec la presence de plusieurs images dans le frontmatter 2026-04-05 16:10:35 +02:00
LICENSE.txt maj 403 et 404. changement de directory d export au profit de local_www 2026-01-23 15:07:15 +01:00
new-item.sh correction scipt de nouvel article 2026-04-07 00:43:37 +02:00
README.md liens absolus vers les feuilles de style + test opengraph 2026-02-06 16:52:33 +01:00
TODO.md test avec la config et le nouveau site 2026-04-05 13:05:31 +02:00

Static site generator for blogs based on bash scripts

A static site generator for a collection of publications.

This code allows to convert a set of files written in Markdown into a full set of files ready to be published as a website.

It uses only bash scripts with dependancies on yq and pandoc.

Requirements

  • pandoc (for page conversion from markdown content + html templates to html files)
sudo apt install pandoc

for Debian based systems, or see pandoc installation instructions otherwise.

  • yq (to extract and parse data from the markdown front matter of individual item pages)
sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_[YOUR PLATFORM] -O /usr/local/bin/yq && sudo chmod +x /usr/local/bin/yq

[YOUR PLATFORM] CAN BE linux_amd64, linux_arm64, etc (see yq installation instructions for details and other options).

Usage

New items get added to the items sub-directory.

From the root directory, run the build.sh script. You can make it executable chmod +x build.sh and run it ./build.sh after making changes to the site.

The site is built and placed in a directory, so that one could host the site on GitHub pages for example of via My Webapp on your YunoHost home server. The build script can be modified to add features or modify existing ones.

After running the build script, to view the site locally, go to the exported folder, run a local server (such as python's simple python3 -m http.server) and open the local adress and chosen port in your web browser.

Upload the contents of the exported directory to your web host.

Directory structure

.
├── build.sh
├── new-item.sh
├── items/
│   └── texts/
│       └── [your markdown files to be rendered]
│   └── medias/
│       └── [media files attached to texts]
├── templates/
│   ├── new-item.md
│   ├── item.html
│   ├── generic.html
│   ├── home_header.html
│   └── home_footer.html
├── local_www/
│   └── index.html
│   └── feed.xml
│   └── _publications_list
│   └── error/
│   │   └── 403.html
│   │   └── 404.html
│   └── assets/
│   │   └── [copie du contenu de ../assets/]
│   └── [item-1]/index.html
│   └── ...
│   └── [item-n]/index.html
│   └── [root-page-1]/index.html
│   └── ...
│   └── [root-page-m]/index.html
└── assets/
    ├───font/
    │   └── [any custom-font]
    ├───img/
    │   └── [some image files]
    ├───img_notes/
    │   └── [optional markdown descriptions of the images]
    ├───js/
    │   └── [your javascripts]
    └── css/
        └── main.css