Commit graph

231 commits

Author SHA1 Message Date
Matthieu Bresson 39408925fd docs: change .Site to $.Site where the global context is masked by the term's context 2017-06-11 18:52:26 +02:00
Torbjörn Lönnemark 00d632153a docs: Use single link element for RSS in example
The rel attribute supports specifying a set of values, not only a single
one.

Using two link elements can also cause browsers to show the feed twice
in menus.
2017-06-09 13:12:09 +02:00
Nathan Sharfi e28d9aa42c tpl: Add uniq function 2017-06-03 19:13:58 +02:00
Munif Tanjim 27e88154af docs: Fix incorrect path in templates/list 2017-05-18 17:12:23 +02:00
Cameron Moore 93b3b13867 tpl/lang: Add NumFmt function
NumFmt formats a number with a given precision using the requested
decimal, grouping, and negative characters.

Fixes #1444
2017-05-18 09:49:20 +03:00
Albert Nigmatzianov 231c0a7e09 docs: Fix typo in templates/functions.md
Fix #3440
2017-05-06 21:32:51 +02:00
Jack Taylor 90d3fbf1da tplimpl: Add translation links to the default sitemap template
For pages with translations, add links with hreflang attributes to the
default sitemap template. This helps Google to show the correct
language page in its search results. The syntax used is based on
Google's example at [1].

Also update the sitemap template docs to reflect the changes in the
default template.

[1]
https://support.google.com/webmasters/answer/2620865?hl=en&topic=2370587&ctx=topic

Fixes #2569
2017-04-22 22:37:14 +02:00
Rachel Simone Weil b5e32eb609 docs: Fix .Data.Pages range in sample 2017-04-16 13:22:24 +02:00
Bjørn Erik Pedersen 3c405f5172 all: Document the Output Formats feature
This commit also adds a new command, docshelper, with some utility funcs that adds a JSON datafiles to /docs/data that would be a pain to create and maintain by hand.

Fixes #3242
2017-04-07 10:52:16 +02:00
Prayag Verma f1b1df5058 docs: Fix typo in templates/functions.md (#3214)
limitted → limited
2017-03-22 13:21:00 +05:00
Ryan Watters 68f4cd829e Removing .Site.Recent
Per forum:

https://discuss.gohugo.io/t/site-recent-deprecated-or-removed/5851/2
2017-03-19 19:41:22 -05:00
digitalcraftsman 5d0748ce51 tpl: Add union template func 2017-03-12 23:04:12 +01:00
Anton Staaf c950699907 hugolib: Populate the taxonomy term Pages list
Previously this was left empty, but it is very handy to have a list
of term pages for a given taxonomy.  This list can now be paginated
like other page lists.  It makes it possible to render summary
content from each terms index page for instance.  It also makes it
possible to sort the term pages in the same way that other page
lists can be sorted.  An RSS feed is now generated for
KindTaxonomyTerm pages as well.

This also fixes a bug in HugoSites.createMissingPages.  Previously
it would only check for existing KindTaxonomyTerm pages if the
taxonomy had any terms defined.  So for a taxonomy with no terms
but a taxonomy terms page it would generate a second empty terms
page.
2017-03-05 21:24:14 +01:00
Bjørn Erik Pedersen f4779b25bc docs: Add new section list lookup alternative
Updates #3116
2017-03-02 10:08:41 +01:00
Cameron Moore 8d5132229f docs: Update RSS docs with rssLimit changes
Side effect: remove unnecessary XML templates from example blog site.

Fixes #3065
2017-02-26 21:47:05 +01:00
John Feminella b2e3748a4e hugolib: Enhance .Param to permit arbitrarily nested parameter references
The Param method currently assumes that its argument is a single,
distinct, top-level key to look up in the Params map. This enhances the
Param method; it will now also attempt to see if the key can be
interpreted as a nested chain of keys to look up in Params.

Fixes #2598
2017-02-19 08:50:08 +01:00
John Feminella 298ebc37c2 hugolib: Add ability to sort by frontmatter parameters 2017-02-10 20:01:25 +07:00
digitalcraftsman dae6a4539f docs: Fix typo in templates/functions.md 2017-02-04 22:23:57 +01:00
Mathias Biilmann 2989c38245 tpl: Add truncate template function
This commit adds a truncate template function for safely truncating text without
breaking words. The truncate function is HTML aware, so if the input text is a
template.HTML it will be truncated without leaving broken or unclosed HTML tags.

    {{ "this is a very long text" | truncate 10 " ..." }}
    {{ "With [Markdown](/markdown) inside." | markdownify | truncate 10 }}
2017-01-06 10:42:32 +01:00
Daniel Lang 2127203ae3 Update documentation and test for sitemap template 2017-01-03 17:11:22 +01:00
Nishanth Shanmugham cabc6b3186 tpl: Add now function
Add a now template function that returns the current time as time.Time.
Also, update related docs.
2017-01-01 02:50:46 +01:00
digitalcraftsman 707d3cf137 docs, tpl: Fix documentation of UniqueID
See #2861
2016-12-31 17:55:03 +01:00
Emily Huynh a4fc20a12b docs: Fix typo in templates/blocks
Fixed typo in templates/blocks.md in the docs.
2016-12-22 17:05:48 +01:00
Brian Shumate 6fd4bfcae3 docs: Update layouts path name 2016-12-16 01:09:51 +01:00
Bjørn Erik Pedersen 79b2725ac4 docs: Improve documentation for block templates
Hopefully.

Fixes #2363
2016-12-15 22:02:21 +01:00
Cameron Moore 596bbea815 docs: Clarify single page template search path
Fixes #2791
2016-12-15 19:34:25 +01:00
Cameron Moore 26084ad198 docs: Fix pipe examples
Fixes #2787
2016-12-15 19:33:40 +01:00
Cameron Moore fa09e20d9a docs: Fix Ref and RelRef syntax
Fixes #2793
2016-12-15 19:32:41 +01:00
Cameron Moore 2f0e81989a docs: Document partialCached func
Fixes #2779
2016-12-15 19:31:43 +01:00
Cameron Moore 9c2ea3691a docs: Add .Site.RegularPages docs
Fixes #2775
2016-12-15 11:15:42 +01:00
madhead e4ebe0d5bf docs: Fix querify example 2016-12-14 11:01:11 +01:00
Cameron Moore b4404a9554 docs: Update File variables 2016-12-10 10:47:23 +01:00
digitalcraftsman 2236056672 docs: Fix linebreaks in templates/variables.md 2016-12-04 18:21:52 +01:00
digitalcraftsman 0f6c73cf2e tpl: Add sha256 template function
Fixes #2742
2016-12-04 15:03:52 +01:00
digitalcraftsman 01b8bc1b26 docs: Update description of querify 2016-12-03 20:23:59 +01:00
digitalcraftsman 0ba9fb9631 docs: Document querify template func
Closes #2733
2016-12-03 20:12:12 +01:00
Bjørn Erik Pedersen a5b3b07657 docs: Add Pages to variables section
And some other minor doc fixes.

Closes #2297
Closes #2649
2016-11-22 09:57:03 +01:00
Bjørn Erik Pedersen e29f6fe527 docs: Add sections on node now being a page
Updates #2297
2016-11-22 09:57:03 +01:00
Bjørn Erik Pedersen aafbd3b4bf docs: Revise docs to reflect that Node is gone
Updates #2297
2016-11-22 09:57:03 +01:00
Bjørn Erik Pedersen 65f803e1fa docs: Rename RSSlink to RSSLink
The former will be deprecated.
2016-11-19 12:00:25 +01:00
Tristan Rice a49f838cd0 tpl: Add imageConfig function
Add imageConfig function which calls image.DecodeConfig and returns the height, width and color mode of the image. (#2677)

This allows for more advanced image shortcodes and templates such as those required by AMP.

layouts/shortcodes/amp-img.html
```
{{ $src := .Get "src" }}
{{ $config := imageConfig (printf "/static/%s" $src) }}

<amp-img src="{{$src}}"
           height="{{$config.Height}}"
           width="{{$config.Width}}"
           layout="responsive">
</amp-img>
```
2016-11-16 13:00:45 +01:00
Albert Nigmatzianov f21e2f25c9 all: Unify case of config variable names
All config variables starts with low-case and uses camelCase.

If there is abbreviation at the beginning of the name, the whole
abbreviation will be written in low-case.
If there is abbreviation at the end of the name, the
whole abbreviation will be written in upper-case.
For example, rssURI.
2016-10-24 20:56:00 +02:00
Nate Finch 10a773cde7 Implement support for alias templates
This change adds a canonical alias.html template that is used for page
redirects, and passes the page as data to the template under .Page

Fixes #2533
Closes #2576
2016-10-15 15:25:05 +02:00
Bjørn Erik Pedersen 4a79fa0c33 Revert the "standardize author data"
There were some breaking changes etc. that is too late to fix for 0.17.

Let us think this through and add proper author support for Hugo 0.18.

Fixes #2464

Revert "docs: Add documentation for author profiles"

This reverts commit b6673e5309.

Revert "Add First Class Author Support"

This reverts commit cf978c0649.
2016-09-18 19:16:39 +02:00
digitalcraftsman b6673e5309 docs: Add documentation for author profiles 2016-09-17 13:14:05 +02:00
Derek Perkins cf978c0649 Add First Class Author Support
Closes #1850
2016-09-17 00:49:24 +02:00
digitalcraftsman 3410007dca docs: List multilingual tpl vars and show menu creation
Fixes #2436
2016-09-16 15:37:12 +02:00
Bjørn Erik Pedersen 2f7e8df5ba docs: Fix spelling: HasTranslations > IsTranslated 2016-09-06 18:32:20 +03:00
Bjørn Erik Pedersen 93717aac5c docs: Get the variable and funcs re multilingual up-to-date 2016-09-06 18:32:20 +03:00
Bjørn Erik Pedersen 54141f71dd Improve language handling in URLs
The current "rendering language" is needed outside of Site. This commit moves the Language type to the helpers package, and then used to get correct correct language configuration in the markdownify template func.
This commit also adds two new template funcs: relLangURL and absLangURL.

See #2309
2016-09-06 18:32:18 +03:00