hugo/docs/content/en/variables/hugo.md

50 lines
1.5 KiB
Markdown
Raw Normal View History

---
title: Hugo-specific Variables
linktitle: Hugo Variables
description: The `.Hugo` variable provides easy access to Hugo-related data.
date: 2017-03-12
publishdate: 2017-03-12
lastmod: 2017-03-12
categories: [variables and params]
keywords: [hugo,generator]
draft: false
menu:
docs:
parent: "variables"
weight: 60
weight: 60
sections_weight: 60
aliases: []
toc: false
wip: false
---
Squashed 'docs/' changes from 0c3c04fd6..540aeddc7 540aeddc7 Small fixes for Open Graph internal template 47bbb3fd7 Bump lodash.template from 4.4.0 to 4.5.0 in /themes/gohugoioTheme 64c1cc3db Update title.md 36c27be37 Update configuration.md 4627cfe9a added commento.io to the list 341d9d945 Fix link to font assets 4a6876dec Small typo fix in configuration.md 736d6ddd7 Add bypasscensorship.org showcase. de7ab636b Use actual width in image processing examples 6c88ab2da Update directory-structure.md 88f559e81 Fix spelling mistakes 7bd427141 Rephrase four points from Hosting on Github docs bce1b1832 Fix typos for absLangURL and relLangURL functions abab57335 Update directory-structure.md a6716f2ed Fix metadata list 5ef61d912 Fix typo d9e467b8b Actuall show how to generate pages in quickstart 0aadc92e7 Update link to issue theme submission b1902faaa Remove incorrect note about Hugo snap --classic use. d451e7362 Update documentation on page variables ab2233c39 Update publish_to_ghpages.sh 7c120346b Fix typo in syntax highlighting page. f01dc555d Correct some typos be825ade9 Videos plural produces og:video bc962fbdf Updated installing.md file to include linuxbrew installation 08c9f8fc8 Mention 1 MB file size limit in readFile doc 7145e29e2 Fixes bad URL in menus.md for .hasChildren * part of issue #814 0edbd59c4 add warning about .Hugo variable being deprecated 77f74ced5 fix: typo in output-formats.md f71b67f34 Correct typo "RFC339" to "RFC1123Z" (#837) 424c0207a baseurl -> baseURL f4e24a03e Render launched; no invite code needed 37e1101d3 Add Render hosting guide 01d0a6481 Bump js-yaml from 3.12.0 to 3.13.1 in /themes/gohugoioTheme edb7b36b0 Link site hierarchy schema to larger version af72acda0 Fixes typo in fingerprint.md 0a738467b Adding required XML tag to sample templates 52211f656 Remove note that XML declaration is not needed a39b9ac87 Adding required XML tag to sample templates 1a44d8a50 Add configuration information for Azure 5b7c6b5a1 remove google plus 5a64301ba HTTPS link to yaml.org/spec/ git-subtree-dir: docs git-subtree-split: 540aeddc797658a2c3d0e49e944592d2b23b3bb8
2019-07-15 21:49:41 +00:00
{{% warning "Deprecated" %}}
Page's `.Hugo` is deprecated and will be removed in a future release. Use the global `hugo` function.
For example: `hugo.Generator`.
{{% /warning %}}
It contains the following fields:
Squashed 'docs/' changes from 3e663efb2..fc61378a3 fc61378a3 Add Hugo 0.32 related docs 77edf7fd7 commands: Regenerate af9d25458 Fix Blackfriday's Markdown extension name 1223dd63a Remove roadmap b8bcb2fb8 Include note to allow hugo write permissions outside home dir 7dbccb936 Fix typo in roadmap 3a38da6f5 Fix spelling 94ebe50ff Merge branch 'master' of github.com:gohugoio/hugoDocs 89376e21d Clarify Hugo Roadmap 03d191fec Mention Reverse function in taxonomy tpl page. a4ea3402d Fix ref and relref function pages. b36632b31 Remove non-existing source variable a638160dc Update Content Organization to match the world 47eb431ca Correct one link in templates/output-formats.md 8bf933629 Spell fix ce2d48728 Add docs for .AllTranslations de94b4942 Move sponsor data to theme data 41fe75254 Merge commit 'f463ef99ed2862e4042557e28aece7ca858e1d0a' f463ef99e Squashed 'themes/gohugoioTheme/' changes from bc851da9..75da2f6b 532c65f2a Move sponsor logo to theme 899e2defe Add sponsor logos to home page and footer 3ca53db97 Release 0.31.1 bb9876ce2 Merge branch 'temp0311' c7c3ee7e5 releaser: Prepare repository for 0.32-DEV 4ac554792 releaser: Add release notes to /docs for release of 0.31.1 52bfb5c15 releaser: Bump versions for release of 0.31.1 cfdc2e4ea Fix output formats example 5746c10c2 More on output format de2ee0fe0 Improve suffix redefinition example c9997839e Update gitlab CI submodule management 82d74e306 Add Bootstrap styling to breadcrumb example c8c9601a8 Use the code shortcode for the breadcrumb example 16be43e7d Clean up formatting in variable definition lists 149c2c157 Add nested section docs 783c3d636 Sync theme 60a220bbd Squashed 'themes/gohugoioTheme/' changes from 6b632895..bc851da9 4b33a04d0 Fix typo 94cffc43c Fix little typo a5d4f762f Fix typo 36c5a0b43 Add a note about the 2 in staticDir2 087bd9a9f Add KeyCDN to menu 4ac8aae38 Hugo 0.31 Released 8fdd995e7 releaser: Prepare repository for 0.32-DEV eb0f38fbb releaser: Add release notes to /docs for release of 0.31 60efdfff7 releaser: Bump versions for release of 0.31 44dafb10b Merge commit '30c0d485eaff6d70df1be0353911ddca485d52bf' e6b847b95 Merge commit '05e42bc643f1840ed2ad9c2eff82a269d1381683' 15d86a525 Handle Taxonomy permalinks 5c3c18d7f Add support for height argument to figure shortcode git-subtree-dir: docs git-subtree-split: fc61378a3227c14883a2942d67c806014e7bb6cb
2017-12-30 08:15:31 +00:00
.Hugo.Generator
: `<meta>` tag for the version of Hugo that generated the site. `.Hugo.Generator` outputs a *complete* HTML tag; e.g. `<meta name="generator" content="Hugo 0.18" />`
Squashed 'docs/' changes from 3e663efb2..fc61378a3 fc61378a3 Add Hugo 0.32 related docs 77edf7fd7 commands: Regenerate af9d25458 Fix Blackfriday's Markdown extension name 1223dd63a Remove roadmap b8bcb2fb8 Include note to allow hugo write permissions outside home dir 7dbccb936 Fix typo in roadmap 3a38da6f5 Fix spelling 94ebe50ff Merge branch 'master' of github.com:gohugoio/hugoDocs 89376e21d Clarify Hugo Roadmap 03d191fec Mention Reverse function in taxonomy tpl page. a4ea3402d Fix ref and relref function pages. b36632b31 Remove non-existing source variable a638160dc Update Content Organization to match the world 47eb431ca Correct one link in templates/output-formats.md 8bf933629 Spell fix ce2d48728 Add docs for .AllTranslations de94b4942 Move sponsor data to theme data 41fe75254 Merge commit 'f463ef99ed2862e4042557e28aece7ca858e1d0a' f463ef99e Squashed 'themes/gohugoioTheme/' changes from bc851da9..75da2f6b 532c65f2a Move sponsor logo to theme 899e2defe Add sponsor logos to home page and footer 3ca53db97 Release 0.31.1 bb9876ce2 Merge branch 'temp0311' c7c3ee7e5 releaser: Prepare repository for 0.32-DEV 4ac554792 releaser: Add release notes to /docs for release of 0.31.1 52bfb5c15 releaser: Bump versions for release of 0.31.1 cfdc2e4ea Fix output formats example 5746c10c2 More on output format de2ee0fe0 Improve suffix redefinition example c9997839e Update gitlab CI submodule management 82d74e306 Add Bootstrap styling to breadcrumb example c8c9601a8 Use the code shortcode for the breadcrumb example 16be43e7d Clean up formatting in variable definition lists 149c2c157 Add nested section docs 783c3d636 Sync theme 60a220bbd Squashed 'themes/gohugoioTheme/' changes from 6b632895..bc851da9 4b33a04d0 Fix typo 94cffc43c Fix little typo a5d4f762f Fix typo 36c5a0b43 Add a note about the 2 in staticDir2 087bd9a9f Add KeyCDN to menu 4ac8aae38 Hugo 0.31 Released 8fdd995e7 releaser: Prepare repository for 0.32-DEV eb0f38fbb releaser: Add release notes to /docs for release of 0.31 60efdfff7 releaser: Bump versions for release of 0.31 44dafb10b Merge commit '30c0d485eaff6d70df1be0353911ddca485d52bf' e6b847b95 Merge commit '05e42bc643f1840ed2ad9c2eff82a269d1381683' 15d86a525 Handle Taxonomy permalinks 5c3c18d7f Add support for height argument to figure shortcode git-subtree-dir: docs git-subtree-split: fc61378a3227c14883a2942d67c806014e7bb6cb
2017-12-30 08:15:31 +00:00
.Hugo.Version
: the current version of the Hugo binary you are using e.g. `0.13-DEV`<br>
Squashed 'docs/' changes from 785e375f..49809a03 49809a03 Merge commit '20a631b4964fc0ab9137cce1e41774cbc17de044' 20a631b4 Squashed 'themes/gohugoioTheme/' changes from b8202f539..dafc91ff1 8b58f565 Re-generate CLI docs 4653a724 Add Netlify deployment badge 2d6246bc Remove some deprecated site variables e6777153 Improve Algolia Search Display Styling 1570999f Add missing "." in front of gitlab-ci.yaml example b922ae7d This adds documentation to the new configDir/Environment logic from .53 (#729) 7cff379f Correctly escape multi-word taxonomy terms in example 2dfeeda4 fix typo by removing stray paren 0870bd9a Fix typo in `paginate` description 91e8be85 Fixes https://github.com/gohugoio/hugo/issues/5609 c1db65ec Make the dummy URL more obvious b4589ff0 Fix a link b73dcb9a Consistently use "posts" as section name in examples 7a56abbc Format definitions a9c6fd9b Minor clarification over the last commit 5c86bdc8 Add alternative instructions for Quick Start for non-git users dafe7ee9 Add Visual Studio Code plug-ins 110ed19e Update HUGO_VERSION 2abd031a Update page.md b332f7b9 Update page.md f5a8c9d4 Update static-files.md 6d0c155c Add note about relative protocol URLs a13751ac Theme Warning: Remove note about unquoted URLs 4c8f7d68 Incorporate feedback 6f2b9cf0 Update Creating Themes Warning 40d88d98 Fix ToC example to use binary true/false 4a11f3f1 Fix typo 2dbfc0a4 Fix a typo in taxonomies d63790ef Do not mark UndocumentedFeature issues as stale d7aff095 Regenerate docs.json 71c0826f Update transform.Unmarshal.md git-subtree-dir: docs git-subtree-split: 49809a038b2691637bab7f3f2e385dde654a88b8
2019-02-01 08:01:04 +00:00
.Hugo.Environment
: the current running environment as defined through the `--environment` cli tag.
Squashed 'docs/' changes from 3e663efb2..fc61378a3 fc61378a3 Add Hugo 0.32 related docs 77edf7fd7 commands: Regenerate af9d25458 Fix Blackfriday's Markdown extension name 1223dd63a Remove roadmap b8bcb2fb8 Include note to allow hugo write permissions outside home dir 7dbccb936 Fix typo in roadmap 3a38da6f5 Fix spelling 94ebe50ff Merge branch 'master' of github.com:gohugoio/hugoDocs 89376e21d Clarify Hugo Roadmap 03d191fec Mention Reverse function in taxonomy tpl page. a4ea3402d Fix ref and relref function pages. b36632b31 Remove non-existing source variable a638160dc Update Content Organization to match the world 47eb431ca Correct one link in templates/output-formats.md 8bf933629 Spell fix ce2d48728 Add docs for .AllTranslations de94b4942 Move sponsor data to theme data 41fe75254 Merge commit 'f463ef99ed2862e4042557e28aece7ca858e1d0a' f463ef99e Squashed 'themes/gohugoioTheme/' changes from bc851da9..75da2f6b 532c65f2a Move sponsor logo to theme 899e2defe Add sponsor logos to home page and footer 3ca53db97 Release 0.31.1 bb9876ce2 Merge branch 'temp0311' c7c3ee7e5 releaser: Prepare repository for 0.32-DEV 4ac554792 releaser: Add release notes to /docs for release of 0.31.1 52bfb5c15 releaser: Bump versions for release of 0.31.1 cfdc2e4ea Fix output formats example 5746c10c2 More on output format de2ee0fe0 Improve suffix redefinition example c9997839e Update gitlab CI submodule management 82d74e306 Add Bootstrap styling to breadcrumb example c8c9601a8 Use the code shortcode for the breadcrumb example 16be43e7d Clean up formatting in variable definition lists 149c2c157 Add nested section docs 783c3d636 Sync theme 60a220bbd Squashed 'themes/gohugoioTheme/' changes from 6b632895..bc851da9 4b33a04d0 Fix typo 94cffc43c Fix little typo a5d4f762f Fix typo 36c5a0b43 Add a note about the 2 in staticDir2 087bd9a9f Add KeyCDN to menu 4ac8aae38 Hugo 0.31 Released 8fdd995e7 releaser: Prepare repository for 0.32-DEV eb0f38fbb releaser: Add release notes to /docs for release of 0.31 60efdfff7 releaser: Bump versions for release of 0.31 44dafb10b Merge commit '30c0d485eaff6d70df1be0353911ddca485d52bf' e6b847b95 Merge commit '05e42bc643f1840ed2ad9c2eff82a269d1381683' 15d86a525 Handle Taxonomy permalinks 5c3c18d7f Add support for height argument to figure shortcode git-subtree-dir: docs git-subtree-split: fc61378a3227c14883a2942d67c806014e7bb6cb
2017-12-30 08:15:31 +00:00
.Hugo.CommitHash
: the git commit hash of the current Hugo binary e.g. `0e8bed9ccffba0df554728b46c5bbf6d78ae5247`
Squashed 'docs/' changes from 3e663efb2..fc61378a3 fc61378a3 Add Hugo 0.32 related docs 77edf7fd7 commands: Regenerate af9d25458 Fix Blackfriday's Markdown extension name 1223dd63a Remove roadmap b8bcb2fb8 Include note to allow hugo write permissions outside home dir 7dbccb936 Fix typo in roadmap 3a38da6f5 Fix spelling 94ebe50ff Merge branch 'master' of github.com:gohugoio/hugoDocs 89376e21d Clarify Hugo Roadmap 03d191fec Mention Reverse function in taxonomy tpl page. a4ea3402d Fix ref and relref function pages. b36632b31 Remove non-existing source variable a638160dc Update Content Organization to match the world 47eb431ca Correct one link in templates/output-formats.md 8bf933629 Spell fix ce2d48728 Add docs for .AllTranslations de94b4942 Move sponsor data to theme data 41fe75254 Merge commit 'f463ef99ed2862e4042557e28aece7ca858e1d0a' f463ef99e Squashed 'themes/gohugoioTheme/' changes from bc851da9..75da2f6b 532c65f2a Move sponsor logo to theme 899e2defe Add sponsor logos to home page and footer 3ca53db97 Release 0.31.1 bb9876ce2 Merge branch 'temp0311' c7c3ee7e5 releaser: Prepare repository for 0.32-DEV 4ac554792 releaser: Add release notes to /docs for release of 0.31.1 52bfb5c15 releaser: Bump versions for release of 0.31.1 cfdc2e4ea Fix output formats example 5746c10c2 More on output format de2ee0fe0 Improve suffix redefinition example c9997839e Update gitlab CI submodule management 82d74e306 Add Bootstrap styling to breadcrumb example c8c9601a8 Use the code shortcode for the breadcrumb example 16be43e7d Clean up formatting in variable definition lists 149c2c157 Add nested section docs 783c3d636 Sync theme 60a220bbd Squashed 'themes/gohugoioTheme/' changes from 6b632895..bc851da9 4b33a04d0 Fix typo 94cffc43c Fix little typo a5d4f762f Fix typo 36c5a0b43 Add a note about the 2 in staticDir2 087bd9a9f Add KeyCDN to menu 4ac8aae38 Hugo 0.31 Released 8fdd995e7 releaser: Prepare repository for 0.32-DEV eb0f38fbb releaser: Add release notes to /docs for release of 0.31 60efdfff7 releaser: Bump versions for release of 0.31 44dafb10b Merge commit '30c0d485eaff6d70df1be0353911ddca485d52bf' e6b847b95 Merge commit '05e42bc643f1840ed2ad9c2eff82a269d1381683' 15d86a525 Handle Taxonomy permalinks 5c3c18d7f Add support for height argument to figure shortcode git-subtree-dir: docs git-subtree-split: fc61378a3227c14883a2942d67c806014e7bb6cb
2017-12-30 08:15:31 +00:00
.Hugo.BuildDate
: the compile date of the current Hugo binary formatted with RFC 3339 e.g. `2002-10-02T10:00:00-05:00`<br>
Squashed 'docs/' changes from 785e375f..49809a03 49809a03 Merge commit '20a631b4964fc0ab9137cce1e41774cbc17de044' 20a631b4 Squashed 'themes/gohugoioTheme/' changes from b8202f539..dafc91ff1 8b58f565 Re-generate CLI docs 4653a724 Add Netlify deployment badge 2d6246bc Remove some deprecated site variables e6777153 Improve Algolia Search Display Styling 1570999f Add missing "." in front of gitlab-ci.yaml example b922ae7d This adds documentation to the new configDir/Environment logic from .53 (#729) 7cff379f Correctly escape multi-word taxonomy terms in example 2dfeeda4 fix typo by removing stray paren 0870bd9a Fix typo in `paginate` description 91e8be85 Fixes https://github.com/gohugoio/hugo/issues/5609 c1db65ec Make the dummy URL more obvious b4589ff0 Fix a link b73dcb9a Consistently use "posts" as section name in examples 7a56abbc Format definitions a9c6fd9b Minor clarification over the last commit 5c86bdc8 Add alternative instructions for Quick Start for non-git users dafe7ee9 Add Visual Studio Code plug-ins 110ed19e Update HUGO_VERSION 2abd031a Update page.md b332f7b9 Update page.md f5a8c9d4 Update static-files.md 6d0c155c Add note about relative protocol URLs a13751ac Theme Warning: Remove note about unquoted URLs 4c8f7d68 Incorporate feedback 6f2b9cf0 Update Creating Themes Warning 40d88d98 Fix ToC example to use binary true/false 4a11f3f1 Fix typo 2dbfc0a4 Fix a typo in taxonomies d63790ef Do not mark UndocumentedFeature issues as stale d7aff095 Regenerate docs.json 71c0826f Update transform.Unmarshal.md git-subtree-dir: docs git-subtree-split: 49809a038b2691637bab7f3f2e385dde654a88b8
2019-02-01 08:01:04 +00:00
{{% note "Use the Hugo Generator Tag" %}}
We highly recommend using `.Hugo.Generator` in your website's `<head>`. `.Hugo.Generator` is included by default in all themes hosted on [themes.gohugo.io](http://themes.gohugo.io). The generator tag allows the Hugo team to track the usage and popularity of Hugo.
{{% /note %}}