| assets | ||
| items@e7dbd2e55a | ||
| templates | ||
| .gitignore | ||
| .gitmodules | ||
| 403.md | ||
| 404.md | ||
| a-propos.md | ||
| build.sh | ||
| LICENSE.txt | ||
| new-item.sh | ||
| README.md | ||
| TODO.md | ||
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