Commit graph

24 commits

Author SHA1 Message Date
bep
ab5862cd00 Allow the same shortcode to be used with or without inline content
Fixes #934
2015-03-02 21:49:33 +01:00
Joseph Kaptur
462e666f45 Update docs so that figure includes the class parameter. 2015-02-14 18:35:00 -05:00
Anthony Fok
ba44e860a3 [Docs] Copyediting
* Add meta author, description and generator tags
 * Add Hugo version beside the logo and in the footer
 * Suggest the user to run `go get -u -v` to update dependencies
 * Requires Go 1.3+ rather than Go 1.1+
 * Improve rendering/formatting in some places
 * Add trailing slash to URLs where appropriate
 * GitHub redirects all http requests to https, update accordingly
2015-01-28 18:02:40 -07:00
bep
a6d22bcf7d Add documentation for pagination
See #750
2015-01-26 14:56:26 +01:00
Austin Ziegler
fd33e5d202 Documentation for ref and relref.
- Rejigged the weight of the extras/ content for the new crossreferences
  page.
- Used the new {{</*…*/>}} format for documenting highlighting and to
  prevent a warning about the missing `fig` shortcode.
2014-12-18 22:18:37 -05:00
bep
728d0fa32c Update shortcode doc for 0.13-DEV
Update of the doc to reflect the shortcode  implemention in HEAD.
2014-11-18 12:26:33 -05:00
ls6
bcaf33418f Update shortcodes.md
A typo resulting in a broken link.
2014-11-18 10:15:05 -05:00
bep
55fcd2f30f Shortcode rewrite, take 2
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 commit also introduces some other chenges:

1. 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)

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.

2. If you want to exclude a shortcode from being processed (for documentation etc.), the inner part of the shorcode must be commented out, i.e. `{{%/* movie 47238zzb */%}}`. See the updated shortcode section in the documentation for further examples.

The new parser supports nested shortcodes. This isn't new, but has two related design choices worth mentioning:

* The shortcodes will be rendered individually, so If both `{{< >}}` and `{{% %}}` are used in the nested hierarchy, one will be passed through the page's markdown processor, the other not.
* To avoid potential costly overhead of always looking far ahead for a possible closing tag, this implementation looks at the template itself, and is branded as a container with inner content if it contains a reference to `.Inner`

Fixes #565
Fixes #480
Fixes #461

And probably some others.
2014-11-17 18:32:06 -05:00
Justin Calleja
11ddc308e3 Fix for issue 583 2014-11-01 23:10:52 -04:00
Anthony Fok
ca7007bf26 Minor proofreading corrections to Hugo docs
- Add backticks and commas where necessary
- Remove some trailing whitespace
- Add front matter example in TOML
- Fix typo in one of the tags in Showcase
- Add 多说 (Duoshuo) as an alternative to Disqus
- Use internal links (i.e. without gohugo.io) where possible
- Use a colon to set off an example
- Change "it's" to "its" where appropriate
- Use typographical (i.e. curly) apostrophe on the front page
  where appropriate
- Capitalize "Github" as "GitHub"
2014-10-15 12:18:20 -04:00
Jorin Vogel
eeaf343a14 Mention .Params and .Page variables in shortcode docs. Also highlight variables. 2014-10-02 13:53:36 -04:00
Jakub Turski
7de320920c Shortcodes are content files specific.
This fixes spf13/hugo#440.
2014-08-28 12:59:52 -04:00
Nate Finch
1778f28c87 remove extraneous "Because" 2014-08-06 05:39:58 -04:00
spf13
05875153bc Converting front matter to YAML 2014-05-29 18:45:22 -04:00
spf13
a87f171bd4 Updating / Rewriting / Adding all of the documentation in preparation for the next release 2014-05-27 18:32:57 -04:00
spf13
b520f8852d Switching docs highlighting to highlight.js .. Docs build super fast again! 2014-05-15 09:58:55 -04:00
spf13
11fe227b9e Implementing new menu system in the docs site 2014-04-23 03:00:11 -04:00
spf13
64572d2d60 Shortcode cleanup. Added a ton of tests. Much more flexible with input. Doesn't crash with bad input. Fixed #193
Also added the .Get function to short codes and documentation for that function.
2014-02-25 23:57:31 -05:00
spf13
bf6407759b Minor Docs Tweaks 2014-02-18 18:35:03 -05:00
spf13
2ff108fcb7 Add highlighting of code in documentation and clean up a bunch of the docs. 2014-01-10 21:29:58 -05:00
spf13
f09505a657 Adding example short codes to the documentation 2013-12-10 22:34:13 -05:00
spf13
90355eec79 Big visual overhaul of the docs. Docs now using indexes for all menu generation. 2013-10-26 02:18:14 -04:00
Kyle Mahan
aa9b9d596e minor documentation cleanup.
- changed it's -> its where appropriate.
- added post/ parent directory above happy/ to the organization examples

Signed-off-by: Noah Campbell <noahcampbell@gmail.com>
2013-09-29 19:50:25 -07:00
spf13
8c0ab4def1 Complete overhaul of the docs 2013-08-17 21:54:39 -04:00
Renamed from docs/content/doc/shortcodes.md (Browse further)