Skip to content

zhimingwang-org/archive

source
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

Feburary 01, 2017: This blog has been archived. Visit my home page at zhimingwang.org.

Build Status

This blog can be built with the pyblog script. The pyblog script currently provides the following actions:

  • new_post (aliases: n, new);
  • touch (aliases: t, tou);
  • generate (aliases: g, gen);
  • regenerate (aliases: r, regen);
  • preview (aliases: p, pre).
  • deploy (aliases: d, dep);
  • gen_deploy (aliases: gd, gendep);
  • edit (aliases: e, ed).

Run pyblog --help for more information, and pyblog <action> --help for what the action does and how to perform the action.

Note that pyblog is incompatible with Python 2.x, and in fact only tested on Python 3.4+.

The theme of this blog is largely based on that of mort.ninja by Mort Yao. See this post for more details.

Self-hosted Google Web Fonts are downloaded from google-webfonts-helper, courtesy of Mario Ranftl.

Markdown features of pyblog

pyblog uses Pandoc for Markdown processing. The HTML template is located at source/template.html.

Beyond Pandoc's standard Markdown to HTML conversion, pyblog postprocesses Pandoc-generated HTML to add a few Markdown extensions and blogging-friendly HTML transforms.

Markdown extensions

Image size

Allows specifying image size in a Markdown image construct ![](). The syntax is:

![|width(xheight)?| alt](src)

where width and height are positive integers (xheight is optional), and alt is the regular alt string (either plain or with some Markdown formatting). The alt string, as usual, is optional.

Examples:

![|1920x1080| Hello, world!](http://example.com/hello.png)
![|1920| *Hey!*](http://example.com/hey.png)
![|1280x800|](http://example.com/noalt.png)

See process_image_sizes in pyblog.

Other HTML transforms

img tags are automatically converted to clickable links to their originals (with target="_blank" so the original is opened in a new tab).

See link_img_tags in pyblog.

Pandoc Markdown has footnote support, but unfortunately doesn't support backlinks. This transform inserts a backlink to the end of each footnote so that readers won't get lost after finish reading a footnote.