spf13/hugo — pull request #586 by bjornerik (2014-10-27 21:21:42+00:00)
Title: Shortcode rewrite

This commit contains a restructuring and partial rewrite of the shortcode
handling.

Prior to this commit rendering of the page content was mingled with handling
of the shortcodes. This led to several oddities.

The new flow is:

1. Shortcodes are extracted from page and replaced with placeholders. 2.
Shortcodes are processed and rendered 3. Page is processed 4. The placeholders
are replaced with the rendered shortcodes

The handling of summaries is also made simpler by this.

This also introduces the distinction between shortcodes that need further
processing and those who do not:

* `{{< >}}`: Typically raw HTML. Will not be processed.
* `{{% %}}`: Will be processed by the page's markup engine (Markdown or
(infuture) Asciidoctor)

This syntax is under discussion and a subject for change.

The above also involves a new shortcode-parser, with lexical scanning inspired
by Rob Pike's talk called "Lexical Scanning in Go", which should be easier to
understand, give better error messages and perform better.

This fixes #565