3 blogit \- a small static blog generator
7 .RB [ init | build | deploy | clean ]
11 is a small static blog generator, using a markdown-like syntax and git capabilities.
12 For example, first posted and last edited dates are extracted from git history.
15 Run "blogit init" and follow the interactive configuration.
16 This will create the basic structure and initialize a git repository.
19 Articles are created in the
21 directory, using a markdown-like syntax (see
23 HTML templates (configurable chunks of HTML code that will be used for static page generation) are stored in the
25 directory, and can be edited (see
27 Additional data can be stored in the
29 directory and will be copied at the root of the website.
32 The articles, templates and data can be created and edited offline.
33 To create a local version of the blog, run "blogit build".
34 It will be available in the
36 directory, and the main page is index.html.
37 Note that only articles known to git will be created (this is to prevent unfinished articles to be published).
38 When its ready for publication, commit the changes to the git repository, and build the blog using "blogit build".
39 Then run "blogit deploy" to publish the site with
41 to the remote configured at the beginning.
44 The first line of the article text file is its title.
45 The next line can be blank, and will be skipped if that case.
46 Then the remaining of the file is in a markdown format, with the following formatting options:
49 Sections and subsections are defined by lines starting with one or several
51 each indicating a new section level.
54 Paragraphs are started with a blank line.
57 Chunks enclosed in stars
59 are formatted in bold.
60 Chunks enclosed with two stars
62 are formatted in bold.
65 Images are inserted using the following syntax: "![alternate text](url)".
68 Links are inserted using the following syntax: "[link text](url)".
71 Lines starting with a semi-colon are comments and are ignored.
72 It can be used to store metadata.
73 In particular, comments beginning with "tags:" indicate tags and are available in the templates in the TAGS variable.
76 Code blocks start and end with ``` (this marker must be on its own line).
77 The content is not formatted, and will appear as writter in the source file.
81 Each item starts with "- ".
85 Each item starts with "1. ", "2. " and so on.
86 The numbers are not checked, so any number can actually be used.
89 Templates are small HTML code chunks that are used to build the blog pages.
90 Any variable reference
92 is replaced with the corresponding environment variable value.
95 The index page is built using the following templates:
101 - tag_list_header.html;
103 - tag_entry.html, for each tag;
105 - tag_separator.html, between each tag;
107 - tag_list_footer.html;
109 - article_list_header.html;
111 - article_entry.html, for each article entry;
113 - article_separator.html, between each article;
115 - article_list_footer.html;
121 The TITLE variable will contain "index".
122 In tag_entry, the following additional variables are available:
124 - URL, containing the (relative) URL of the tag index page;
126 - NAME, the tag name.
128 In article_entry, the following additional variables are available:
130 - URL, containing the (relative) URL of the article;
132 - DATE, the first publication date;
134 - TITLE, the title of the article.
137 Article pages are built from the following templates:
143 - (then the article file is formatted and inserted)
149 At all stages, the following variables are defined:
151 - TITLE, the title of the article;
153 - DATE_POSTED, the first publication date;
155 - DATE_EDITED, the last edit (commit) date;
157 - TAGS, the tags parsed from "tags:" comments.