Skip to content

mkind/blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This little framework is the base for my static blog.

The blogging script takes json entries and generates html blog entries as well as an rss xml.

USAGE

The directory structure is as following:

  • raw: json files
  • entries: generated blog entries
  • templates: contains html and rss template files
  • new.sh: generates a new raw json file, sets datetime and opens vim editor
  • bloggen.py takes raw json files and generates static html entries

Writing A Blog Entries

Blog entries are basically simple json files containing the following.

{
 "author": "mkind",
 "date": "2017-05-28 01:51:12",
 "title": "Hello!",
 "entry": "
Hello World.
"}

Each file is positioned in raw/YYYYmDD-HHMMSS.txt. Instead of manually creating those files, you can use the script new.sh. It creates the corresponding file and opens the vim editor.

Note that the title of blog entries is generated automatically by taking the first TITLE_LEN characters of the entry.

Generating HTML

The second step merges the templates given in templates/ and the raw json files in raw/ and builds html blog entries stores in entries/.

To do so, just execute bloggen.py. Every blog entry is positioned in a separate file in entries/YYYY/m/D/. There are also an overall html files like entries/0.html, entries/1.html, ... which implement pagination.

The html generation relies on the string replacement of python.

You might need to configure the script by setting variables.

LICENSE

GPLv3

About

personal blogging framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published