Commit graph

250 commits

Author SHA1 Message Date
Austin Dizzy 6511e2c48f Removed extra .Site.LastChange listing 2015-08-07 23:13:18 -06:00
Anthony Fok 5505ac0d72 doc: Strip trailing whitespace; other revisions
Make some random and non-comprehensive changes to the
template functions documentation to make them more
consistent.
2015-08-04 12:00:08 -06:00
Scott C Wilson cdefb5a027 Fix links to Ace and Amber pages 2015-07-24 11:22:05 +02:00
Scott C Wilson dec9749bbc Document Amber templates
Fixes #1064
2015-07-20 15:28:20 +02:00
Clam- 85f4935dec Fix unclear RSS template docs
The documentation for the RSS templating is a little unclear.
http://gohugo.io/templates/rss/

Some users may attempt to look for a ```__internal``` directory rather than assume that's the aforementioned "Hugo own template."

Here's my suggestion.
2015-07-19 19:40:34 +02:00
Bjørn Erik Pedersen 77c60a3440 Add RuneCount to Page
Fixes #1266
2015-07-12 11:05:37 +02:00
Marc-Antoine Ruel 24c8226cbf Document Page.RawContent in templates/variables/ 2015-07-02 19:24:30 +02:00
Jonathan Anderson 0987e98db3 Add support for baseof.ace templates in themes.
When we find a template that requires a base template, we should also look
for that base template in the current theme.

Fixes #1215.
2015-06-25 18:05:43 +02:00
Ariejan de Vroom cc9536ec46 Update docs for last template function 2015-06-15 21:18:38 +02:00
Ariejan de Vroom 40a92a062d Add after to template function documentation 2015-06-15 21:18:38 +02:00
Jeff Ramnani 102a3b95ae Document techniques for debugging templates.
This information was previously scattered around in the forums and
mailing list.  Add it to the official docs to make things easier for new
users.

Fixes #1167
2015-05-26 10:01:45 +02:00
bep be778c3160 docs: some more on absURL, relURL 2015-05-22 23:43:02 +02:00
bep be1366074c docs: add doc for substr
Fixes #1156
2015-05-22 22:36:25 +02:00
bep be4376a022 docs: add doc for slicestr
See #1156
2015-05-22 22:20:45 +02:00
bep be2e08c4ad docs: add doc for seq
See #1156
2015-05-22 22:17:41 +02:00
bep be4a404f28 docs: add ToC to some more pages 2015-05-22 20:45:52 +02:00
Jeff Ramnani 0d65ca27fd Docs: Add taxonomy term variables to the list of vars.
Taxonomy Term pages have variables in addition to those on "node"
pages.  Documenting these variables with all the other node variables
makes them easier to find.

Fixes: #1155
2015-05-22 19:41:34 +02:00
Jeff Ramnani 7125103b1e Add ".Render" to the list of functions.
Fixes: #1153
2015-05-22 19:38:01 +02:00
Rick Cogley 321bac2fc2 Clarifying Edits for templates/rss.md
Added clarification for RSS doc page.

* a little formatting to make key words jump out
* emphasize that you can create your own
* add how to link to the feed in <head>
* add what .RSSlink does
* added point that a link to an RSS feed should be of type application/rss+xml
2015-05-22 19:35:27 +02:00
Rick Cogley e522e5f415 Edits to templates/404.md
Added bit about how the 404.html page has to be set to load automatically - auto on Github but needs config on other web servers.

Also tweaked the text a little to emphasize it's a node type, and explain a little more about where the 404 template should be saved.
2015-05-16 00:05:45 +02:00
bep be5fa2f3bd docs: reverse taxonomy entries 2015-05-12 18:46:55 +02:00
bep be82355570 Add doc for absURL and relURL
Also group URL related functions in doc.
2015-05-11 19:09:04 +02:00
bep be4f48652d Add ToC to long pages
* A compact, fixed box in the right screen
* Only for big screens, > 1200 px wide
2015-05-11 18:39:42 +02:00
bep beacfcf865 doc: move the index func reference to where it's used 2015-04-29 22:40:33 +02:00
Rick Cogley da08fad5f3 Add index reference to go template primer doc page
Related to @bjornerik 's answer in this discussion: http://discuss.gohugo.io/t/inserting-data-from-data-file-into-content-file-newbie-question/1002/3 ... I figured I'd make myself useful and add the reference to the index function, on the go template primer page.

Also, I moved the reference links to the bottom.

A general comment: as good as these docs are, the primer at this point makes some assumptions about audience knowledge, so some might find it lacking. Once I understand better, I might make some more clarifying edits.
2015-04-29 21:06:21 +02:00
Rick Cogley a8f91ace11 Clarify partials folder subfolders
A couple of edits to clarify that the layout/partials folder can contain arbitrarily-named subfolders, since I found the examples using ``{{ partial "post/tag/list" . }}`` confusing. Some folders are named specifically to work a certain way with hugo, but although the examples use key functional section and taxonomy names like post and tag, it does not matter what they are called. Hopefully this will help other newbs.
2015-04-27 11:44:26 +02:00
bep be62c94872 Check spelling and some minor additions to Ace doc 2015-04-18 23:06:18 +02:00
bep be7c1e5dd4 Add doc for Ace templates
Fixes #1063
2015-04-18 20:23:28 +02:00
mdhender 42dcaabf4f Document getenv template function
Add `getenv` to the template function documentation.
2015-04-05 18:14:40 +02:00
mdhender 6b50c8fb82 Sort function names in templates documentation
The documentation on the functions is long.  It is easier to find
a function name when they are sorted within the sections.

Fixes #981
2015-04-04 23:30:08 +02:00
Bruno Clermont 3b2e1006fc Capitalize singular
Added in #523 it's ``Data.Singular``
2015-03-30 16:55:55 +02:00
sainaen 6a539db58e Update embedded rss.xml code in the docs 2015-03-30 16:50:44 +02:00
Anthony Fok b3bd71fec9 Update Hugo docs with the initialisms suggested by golint
In particular:

 * .Url → .URL (for node, menu and paginator)
 * .Site.BaseUrl → .Site.BaseURL
 * getJson → getJSON
 * getCsv → getCSV
 * safeHtml → safeHTML
 * safeCss → safeCSS
 * safeUrl → safeURL

Continued effort in fixing #959.
2015-03-18 11:30:37 +01:00
Ivan Fraixedes 366f991694 Another link in the same page 2015-02-14 18:35:37 -05:00
Ivan Fraixedes b389a92383 Fixed invalid link to partials 2015-02-14 18:35:37 -05:00
bep 03fff880ec Add docs for Data Files
Fixes #887
2015-02-09 16:52:52 +01:00
bep f264076f66 Add doc for Scratch 2015-01-31 22:01:30 +01:00
Anthony Fok 659f71e617 [Docs] Fix more missing . in example partial calls 2015-01-31 07:27:42 -07:00
Dan Hatch 20bed49f52 Fixed syntax error in 404.html template code 2015-01-31 01:01:50 -07:00
Anthony Fok d397bc4f43 [Docs] Complete the transition from "indexes" to "taxonomies" (almost)
Also mention `.Site.Indexes` → `.Site.Taxonomies` as well as
the upcoming `.Site.Recent` → `.Site.Pages` transitions.
2015-01-29 12:48:14 -07: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
Tatsushi Demachi 37490ee27a Add dateFormat template function
This is the implementation of the proposal at #235 and
http://discuss.gohugo.io/t/parsing-dates-in-templates/603/3
2015-01-22 00:08:30 +01:00
Anthony Fok 173aa53b8a [Docs] Use of $. to access global context from anywhere
See #804, http://discuss.gohugo.io/t/templates-multiple-parameters/600/3
and http://stackoverflow.com/questions/16734503/access-out-of-loop-value-inside-golang-templates-loop
for related discussions.
2015-01-21 00:35:12 -07:00
Anthony Fok f015e9b8e0 [Docs] Recommend the use of backticks for IE conditionals
Special thanks to @tatsushid and @bjornerik for the insight!

Fixes #778.
2015-01-20 23:45:26 -07:00
Anthony Fok a17c290a33 [Docs] Correct description of "Read More" links in Summaries
Also revise some paragraphs for succinctness.

Fixes #788
2015-01-20 15:45:57 -07:00
Anthony Fok 2342655fde [Docs] Incorporate some great ideas by @mohae into the safeUrl docs
E.g. how `#ZgotomlZ` is used to "defang" the URL
2015-01-20 00:24:47 -07:00
Anthony Fok 724cc0ddff Add safeUrl; disable safeHtmlAttr; rename safeCSS to safeCss
- Add `safeUrl` template function (Fixes #347)
- Add TestSafeUrl() fashioned after @tatsushid great examples
- Disable `safeHtmlAttr` pending further discussions on its other
  use cases because `safeUrl` is a cleaner solution to #347.
  (There are also `safeJs` and `safeJsStr` that we could implement
  if there are legitimate demands for them.)
- Rename `safeCSS` to `safeCss` (to follow the convention of `safeHtml`)
- Add/expand documentation on `safeHtml`, `safeCss` and `safeUrl`
2015-01-19 23:41:22 -07:00
Anthony Fok 53b4ab4cf3 Revert "[Docs] Use <dl> for definition lists of variables"
This reverts commit 5d6dfe81b8.

The extra styling in docs/static/css/style.css has been retained.
2015-01-19 11:44:14 -07:00
Anthony Fok 5d6dfe81b8 [Docs] Use <dl> for definition lists of variables
Hopefully making them more semantic and easier to read,
though it is raw HTML so it is slightly more work to maintain.

Also made minor revisions to some of the variable descriptions
to be more informative, e.g. `:monthname` in permalinks use
full English names ("January" etc.)
2015-01-19 01:30:38 -07:00
bep 56eead2ade Fix broken doc section 2015-01-19 08:14:57 +01:00
bep 109e6f95fd Merge branch 'master' of github.com:spf13/hugo 2015-01-19 02:41:16 +01:00
Derek Perkins ac6b86aff8 Added top level .Hugo variable with version, commit and generator information + docs
Added Version, CommitHash and BuildDate to hugolib/hugo.go and used it in build
Removed commitHash and buildDate from commands/version.go and used hugolib vars
Removed getDateFormat function from commands/version.go

Conflicts:
	README.md
	docs/content/templates/variables.md
2015-01-19 01:22:23 +01:00
Anthony Fok 1dfd0225e3 [Docs] Minor revisions to future v0.13 Release Note
And a tiny bit of copyediting here and there.
2015-01-18 13:27:09 -07:00
Tom Helmer Hansen 871e811339 Add trim and replace template functions 2015-01-18 14:54:26 +01:00
Anthony Fok b59dd163ec [Docs] More copyediting
* Add link to https://travis-ci.org/spf13/hugo
* Correct heading levels in docs/content/community/mailing-list.md
* Mention RFC 3339 as the `date` format set by `hugo new`
* Mention that `hugo new` does not add `draft = true` when the user
  provides an archetype
* List short examples of TOML and YAML side by side
* Compact the Math template functions into a table
* Put some notes into a blockquote
2015-01-17 00:45:53 -07:00
Tomas Roos a4da52622c Missing . on footer partials 2015-01-16 03:39:38 -07:00
Dan Hersam 6fda9012d6 Fixed error in tutorial, added site variable docs
While following the github pages tutorial I found some issues. These are
the commands I ran that worked.

Added site variables to the docs from the code.
2015-01-12 23:00:28 -07:00
Anthony Fok 5bfc812dc6 [Docs] Remove references to "ATOM" feeds
Thanks to @snej for reporting!

Fixes #790
2015-01-12 14:12:08 -07:00
Anthony Fok b0181e278b Some more random copyediting of Hugo docs
- Change "livereload" and "live reload" to "LiveReload";
 - Add a `$ ` prompt before example command lines
   (not exhaustive, work in progress);
 - Remove unnecessary whitespace from partials;
 - Revise the blackfriday options table in overview/configuration.md
   to make it narrower.
 - Manually set the language for highlight.js where appropriate
 - Rename "404" to "Custom 404 page", and remove incorrect reference
   to "homepage"
 - Credit the author of tutorials/github_pages_blog.md
   (Similar notes are necessary for other contributed pages where
    "I" am not spf13 to avoid reader confusion.)
 - Add CSS for `kbd` and `table` etc. to css/style.css;
 - etc.
2015-01-09 11:51:15 -07:00
philgs dca6eabaca Add config file example to variables.md
Add a config file example for setting .Site.Params to variables.md. This addresses my confusion in [issue #766](https://github.com/spf13/hugo/issues/766).
2015-01-05 18:51:36 +01:00
Dave Johnston a5f5106154 Add in-section Next/Prev content pointers
Conflicts:
	docs/content/meta/release-notes.md
	docs/content/templates/variables.md
2015-01-05 18:26:09 +01:00
Tatsushi Demachi 0d17ee7ed4 Add operator argument to where template function
It allows to use `where` template function like SQL `where` clause.
For example,

    {{ range where .Data.Pages "Type" "!=" "post" }}
        {{ .Content }}
    {{ end }}

Now these operators are implemented:

    =, ==, eq, !=, <>, ne, >=, ge, >, gt, <=, le, <, lt, in, not in

It also fixes `TestWhere` more readable
2015-01-04 12:15:17 +01:00
Austin Ziegler ae9c25afc0 Implement apply.
- apply seq fn args…
2015-01-02 11:50:22 +01:00
Austin Ziegler 6033abe1e7 Add a chomp function.
- Mostly useful in pipelines.
2015-01-02 11:50:22 +01:00
Tatsushi Demachi fa8ac87d5e Make 'where' template function accepts dot chaining key argument
'where' template function used to accept only each element's struct
field name, method name and map key name as its second argument. This
extends it to accept dot chaining key like 'Params.foo.bar' as the
argument. It evaluates sub elements of each array elements and checks it
matches the third argument value.

Typical use case would be for filtering Pages by user defined front
matter value. For example, to filter pages which have 'Params.foo.bar'
and its value is 'baz', it is used like

    {{ range where .Data.Pages "Params.foo.bar" "baz" }}
        {{ .Content }}
    {{ end }}

It ignores all leading and trailing dots so it can also be used with
".Params.foo.bar"
2014-12-29 12:53:41 +01:00
Anthony Fok 8042e77488 Typo fix: "simple" → "simply" in templates/views.md
Thanks to @paulsullivan for catching that typo!
2014-12-24 16:58:28 -07:00
Anthony Fok 68cea07072 Minor copyediting, no new content added. 2014-12-24 04:59:53 -07:00
Derek Perkins 717f702e2f Added delimit & sort template functions, tests and docs 2014-12-18 22:28:12 -05: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
Anthony Fok a6d3862b87 Docs: Minor copyediting/proofreading
- Correct some typos
- Add backticks and commas where necessary
- Use fenced code blocks specifying "bash" as the language
  to avoid weird highlighting
- Place commas outside of quotation marks surroundingn codes
  to avoid possible confusion
- Suggest users to use the discussion forum rather than the
  mailing list
2014-12-08 22:44:30 +01:00
Anthony Fok 736dd4b521 Docs: Quote <!--more--> in <code> instead of italicizing it
Also replace "--" with "&#x2d;&#x2d;" prevent "--" from
being interpreted as en-dash.

Note: A simple `<!--more-->` does not work.
2014-12-08 22:44:30 +01:00
Kartik Singhal 742a064b24 Correct alias 2014-12-03 09:17:45 +01:00
bep d616617292 Doc for markdownify
This small function feels important enough to maybe deserve more than these three lines, but this will have to do for now.

This assumes that #652 gets merged.
2014-11-24 23:18:18 -05:00
Kartik Singhal 9b850c4adb Correct path in theme search order 2014-11-24 17:24:39 -05:00
Tatsushi Demachi 5e28606b84 Add sort and grouping functions for publish date and param of Page
`GroupBy` is modified to allow it to receive a method name argument for
example `Type` as its first argument. It is only allowed to call with
a method which takes no arguments and returns a result or a pair of
a result and an error.

The functions discussed at #443 are also added

- `ByPublishDate`: Order contents by `PublishDate` front matter variable
- `GroupByPublishDate(format, order)`: Group contents by `PublishDate`
  front matter variable formatted in string like `GroupByDate`
- `GroupByParam(key, order)`: Group contents by `Param` front matter
  variable specified by `key` argument
- `GroupByParamDate(key, format, order)`: Group contents by `Param`
  front matter variable specified by `key` argument and formatted in
  string like `GroupByDate`. It's effective against `time.Time` type
  front matter variable
2014-11-01 22:41:04 -04:00
Will Stevens 1d4dde7ac3 added docs for 'intersect' and 'in' template functions 2014-10-15 12:30:10 -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
bep 953cad6cbd Document manual breakpoint of .Summary
The use of <!--more--> to set the breakpoint for the generated page summary is mentioned in a release note, but not in the doc itself.

Very useful - and it leaves the formatting in place.
2014-10-15 12:15:59 -04:00
Kartik Singhal 879e90dca7 Switch to new hompage 2014-10-02 13:39:59 -04:00
Alex Dunn 275e1c0d23 more examples and explanation of go templating
Emphasizing to people (like me) who aren't familiar with Go that just because something's not mentioned in the Hugo docs doesn't mean it's not possible
2014-09-11 17:22:08 -04:00
Daniel Fairhead 012a473e27 added "eq" function to docs. 2014-09-11 17:02:20 -04:00
Anthony Fok 5dd3eaabee More proofreading and minor revisions to Hugo docs
Among the various changes, most instances of

    {{ template "partials/FILE.html" . }}

were changed to

    {{ partial "FILE.html" . }}

Also, in main.go, change "2013" to "2013-14".
2014-09-08 11:41:10 -04:00
Anthony Fok a6022293af Minor proofreading corrections to Hugo docs 2014-09-01 08:19:40 -04:00
spf13 93addfcbee Adding documentation about 'where' and cleaning up docs around first. 2014-08-30 00:57:38 -04:00
spf13 0ce4ec1edb Added more examples and cleaned up the GroupBy functionality documentation 2014-08-30 00:21:47 -04:00
spf13 bb02a14b1e Adding a page listing the different methods available to Taxonomies. 2014-08-29 23:42:26 -04:00
spf13 ba8f652acc More taxonomy examples in templates. 2014-08-29 23:41:53 -04:00
Tatsushi Demachi 6f9db4a784 Add document about page grouping functions 2014-08-28 12:56:32 -04:00
spf13 4a91b8c7fd fixed #389 . Added alias for missing page. 2014-08-26 13:16:45 -04:00
spf13 294222ac74 Fixing a broken link in the docs 2014-08-25 14:02:39 -04:00
spf13 aae1ff3c92 Adding IsNode & IsPage functions to Page & Node 2014-08-19 21:27:13 -04:00
Nate Finch 29c45dd690 make type-or-section more obvious
It took me a long time to realize that /layouts/TYPE or SECTION/LAYOUT.html  was supposed to be a single URL and not two urls (/layouts/TYPE) or (SECTION/LAYOUT.html) ... putting in the hyphens I think makes it much more clear it's all one URL, and only the middle part is an either-or.
2014-08-06 00:05:05 -04:00
Rolando Pereira 836b1800f9 Fix minor typo in file docs/content/templates/overview.md 2014-06-30 15:18:46 -04:00
Gour 0e57e32f54 do not use angle brackets in hyperlink labels 2014-06-30 15:16:30 -04:00
jesper-mortensen 86c3de4be1 Fix #263, document HTML comments & IE conditionals 2014-06-30 14:51:30 -04:00
spf13 b2b7ba4243 fixing typo in docs 2014-06-30 14:49:24 -04:00
spf13 c297d7451f Adding 'partial' template function to add theme / local awareness to the partials directory. 2014-06-06 16:15:19 -04:00
spf13 05875153bc Converting front matter to YAML 2014-05-29 18:45:22 -04:00
spf13 0c2544608c Add future details to documentation 2014-05-29 01:02:43 -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