This POSIX compliable shell script has been written by Roman Zolotarev. The documentation for this project can be found here
In order to have a look at my personal customizations and usage, please head over to this post on my blogsite, which has been built with this script.
PATH="$HOME/bin:$PATH"
mkdir src dst
echo '# Hello, World!' > src/index.md
echo '<html><title></title>' > src/_header.html
bin/ssg5 src dst 'Test' 'http://www'
firefox dst/index.html
-
Generate a homepage with post list sorted according to date defined in the metadata of the md files
-
Paginate the post list with specified number of posts per page
-
Generate a post archive sorted by date
-
Use pandoc for generating the html files
To use my customized script, you can set it up as follows:
-
Clone the repository and put the executable in the /usr/bin directory
git clone https://github.com/fmash16/ssg5 sudoo cp ssg5/ssg5 /usr/bin
Create a source directory for storing your website source and a destination directory to put the produced static site in
mkdir -p blogsite/src mkdir -p blogsite/dst
-
A sample
_header.html
and a_footer.html
has been provided, copy them over to yoursrc
directory.cp ssg5/_header.html blogsite/src/ cp ssg5/_footer.html blogsite/src/
-
Put your css in a file named
style.css
in the css folder inside thesrc
directory.cp -rv ssg5/css blogsite/src/
-
You can store your posts anywhere inside the src directory as you like. To keep things organized, you can create a posts directory inside the src dir.
mkdir blogsite/src/posts/
Then you can store your posts written in markdown inside the posts directory.
Important For the index post list to work, you must include the following metadata at the beginning of each post
--- title: Your post title description: Some description date: YYYY-MM-DD format is a must tags: keywords for your post image: image attached to post ---
Among these,
title
anddate
must be given, rest can be ignored if you want. if title and date are not give, a proper homepage with post list would not be generated. -
You can put information about yourself in the
about.md
file in your src directory. -
For storing your static content like images, videos or other files, put them inside a folder named
img
inside the src directory.mkdir blogsite/src/img
-
Put your favicon in a file named
favicon.png
in the src directory.
- Pandoc
- Vim
To build the site, run
cd blogsite
ssg5 src dst "Your blog name here" "Your website address here"
Now, your site is built in the dst directory.
You can serve it using a webserver of your choice(like apache).