Templates - novoid/lazyblorg GitHub Wiki

Page Types > Templates

There must be exactly one heading which meets the criteria of a templates heading (see below). Within this heading, separate HTML blocks define the HTML snippets that are used by lazyblorg to generate the HTML pages. Please take a look at templates/blog-format.org to get an impression how this works.

You might want to start with my blog-format template and adapt it to your needs.

  • criteria
    1. status is DONE
    2. tag: blog
    3. tag: lb_templates
    4. :ID: property set
    5. :LOGBOOK: contains a state change time-stamp to DONE
    6. contains all necessary HTML blocks with pre-defined names

The CSS of the blog is maintained in =templates/public_voit.scss=. you will need a SCSS/SASS compiler to derive the actual CSS for your page. I am using scss-mode for it.

Template Placeholders

Within the templates defined in blog-format.org you can use many markers or placeholders that gets replaced during generating the HTML result.

Basically, the placeholders divide up themselves in general placeholders that are not specific to any page and page-specific placeholders.

General Placeholders

For a more detailed description of the configuration variables, please take a look at their description in config.py.

Placeholder Description Example
#COMMON-SIDEBAR# The common sidebar (too complex)
#TOP-TAG-LIST# The list of the top tags (too complex)
#DOMAIN# represents config.DOMAIN Karl-Voit.at
#BASE-URL# represents config.BASE_URL //Karl-Voit.at
#CSS-URL# represents config.CSS_URL //Karl-Voit.at/public_voit.css
#AUTHOR-NAME# represents config.AUTHOR_NAME Karl Voit
#BLOG-NAME# represents config.BLOG_NAME public voit
#BLOG-LOGO# represents config.BLOG_LOGO //Karl-Voit.at/images/public-voit_logo.svg
#DISQUS-NAME# represents config.DISQUS_NAME publicvoit
#ABOUT-PAGE-ID# represents config.ID_OF_ABOUT_PAGE 2014-03-09-about
#COMMENT-EMAIL-ADDRESS# represents config.COMMENT_EMAIL_ADDRESS [email protected]
#TWITTER-HANDLE# represents config.TWITTER_HANDLE n0v0id
#TWITTER-IMAGE# represents config.TWITTER_IMAGE http://Karl-Voit.at/images/public-voit_T_logo_200x200.png
#FEEDURL_LINKS# The URL for the XML feed: links only http://karl-voit.at/feeds/lazyblorg-all.atom_1.0.links-only.xml
#FEEDURL_TEASER# The URL for the XML feed: links and teaser http://karl-voit.at/feeds/lazyblorg-all.atom_1.0.links-and-teaser.xml
#FEEDURL_CONTENT# The URL for the XML feed: full content -http://karl-voit.at/feeds/lazyblorg-all.atom_1.0.links-and-content.xml=

Page-Specific Placeholders

Placeholder Description Example
#ARTICLE-TITLE# The title of the article with sanitized external links and HTML characters I Bought a New Bicycle
#ARTICLE-ID# The ID property of the article 2017-06-18-new-bicycle
#ARTICLE-URL# The URL of the article without protocol karl-voit.at/2017/06/18/new-bicycle
#ARTICLE-YEAR# year from first published time-stamp 2017
#ARTICLE-MONTH# month from first published time-stamp 06
#ARTICLE-DAY# day from first published time-stamp 18
#ARTICLE-PUBLISHED-HTML-DATETIME# ISO time-string of first published time-stamp with time-zone offset 2017-06-18T14:57+01:00
#ARTICLE-PUBLISHED-HUMAN-READABLE# ISO time-string of first published time-stamp 2017-06-18T14:57
#TAG-PAGE-LIST# see below

Example for #TAG-PAGE-LIST#:

\n<ul class=\'tag-pages-link-list\'>\n  <li> <span class=\'timestamp\'>2016-10-31T16:39</span> <a href="../../persistent-entry">A Wonderful Persistent Blog Entry</a></li>\n  <li> <span class=\'timestamp\'>2016-10-31T16:40</span> <a href="../../2016/10/31/my-temporal-article">A Temporal Article With Links</a></li>\n</ul>\n
Element Placeholder Description Example
Typically headers #TAGNAME# List of tags of articles ['language:english', 'lazyblorg']
Headings #SECTION-TITLE# title of the next heading/section My Conclusions
Headings #SECTION-LEVEL# relative level of the next heading/section 2
Content of a paragraph #PAR-CONTENT# A paragraph
Hyperlinks, list items,… #CONTENT#
Blocks #NAME# Org-mode name of a block

Elements and Placeholders

FIXXME: Following table might be outdated and has to be updated.

What template-name placeholder replacements
article article-header ARTICLE-TITLE, ABOUT-BLOG, BLOGNAME, ARTICLE-(ID,YEAR,MONTH,DAY,PUB*)
article-header-begin ARTICLE-TITLE, ABOUT-BLOG, BLOGNAME, ARTICLE-(ID,YEAR,MONTH,DAY,PUB*)
article-header-end ARTICLE-TITLE, ABOUT-BLOG, BLOGNAME, ARTICLE-(ID,YEAR,MONTH,DAY,PUB*)
article-tags-begin
article-usertag TAGNAME
article-autotag TAGNAME
article-tags-end ARTICLE-TITLE, ABOUT-BLOG, BLOGNAME, ARTICLE-(ID,YEAR,MONTH,DAY,PUB*)
article-footer ARTICLE-TITLE, ABOUT-BLOG, BLOGNAME, ARTICLE-(ID,YEAR,MONTH,DAY,PUB*)
article-end ARTICLE-TITLE, ABOUT-BLOG, BLOGNAME, ARTICLE-(ID,YEAR,MONTH,DAY,PUB*)
persistent-header ARTICLE-TITLE, ABOUT-BLOG, BLOGNAME, ARTICLE-(ID,YEAR,MONTH,DAY,PUB*)
persistent-header-begin ARTICLE-TITLE, ABOUT-BLOG, BLOGNAME, ARTICLE-(ID,YEAR,MONTH,DAY,PUB*)
persistent-header-end ARTICLE-TITLE, ABOUT-BLOG, BLOGNAME, ARTICLE-(ID,YEAR,MONTH,DAY,PUB*)
persistent-footer ARTICLE-TITLE, ABOUT-BLOG, BLOGNAME, ARTICLE-(ID,YEAR,MONTH,DAY,PUB*)
persistent-end ARTICLE-TITLE, ABOUT-BLOG, BLOGNAME, ARTICLE-(ID,YEAR,MONTH,DAY,PUB*)
headline section-begin SECTION-TITLE, SECTION-LEVEL
paragraph, plain-text paragraph PAR-CONTENT
URLs a-href CONTENT
plain-list ul-begin
ul-item
ul-end
pre-fromatted text pre-begin
pre-end
html-block html-begin NAME
html-end
src-block src-begin
src-end
named-src-begin
named-src-end
⚠️ **GitHub.com Fallback** ⚠️