mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 02:16:09 +00:00
Squashed 'docs/' changes from f3c88b08..b0470688
b0470688Use infinitive mood for titles96066d1bUpdate theme to fix JS error8d500e7dFix dead key typo in v0.25 release notes3f6bd838Add site image for Twitter card52adf3c9Fix union descriptionb1238c98Document Pages support in union and intersect14beb0ecAdd some more missing aliases2baad4b3Add missing functions aliasd3603ef9Adjust GetPage docadeca9f0Remove unused file4b0d3393Regenerate commands doc436f2a36Improve Netlify config94bf0abfRemove tags from menu2c257180Add production configb779fdc8Remove unused filesfac13f4fCopy edits variables92726cf0Copy edits themes and tools6a058168Templates copy edits8cdaa2b6Update theme61203de8Some minor edits of the getting started section43c935a8Copy editing of the template func documentation972f8ba2Update themeb9bdfd40Prefix methods with a "."4e0bca2bRemove the needsexamples construct4ac6e828Update content references to new gohugoio org646112a2More copy editsc6bf314dUpdate theme2d75e090Content fixef0564e2Update theme6994ef2cContent fix48c2b9f4Fix broken links94806d0cUpdate theme29ba55bfSome more copy edits2a657165Set unix func to draft90ba82b4Update theme183472a6Do some copy editing87db4be7Remove the tags config for now52deebf6next: Cleanup after the big merge6b07427fnext: Final step of merge45f33bf6Merge branch 'reword' of hugo-docs-concept into nextf00e68e7Add release notes for v0.20 - 0.25.186c3ac1bAdd fREW Schmidt's articles to newsa518ccb9Fix baseurlcea93ebeUpdate archetypes documentation for v0.24469e504cExplain use of disableKinds to remove default taxonomy73d616c5Remove category taxonomy from site config813a0cb0Add time to int example for time function58da4d9eClean up link formatting on lookup order page52aedacdAdd admonition note to getenv function9305be17Make minor tweaks to docs on generated dirs in Directory Structureed98ef4eUpdate dir structure and remove old YT video from Quick Start240f675fChange baseurl to empty string to fix CSS in dev URLa4400e8aRemove all temp landing page templating and contentaf940ab5Add temporary tax and terms templates for Announcement page5c383297Add temporary Hugodocs.info site migration page5004ef61Update output of "hugo help" on Basic Usage page6df80224Add CentOS to Install Hugo page2cef2175Tweak marketing "copy" for custom outputs on homepage featuresed40185eClean up language a bit around Configuring RSS entries0671aed5Add regenerated docs.json1b7044b2Add LICENSE file578d7978Release of v0.25.1e6c38585Merge branch 'tmp'e01df481releaser: Prepare repository for 0.25-DEV6f462739releaser: Add release notes to /docs for release of 0.25.191a4d55freleaser: Bump versions for release of 0.25.1d0ee1e45Add jonbeebe.net to the showcasea4b499fbAdd Hugo/Unix/Vim integration post to press sectionec4cae94Fix link for pull requests in press.mdc37ea39areleaser: Prepare repository for 0.26-DEVd89da99dreleaser: Add release notes to /docs for release of 0.252b11466ereleaser: Bump versions for release of 0.25a8096ce4docs: Regenerate the docs helpersd68eaeebdocs: Regenerate commands doc1c8fff5ddocs: Merge docs commit '37c69054e294bf554be03cf7e4c01e1f586e6943'2afe0747tpl/math: Add log functionab4e5da8Merge commit 'dd78d5b23fe597f4461aa4199401b4e07c0612e2' as 'docs'31393f60Remove the docs submoduleaff1ac32commands: Use example.com as homepage for new themeb463c5adreleaser: Remove trailing space in fixes list1a041522releaser: One more fix3aade089releaser: Improve docs submodule handling0e1bda34vendor: Fix +-timezones in TOML2e4ccd3dcreate: Preserve shortcodes in archetype templatesfd924d18commands: Create default archetype on new sitee908d955create: Fix archetype regression when no archetype file8b620f7adocs: Update12611e0cUpdate docs58ce9213releaser: Fix typo, change "relase" to "release"ae3039b6Update docs3554fd12releaser: Prepare repository for 0.25-DEV1ac4dbb9releaser: Update /docs to 0.24 [ci skip]8f69fe57releaser: Bump versions for release of 0.24f8c5716areleaser: Update /docs [ci skip]2ba9a876releaser: Add release notes draft for 0.24b7f8d057Add numfmt to functions list976c398fAdd numfmt to functions listc43b512boutput: Identify extension-less text types as text19f2e729Support non-md files as archetype files0f40e1famedia, hugolib: Support extension-less media types516e6c6dhugolib: Add disableAliases175eb008Take the first crack at some copy for custom output types176c35d4Update theme to include theme PR gohugoio/gohugoioTheme#373ac3539fFix typo on output formats3183b9a2parser: Fix handling of quoted brackets in JSON front matter1a282ee4vendor: Update Viperfb53987ahugolib: Fix error handling for JSON front matter6e3bd702Update theme to reflect NAV changes662e12f3commands, create: Add .Site to the archetype templates422057f6create: Use archetype template as-is as a Go templateacd7ffdfconfig.toml: Update links for GH org and forum4aa12390Update links to new discuss URLd78c5b4dReplace all instances of discuss.gohugo.io with new discourse.gohugo.io URLe731a7aaFix heading typo for Windows 10 users in install instructions4231fd69Update all relevant instances of spf13 to gohugoio in install instructions411ac930vendor: Update deps4345026breleaser: Add TODOdeffb4c3releaser: Prepare repository for 0.24-DEV12b844dareleaser: Update /docs to 0.23 [ci skip]b502b9d8releaser: Bump versions for release of 0.23781a1539releaser: Update /docs [ci skip]af85eb62releaser: Adjust882b2b61releaser: Add release notes draft for 0.2300e2fe07releaser: Adapt release logic to docs submoduled4e8ea3eMove the theme to the new org481850c9Add STOQE's tweet186eacbeUpdate tweets through mid-Juneccb8300dUpdate logo link in README214dbdfbRemove docs building from CI builds729be807commands: Adjust docs path6cee0dfeAdd docs as submodule8be3934bdocs: Removefbb25014Update Gitter link in READMEbf5e5995vendor: Update to new org name86543d6aChange Windows build badge link, take #33b47805fChange Windows build badge link, take #2e6ae32a0Update Windows build link5103935ahugolib: Disable shaky leaktest on CI95386544Update links in CONTRIBUTING.md due to the org transition7b99fb9fUpdate source path in Dockerfile due to the org transitiond531d17bUpdate clone folder in appveyor.yml due to the org transition9266bf9dUpdate import path in snapcraft.yaml due to the org transition873a6f18Run gofmt to get imports in line vs gohugoio/hugof503d76aUpdate Makefile vs gohugoio/hugo93643860Update README to point to gohugoio/hugodb46bcf8examples: Update examples to point to gohugoio/hugo66d4850bdocs: Update layout references to gohugoio/hugo715ff1f8docs: Update content references to gohugoio/hugoc17ad675all: Update textual references in Go source to point to gohugoio/hugod8717cd4all: Update import paths to gohugoio/hugo2d08a296vendor: Improve GitInfoa9e551a1Fix handling of duplicate footnotes2aafb247Revert "releaser: Bump versions for release of 0.22.1"4bd5ce7ereleaser: Prepare repository for 0.23-DEV0f78dd06releaser: Prepare repository for 0.22.1-DEV714594a8releaser: Add relase notes to /docs for release of 0.22.1dce70fb7releaser: Bump versions for release of 0.22.1c84079bareleaser: Add release notes draft for 0.22.1a30023f5hugolib: Fix section logic for root folders with subfolders1f26420dhugolib: Support sub-sections in permalink settingsff54b6bdcommands: Adjust rlimit to 64000629e1439commands: Make error on setting rlimit a warning only26aa06a3Revert "commands: Remove the rlimit tweaking on macOS"52a0cea6docs: Add note on updates for rpm-based distros8ca586a6releaser: Prepare repository for 0.23-DEVe797a94dreleaser: Add relase notes to /docs for release of 0.2221cf464creleaser: Bump versions for release of 0.22fb5cac70releaser: Spelling63311a14releaser: Add release notes draft for release of 0.220f8f5141docs: Rewrite “Archetypes” article8744e6d0Add noindex to alias explanation39408925docs: change .Site to $.Site where the global context is masked by the term's context208d1646Add additional reference to layout front mattere47b74d8Add information about layout front matter variable00d63215docs: Use single link element for RSS in examplef1da5a15hugolib: Make the RSS feed use the date for the node it representsd5ab7f08Add noindex tag to HTML generated by Hugo Aliases55dd533bhugolib: Unexport some internal methodsb82cd82ftpl/collections: Add uint support to In204c3a9etpl/collections: Support interfaces in unionfe901b81hugolib, commands: Improve live-reload on directory structure changesb3968939hugolib: Enable nested sectionsbef50485Revert "hugolib: Fix live-reload regression for add/removal of dirs"49a10430hugolib: Fix live-reload regression for add/removal of dirs5be04486hugolib: Fix disablePathToLower regression1f55cb76hugolib: Simplify some test loops8aaec644hugolib: Add test for no 404 in sitemap55c53ae9docs: Add thislittleduck.com to the showcase44e6279dMove archetypes from Bud's theme to project dird05edb0fMove all shortcodes out of theme and into project dir5ba50897Add more tweets9ccb82faAdd functions file for uniqe28d9aa4tpl: Add uniq function92bb618cAdd new tweets through June 39412e0b0Remove Duoshuo from list of commenting services46b46078hugolib: Remove some superflous TODO comments2c2ce33aparser: Add horizontal YAML tags to benchmarkadc0572ddocs: Add Nutspubcrawl.com to the showcase0907a5c1all: Temporarily revert to BurntSushi for TOML front matter handling3d9c4f51parser: Add BenchmarkFrontmatterTags250ebc1dhugolib: Add some more tags to benchmarkb37d9594hugolib: Bump leaktest timeout to 30 seconds4e00bb7fWrite CPU and mem profiles from site benchmark scriptfdcfccedhugolib: Fix tag calculation in benchmark test4d0b6653Fix typo on Hawksworth's tweet for homepagebdacc320Move tweet data file to project dir from themec940f08fRemove duplicate custom output pages59c1bdc5Move custom outputs from CM to templates section0e363fe7Remove theme-showcase.md => removing from global nav as well213ea749hugolib: Add number of tags as a benchmark know08a10e5dhubolib: Make the site benchmark output more compactd83c53a8Replace "Github" with "GitHub"9fa71c94hubolib: Add 10k pages as a benchmark variantd25d89e6hugolib: Increase leaktest timeout89697019hugolib: Break early from sitemap disabled check69d92dc4hugolib: Respect disableKinds=["sitemap"]d74452cfAdd benchSite.sh978951cfvendor: Update go-toml00ea027eClean up shortcode description on homepage and remove extra "to"f96df8f2Remove outdated developer toolsf2ede42aMake minor tweaks to home page and news layout4aff2b6esource: Cache language config2342df4dhugolib: Add TOML/YAML switch to benchmark828427efhugolib: Adjust timeout for leaktestce624cc7hugolib: Add slightly more realistic tag distribution to benchmark8930e259hugolib: Add site building benchmarks8c53afdbMove assets used in content files into images/ subfolder0d9ce481Add _headers file for cross-origin issues with SVGsfede945dAdd home page to hugoDocsf4c1efc6Make assets used in content files theme independent710300cbdocs: Update overview/usage93cab620Update snapcraft.yamlb68758a9Update _index.md to show more intuitive link titles7fd64f19Merge bp/theme-design branch containing Bud Parr's new design19de4476hubolib: Remove the regular page restriction from .Site.GetPage37e37877docs: Fix parameter name in YouTube shortcode sectionb5b41c44hugolib: Refine allKindsInPagesbde807bdtravis: Update Go versions612f6e3ahugolib: Fix ref/relref issue with duplicate base filenames50d11138hugolib: Add a cache to GetPagee0c2e798hugolib: Support regular pages in .Site.GetPage87203139cache: Add a simple partitioned lazy cacheccf1fcb0Remove single.html references from homepage templatea91c2705docs: Add furqansoftware.com to the showcase99412bfedocs: Delete `brew update` from docsf4d9612eUpdate console message in sample code for brew installation2e693d1eRemove "brew update" from install page801ab9f5Remove "brew update" from install page421a4694cmd: Replace flagChanged with pflag.FlagSet.Changed0a40cb43docs: Add tutswiki.com to the showcased460159adocs: Regenerate commands docs8b49c3a1hugolib: Enable leaktestbcd32f10commands: Remove the rlimit tweaking on macOS62fe640dvendor: Update libsfbb78b89hugolib: Speed up GetPage6c560288hugolib: Add BenchmarkGetPage89b85aedreleaser: Disable flaky test4113693atpl/cast: Handle template.HTML and friends in ToIntf41f7282Remove Unmaintaned Frontends from Tools.8ddc7a5creleaser: Prepare repository for 0.22-DEVf63ee656releaser: Add relase notes to /docs for release of 0.211a965e5dreleaser: Bump versions for release of 0.21baa414aereleaser: Add a new stepcdf32f08releaser: Update ldflags98e333b3vendor: Update golang.org/x/sys/unixa0096213releaser: Add release notes draft for 0.21a119ef69tpl/time: Re-add the time example1f9e8dcctpl: Make the Namespace func signature explicitebd636e4releaser: Delay the version bumping4d1989d5releaser: Fix tag detection for changelog when doing a main releasea59525b0tpl/time: Remove asTime template func mapping3954160atpl/time: Support overlapping namespace and template func93c5774dtpl/collections: Make IsSet WARNING less chatty77d2fe78docs: Add ttsreader.com to the showcase405c2f68tpl/images: Fix error handling in Config00945628Remove showcase58d4c25etpl/collections: Use Feedback log instead of Error in IsSet38661c17tpl/collections: Log an error on unsupported types in IsSet42fbded1docs: Regenerate docs helper10287263output: Fix output format mixup in example27e88154docs: Fix incorrect path in templates/listf1c29b01tpl/collections: Add support for interfaces to intersect93b3b138tpl/lang: Add NumFmt functione92ce83ddocs: Update references to JSON4c427f6adocs: Fix minor grammar issue in shortcodes.mde682fcc6hugolib: Fix RSSLink vs RSS Output Formatb6ea492btmplimpl: Add support for ellipsed paginator6e2f2dd8hugolib: Fix output formats override when no outputs definition givenac57a388Add more 2017 tweets for homepage765fd441Remove GH buttons to test performance changeef8ed989Add back CRP for speed tests94b5be67commands: Skip .git directoriesc7646551Dockerfile: Remove ENTRYPOINTaf72db80hugolib: Handle shortcode per output formate951d657hugolib: Handle any errors in processShortcodes2bcbf104hugolib: Prepare render per output format1e4d082chubolib: Refactor site rendering with an "output format context"1d70aa98docs: Add carnivorousplants.co.uk to the showcase6fc7337adocs: Add worldtowriters.com to the showcaseddaf6941docs: Add ocul.on.ca/topomaps to the showcasea28fbca6docs: Fixed incorrect specification of directory structure544f0a63hugolib: The deprecated Extension, Now and TargetPath will now ERROR5794a265commands, hugolib: Deprecate disable404, disableRSS, disableSitemap, disableRobotsTXT5d6d5221Add anchor titles to all links on partial templates pagec022b4bbAdd more links to partial templates pageebf677a5hubolib: Embed Page in WeightedPage58d9cbd3hugolib: Improve shortcode error message7d399904helpers: Don't clean the path before Join9b202862commands: Use paths from PathSpec for walkerc9976155docs: Fix bash command in tutorials/github-pages-blog9b5fac0bFix menu for "What is Hugo" page9b080dc6helpers: Don't clean path twice231c0a7edocs: Fix typo in templates/functions.md5575ed44docs: Update datafiles.md42f4ce15hugolib: Add default config for ignoreFiles14555f13Fix broken link on templates/introduction pagecff2f313tpl: Add some GoDoc info to template func docsf9e41f64releaser: Push the tag before goreleaser is run8f2ab5f4i18n: Simplify code for detecting of untranslated idcce49997i18n: Add tests3dd949d9tpl/urls: Make urlize return a stringa40d1f6ei18n: Improve the detection of untranslated string9c17fcb4Update slug translation in multilingual.md635b3bb4docs: Add documentation on slug translation08c0de5ctpl/data: Clean up data namespace1cf2f3dctpl/data: Move cache logic to separate file5f095c27tpl/data: Shorten some internal func namesf604076dtpl/images: Fix embedded sync.Mutexf69df916tpl: Add basic tests for all namespace init funcs690b0f8ftpl: Add docshelper for template funcse2b067f0tpl/partials: Remouve unused method0e226042tpl: Fix the remaining template funcs namespace issues4714085atpl/urls: Make it a package that stands on its own55f90a3atpl/transform: Make it a package that stands on its ownee5aa84ftpl/time: Make it a package that stands on its own4a346346tpl/safe: Make it a package that stands on its ownb958c0c1tpl/os: Make it a package that stands on its ownfc77b630tpl/inflect: Make it a package that stands on its owna432c90atpl/images: Make it a package that stands on its own9aee8acetpl/encoding: Make it a package that stands on its own744dccbetpl/crypto: Make it a package that stands on its own8a49c0b3tpl/collections: Make it a package that stands on its owna3bf118etpl/compare: Make it a package that stands on its own65615573tpl/data: Make it a package that stands on its own0ab23eb5tpl/strings: Make it a package that stands on its owneefa0703tpl/math: Make it a package that stands on its ownc5373efctpl: Add TemplateFuncsNamespaceRegistry8f95172creleaser: Disable shaky testf4857661Add txtpen to the Commenting Alternatives section906ad232Change temporarily ghdocsrepo field in site configc616ade9Add logic and operators tags to where.md for better discoverability044b2389Add regex101.com reference to both RE functionsc2a5952fAdd regex101.com reference to both RE functions8b94418eAdd link to regex101.com for replace/find RE71471f13Remove opinionated code blocks (Third round)bc9a6491Clean up code block for ids and classes (Second round)e4336f06Fix minor typos in "where" function page8e151a93Clean up all list templating samplesabe797c9Clean up code block (First round)4b637ac0docs: Replace cdn.mathjax.org with cdnjs.cloudflare.comb6dc570cUpdate MathJax official CDN and respective code blockde7c32a1tpl: Add template function namespaces154e18ddRender 404 in default language only565a78b1netlify: Add some security headers355736eclivereload: Fix data race in close86f36c38Comment out path frontM override in cm-organization page temporarily93a447c5docs: Fix typoseaf75a18vendor: Update cobra and pflag8d0917afhubolib: Narrow a test assertion718c0e14releaser: Fix broken test buildd6957c19releaser: Skip Git test on Travisa695202frelease: Add relase notes for 0.20.6fea4fd86hugolib: Avoid index.md in /index/index.html656f8188docs: Regenerate commands docsf0f69d03commands: Make first letter of flags' usage lowercase8fbec599vendor: Update cobra and pflagd163576cAdd blank content file for new numFormat functione55399f5releaser: Fix some of the fpm fields for deb5ad2f176hugolib: Make missing GitInfo a WARNING202fa954Update custom output formats description to mention extensiblity0c435aaaUpdate description for output formats162d3a58docs: Add notes about some output format behaviourfd5109b6releaser: Fix ldflags setting88d81110docs: Remove temp release notes4ac60e4cdocs: Add relase notes for 0.20.5b332d93edocs: Add a time to 0.20.4 release docsb096a10freleaser: Add relase notes for release of 0.20.424be139cAdd -linkmode external3e0f1ad7Set extldflags to static when building0bd0593areleaser: Add relase notes to /docs for release of 0.20.3c6e4aff1release: Adjust release notes for 0.20.3c0f491abreleaser: Add relase notes draft for release of 0.20.367746f36releaser: Fix a Go vet complaint7f6430d8Automate the Hugo release process0e87b18bhugolib: Fix handling of zero-length filese98f885bhugolib: Prevent decoding pageParam in common cases6498d73chelpers: Delete RenderingContext.getConfigb5b6e81chugolib: Ignore non-source files on partial rebuild90d3fbf1tplimpl: Add translation links to the default sitemap template5f3ad1c3commands: Import Octopress image tag in Jekyll importer8cd3ea56Fix check-vendor logic in Makefile9c72fa36Move lookup order section within lookup order page8fb94fa4Add note on Golang regexp library to findRE and replaceRE funcs6aaf47beRemove the pesky .DS_store from the site and improve .gitignore1b867649Correct typo in cm-types pagee63c2fb1Remove extra parentheses in GetPage function example21ebf481Remove extra parentheses in GetPage function exampled3041306Clean up links in RSS templates79355410Remove check-vendor from make checkd6818f23vendor: Fix go-toml592e055fAdd check-vendor target to Makefilee97837f6Fix typo in Format function4a2148e2Clean up list ordering and grouping; add ref to Format funcc67f09b2Update signature for len function999ba8d4Add len to functions list with examples246bb068Fix heading structure for newest releases6cba8ff7Fix minor typos in Release Notes2d1854f7Add 20+ Release Notesb1ce0d98Fix .Date.Pages typos across the boardf7fae4b1Fix .Date.Pages typos across the boardab692e73hugolib: Log WARNING only on unknown /data files7cdc244adocs: Add txtpen as alternative commenting serviceed0c3ec4Fix .Data.Pages range in sampleb5e32eb6docs: Fix .Data.Pages range in sample66ec6305docs: Add 0.20.2 release notes1cf29200tplimpl: Allow text partials in HTML templatesfcca2cadClean up single page and list template explanations further318a75ecUpdate homepage terminal to govendor install instructions74da85edFix small typographical errors in shortcode templating paged557ca80Explain use of .Params in shortcode templating807f4519Make small typographical tweaks to homepage template8f70189aFix typographical errors in lists.mde8457556Beef up explanation of _index.md in homepage content452bd58aAdd admonition note to GitHub hosting9ed90b70Add more in-page references to date-related page vars0fff8177Propose archetype usage for summary divider in content-management/summaries.md8aaa5e17Fix typo in content-management/types.md26f87754Fix broken link in toc.md to page variablesc5e2fa22Fix link in cm-cross references83fba815Fix links in content-management/front-matter.md8ccee671vendor: Update dependencies86a97dbddocs: Add Netlify badge if on Netlify5e2e62d9Get versions back to 0.20-DEV8ac1fcd0Prepare release 0.20.10ed3beecdocs: Add 0.20.1 release notes077005e5output: Fix base theme vs project base template logicefc0e05cdocs: Add sanjay-saxena.github.io to the showcaseab7f43e1Update math function page to include "add" usage with strings6d2ea0f7hugolib, output: Do not lower case template names45c74526hugolib: Must recreate Paginator on live-reloade765b43ehugolib: Avoid recreating the Paginator on copy3b677594hugolib: Avoid processing the same notify event twiceda022418Remove unnecessary keys from config file81fa0a45Adjust all metadata partials to use absURL and relURL7ee73ffdUpdate scripts to use absURL func5fad8a9dsnapcraft: Go 1.8.19a1c3f42Add CLI Overviewaa0c2bd6Add Emacs Easy Hugo to "other tools" page26777720Fix env var description in configuration.md24ae7df1Add mention of output format configuration to configuration.md0b51849dRemove wip badge from output formats page08ff6f61Do a small language cleanup for output formats page33db4143Update custom outputs title and aliases6652cb8bMove custom outputs to templating section9ec00725hugolib: Final fix of rssURI deprecationcfd3af8ehugolib: Only show rssUri deprecation WARNING if it is actually set4c6fec56all Bump to 0.21-DEVdac0d4a6all: Prepare Hugo 0.20 release version03ec2b33docs: AddHugo 0.20 Release Notes2ea0e17bUpdate incorrect titles in example front matter18f5f3c1docs: Add Emacs plugin easy-hugo308678aadocs: Add siba.ai to the showcaseb50796e3Add siba.ai to showcasee73a35dehugolib: Remove unused linec9731b2chugolib: Delay deletion of Page.Now()9ebbf1b0docs: Add docs about output format linking2874fc75hugolib, output: Add NotAlternative to OutputFormat9e69a92ehugolib: Deprecate rssURI31014f0aFix typos in yt shortcode descriptionf80b90b9Add back CRP9f1c72eeFix typo for code block on templates introduction0902a1c0Make toc font size less obnoxiously large8f60e9acUpdate single page template examplebd40c73fAdd datatable shortcodes and custom outputs draftf9df1ed6Change datatable shortcode to articlelistshortcode9a8b65d8travis: Go 1.8.17b2e1b0bhubolib: Do not add missing trailing slash to command line baseURL3ce3917eRemove mention of v0.20 in Getting Startedaa5fddd5Change width and height of search icon in SVG dimensions1b638005Fix links in content-management/front-matter.mdc05526d6Remove "Using Hugo's Server in Production" section0b4c1af0Add some improvements to getting-started/usage.md63034b10Keep names of content formats more consistent39f1401bKeep the name of content formats more consistent2e639d95Make a small casing fix on installing pagee975a07fUpdate press.md2329545aFavor HTTPS and use ref.-style links more consistently7ad721fdhugolib: Add .Site.Params.mainSections5714531fhugolib: Only do link transforms etc. on HTML type of pages3c405f51all: Document the Output Formats feature95808724hugolib: Update deprecation vs Hugo 0.20af99a590output: Add some sane defaults for output format83dcf5f3Add SiteGetPage example to taxonomy templates45bf976bAdd Li-Wen Yip press additions to articles data file7ad5d51eUpdate lastmod for single page templatesc7816c5bUpdate single page examples to use more recent Hugo features7d60b1a5Update mixed param type error for shortcodesabe58bf5Remove more wordiness from shortcode parameter type intro text7ad76bfaMake yet another typo fix in shortcode templates2e981048Clean up shortcode templates74d331baChange to Template Lookup Order for temp-lookup linktitle78164269Fix heading typo in cm shortcodes56d459d6Fix heading in cm-shortcodes3375fc2bFix heading in cm-shortcodes260b55eatpl: Set RenderingContext.Config in markdownify8f09e5f6helpers: Add new properties to ContentSpecc4a11655all: Handle all errors35fffad1Update content-management/multilingual to reflect new TOML supportbf2d2bbeFix typo: "KaTex" → "KaTeX"e77bb13cmedia, output: Fix spellinge6e1aca3docs: Disable GitInfo by defaultf3b4a0e9docs: Add info about Pygments installation in installing.md0dd6890edocs: Add article by Li-Wen Yip to press section119182aaAdd sections_weight to all content filesce428a9cUpdate trim description with note on whitespacefe78595cAdd emphasis to trim function explanation6650fae7tpl: Fix nil pointer in Tree()f4b12935Fix typos in syntax highlighting docs6b7c8497Update trim explanation per gohugoio/hugo#3279b31da911docs: Properly capitalize GitHub4b1dfc1dUpdate govendor instructions in source install14255871hugolib: Add optional outputFormat to Ref/RelRefa883948cRegister all media types when in server modebc36d468tplimpl: Reintroduce the double template lookup in Partial7da1b659all: Use the configured output types to resolve template type868f89d5hugolib: Improve render error handling04d80e6ecommands, helpers: Add correct verbose log level to the global loggers0802f79eoutput: Make template name lower cased10ff2f31hugolib: Read media types and output formats from site configf8d555ccmedia: Add DecodeTypesc9aee467output: Add output formats decoderd6e8b86foutput: Add CSV to the global output formats list2cf2b483Add language-hugo Atom plugin to dev-tools editorsdba7e38aAdd embedded SVGs example to dict functionaf3230aaFix typos and add explanation on configuration.md77647be7Expand static dir explanation in dir structurea098081cvendor: Update go-i18n5d7eeeaddocs: Remove localhost part from link8b5b558btpl: Rework to handle both text and HTML templates53eee8a4Update Mmark info to show ease of use with MathJax and KaTeXb3819aa0Add esaezgil.com to showcase27610dddhugolib: Don't ignore errors from applyDepsIfNeeded6b29bccfhugolib, i18n: Update tests with flat format and TOML files28fdd71cvendor: Update go-i18nfe8462b2docs, examples: Use TOML for i18n config filesd122260dvendor: update goorgeousa037b855docs: Add blog of Enrique Saez Gil to the site showcase7eb71ee0Revert "tpl: Rework to handle both text and HTML templates"c97dae40hugolib: Use Page Kind in template errors to prevent log spam0aeadfd0tplimpl: Add test with failing partial5c5efa03tpl: Rework to handle both text and HTML templates631833e9Add missing comma in Supported Content Formats page561edc0cAdd fm-specific Mmark syntax per bep suggestion8d65b360Add fm-specific Mmark syntax per bep suggestion484bbd1eAdd fm-specific Mmark syntax per bep suggestion3d7960e1Fix typos in Mmark section in content formats969178b6Fix typos in Mmark section in content formats5a59b0fdAdd Mmark section to content formatse491b309Add Mmark section to content formats73c1c7b6vendor: Update cobra67076e58Add example to "now" functionf911b107media, output: Add CSV type and formatab07457eUpdate with temp GA coded1709df3Fix broken link at the bottom of shortcodes.md904eaa8dFix incorrect syntax decl in cm-shortcodes7e3805b5Fix odd formatting in cross-references45aad24eAdd note on Mmark with MathJax to formats docd98cfe10Update nginx config in 404 templatesfb94d4c9Fix terms template lookup order4d27a27bUpdate broken links in customizing themesbf4015d6Fix typos in vimeo sc description001cd27cClarify custom class to yt and vimeo shortcodes0c770e40Add warning to isset function for lowercase site config keysa649a7aeAdd firstname.club to showcase763dd22cRemove how-to-use docs-paged2829694Fix inconsistencies in FM categories530002e6Update GitHub deployd7d5771aUpdate gh deploy68969470Update content to use Hugo's built-in menu05949c90docs: Fix typo/source link in firstname.club showcase additiond5036c3adocs: Update link to Disqus alternative Livefyre.comaf1f9ecfdocs: Add firstname.club to the showcase42a4f6f9tplimpl: Fix map data race in URLLock79b34c2ftplimpl: Fix deadlock in getJSONde558c3eRemove Livefyre from commenting optionsa05fbce1Remove unnecessary pre 2.4 git docs from GH hosting instructions5758a6d6Update GitHub pages hostingb286c7d9Remove intelligent posts - stale issue - from roadmape1645544Update taxonomy templates3c6b16d5vendor: Update fsnotify with several Linux-fixes87b3cd46hugolib, helpers: Reduce log level to WARN on .Render for non-regular pages8b06205aAdd "tip" shortcode and documentation5989c4d4helpers, output: Fix spellingaf55ec76hugolib, output: Gofmt70080e3dMerge pull request rdwatters/hugo-docs-concept#57 from moorereason/iss31f2fbf0b2media: Add some more relevant MIME typesda717759Add function signatures3d6d55d6Remove concept documentation for time beingc698a77dFix breaking yaml in delimit functiond688bd98Add alias for old MathJax tutorial7a1f9a6aUpdate signature fieldsdbbbd498Add MathJax to supported formats1989c17eAdd old MathJax content to content formats page0819a044Add intro text to hosting and deployment8366049aAdd intro text to hosting and deploymentf514681dRemove all tutorial-related content from install guidedb09419dUpdate readme todos and clarifying readFile w themes0a6bc386Fix broken link in list page templates9c652071Fix broken link in list page templates109a6a59Move list and homepage content to list templates pagee6511dffRemove findRE TOC example49232736tplimpl: Fix lookup with non-standard layout folder930a3df1hugolib, output: Restrict Render to regular Pagese49a2b83hugolib: Fix Render layouts for list pages9a0aa5fdhugolib: Wrap pageOutput create in sync.Once0aaf3c56hugolib: Fix panic for Permalink in 404 etc. templatesee4a33b1commands: Fix broken commandeer09c88e84output: Rename HTMLType etc. to HTMLFormat24c17702hugolib: Revise paginator alias path handlingb7ed67d4hugolib: More TODO fixes3cd97951hugolib, layout: Consolidate RSS template handlingee75e299Remove the now superflous defaultExtension15b64d51all: Propagate baseURL error to the callers148fedd2hugolib, tplimpl: Use OutputFormats to create atom linksec01c3a7hugolib: Add 404 test5761b93chugolib, output: Fix RSSLink vs output formats87188496hugolib, output: Handle aliases for all HTML formats0c4701f0hugolib: Update site stats to take output formats into accountd851d6b9Add custom protocol support in Permalink8bcc08e3media, output: Add Calendar typedbb83f92hugolib: Read default output formats from site config4aaed87dhugolib, media: Make the MediaType available to the templatesc7dbee23hugolib, output: Add Rel to the output format29d3778bdocs: Move the rough custom output formats spec to docs1b2be5e8hugolib: Add OutputFormats with permalinks to Pagebaa29f65output: Rework the base template logicc7c6b47bhubolib: Pick layout per output format08fa2b11hugolib: Fix layout lookup order for Render func6178238aoutput: Speed up layout calculationsdf953839hugolib: Speed up URL handlinga49bf870hugolib: Remove siteWriterd76e5f36hugolib: Pull all alias handling into one filead8cea87Refactor layout resolve to a descriptor/adapter pattern4c2abe00Rename OutputType to OutputFormat6bf010fehugolib: Refactor/-work the permalink/target path logicc8fff950Implement the first generic JSON output testcase3ec5fc35hugolib, output: Incorporate suffix and type in layout resolvef091fc23hugolib: Add basic setup for output def per Kind03122e51hugolib: Revert to using Page as the render chan typee5200ddahugolib: Remove the copying in the renderRSSa8244658hugolib: Put back taxonomy term paginator logic lost in rebase50c64415hugolib, output: Add theme logic to LayoutHandler348834d0hugolib: Add a PageOutput wrapper for rendering254cd89chugolob: A first incorporation of output types in rendering10de0771hugolib: Use the new layout logic in Page3bb52bf7output: Move layout logic to the output packaged3d2c63doutput: Add output typec4989c39Add MediaType and a crude implementation047e039bMake docsearch config async and defer0d5146a8Tweak content9262c5b3Exit -1 on ERROR in non-global loggere0cfe258Add first round of custom output content2bea9d0cRevert "tplimpl: return an error on unsupported type in isSet"850a08a4Move all files to theme0796957dFix paths to indicate theme path and leave a note about it1b92c8b7Change RSS description from full .Content to .Summary50c24e07Move to theme folder2ac2fa93Remove extraneous config key-values in config.toml (continued)b14b6596Add Hugo SFTP Upload tool to dev tools1517384bRemove more extraneous config.toml valuesa479cb13Update all uses of readfile SC to use root path17b21e0ahugolib: Correctly identify "my_index_page.md"02501129Update GH pages tutorial55407e34Merge pull request rdwatters/hugo-docs-concept#52 from digitalcraftsman/gaa3f46c9dResolve config conflict for taxonomies8cfea6b1Update config GA847d3d4fRemove extraneous values from config.toml per convo with BP043b4e49Fix Hosting on GitHub tutorial22351f4aSwitch to Hugo's internal GA variable7f68e319snapcraft: Bump version to 0.20-DEV2ed75f34snapcraft: Add vendoring support767ea0a0Update to muli font across the board32fc7534Mix font faces56c61466Test out serif font on body copy0381c06dRemove outdated warning about imageConfig not working9d9ec1dddocs: Add Hugo SFTP Upload to the tools section9f0b02b8commands: Fix case of createpath in new.goa159feffcreate: Delete redundant viper calls30b43476Add GitHub starsb5c13109Make more color changes per Bud's suggestions0c0ec81dMake more color changes per Bud's suggestions8b5e4d73Update footer color to match news site01a296ddAdd navigation design changes per Bud's suggestions2dab2351Test adding events to codeblocksbc055d0aFix typos on after function pagefc826d5fUpdate after function with combo example683011a6Fix typos on summaries page09aed316Add admonition note for CJKLanguages and Hugo summaries8bfc8828Fix odd font sizing for coded07ff9d2docs: Remove dead links, consistent formatting...c830861eAdd example usage to seq functionf1b1df50docs: Fix typo in templates/functions.md (#3214)36bbadecAdd final copy for directory structureb8cfe226Improve Netlify copy to reflect Netlify design blog77b26b71Improve Netlify copy to reflect Netlify design blogce78b00fFix search colors on homepage replacing with SVG73ede162Fix breadcrumb to take full section namefdd20af5Fix typos559b4007commands: Keep "." directories on cleanDestinationDir5e191ccfdocs: Add bharathpalavalli.com to the showcase6411cbf9Fix site nav toggle on mobileddaebc4eFix homepage search colorse5e175c7Remove test page for yt shortcode4d8532abTry out dark header per bp mockup4df25162Fix capitalization consistency for markdown term20bf194fFix homepage SVG logo1cbccec3Add back embedded crp in site header, perf testb56a888eAlign tags to the left in article headerff9d4635Switch header logo to img - too big for CRPf43481f2Fix heart icon on homepaged359d63aAdd back CRP and switching header logo to embedded svg08738d38Add back CRP and switching header logo to embedded svgd1ab36a4Merge pull request rdwatters/hugo-docs-concept#48 from sethmacleod/patch-115317f21Fix typod3cd68e6parser: Improve TOML frontmatter parser performancef816f2bdAdd updated Netlify tutorial68f4cd82Removing .Site.Recente3f79885Update site.recent closes #46ff2931c6Remove all bloat from video sass partial594a9691Add yt shortcode3fa7bc9cRevert "Add support for a flatter and simpler language file structure"3518de10Revert "vendor: Fix broken i18m definition"7c48ad57vendor: Fix broken i18m definition0e75f6e7Add support for a flatter and simpler language file structure68368bb0Tweak env var config content6eddb3e5Revert "helpers: Add a Debug method to DistinctLogger"d134b397Remove editor from config docs9e2b548bFix URL for emoji cheat sheet95597b8aFix URL for emoji cheat sheet50d95b94Add emoji instructions to supported formats in cm917e26a8Add tibobeijen-nl to showcasef74d9c81Add tibobeijen-nl to showcase5e6bbd69Fix typos6e03c96adocs: Add tibobeijen.nl to site showcase190dcb59Improve admonition semantics1ca6a276Add ns field to all func files8c611c13Remove unnecessary comments from header and baseof4382a8a6helpers: Add a Debug method to DistinctLogger9dfb9c14Case insensitive translation of the 'more' tag when importing from Jekyllc2ffdfabdocs: Fix documentation of non-existent 'editor' config2390c000Add back CRPfa1c7d1fUpdate shortcode templating09d0120dUpdate to use muli as font51e42a3aAdd parent to shortcode docsfbc35a84Add parent to shortcode docsa9966103docs: Change OS X to macOS in README and CONTRIBUTING491d4068docs: Fix CONTRIBUTING.mde4c59bf0Merge pull request #35 from rac2030/firebase10b05a8fMerge branch 'master' into firebaseab5cf356Make small tweaks to language used in "Hosting on Firebase"d8923eb6Update to new go-toml API09384837Get rid of extraneous icons on homepage2f02dfa7Add some 🔥 ❤️️5ee2949bRemove gratuitous notes markdownc94abaffFix SVG on homepaged6093abadocs: Update contributing guides770b9ac7Fix JSON front matter expl per gohugoio/hugo@ede452db64f808eUpdate license page to include download1849c7e9Add Red Hat and Fedora to installing.md0fe6d98bUpdate OSX to macOS across the board closes #337071026dAdd IE=Edge to meta to fix broken SVGs on IE11b87eed3eFix overflow issues with HP in IE11110f3086Fix more IE11 homepage layout issues78cc9e20Fix more flexbug issues for IE111b6431e1Remove extra scroll bar in tocb0c3f566Make more typographical fixes to the front matter pageaeda2337Add generator tag and fix typos in front matter page638cc806docs: Optimize 11 showcase thumbnail imagesec3dc325docs: Add Linux distro-specific installation instructionsb156ef27docs: Note Hugo as Snap package can write only inside $HOME042f8fcadocs: Replace Mac OS X with macOS in three placesc126c941Remove commented-out front matter vars6af744c2Add missing page vars and predefined FM vars2f1140cbMove articles to toml file in site data (continued)902d336bMove articles to data file called in datatable shortcode2704a4ceUpdate installation instruction on Linux distros431d5974docs: Add lucumt.info to showcaseb8666826Update toc documentation with more advanced example - inspired by forum discussiona4eb1e0fUpdate content source tree for spf review903e43f1Update content source tree for spf reviewa9bfec6dUpdate concept docs for spf13 reviewede452d3parser: Accept JSON frontmatter without leading "{\n"bae5d8a7Fix typosa1c8d046Add GH milestones to roadmap, and update Snap/Ubuntu in installing.md62efcdfecommands: Improve jekyll import date format4b9493cbdocs: Improve command reference page48eaf43cFix typosb1b4c07aRemove wip badge from multiple template filesb414d7d2Combine ordering grouping lists with lists introduction page8187b315Change all heading links to copy-links44c97f91Change to locally hosted blazy.js3c50e8ddMake final changes to complete final schema.org partial4dbb2301Fix odd ordering in functions section032982a6Fix date formatting in JSON-LD for schema.org20bfa632Commit first draft of schema.org structured databec843deFix broken links (final round)fbee443cFix many more broken links, and fix TOC scroll on L-d97c7778Fix broken links (first round)0e0abb17Fix weights for ordering of hosting and deployment section201c999aUpdate other vars to individual pagesc315f532Fix broken URLs for tags pagesa4f76cfcRemove Tutorials sectiona5a7e873Add js icon to code blocks and fix prev/next icons in content footer5d0748cetpl: Add union template funcfb25d255Update content filenames for all vars section; updated authors draft in cont mgm559e73b9Add Netlify hosting and deploy tutorial4d187661Add chocolatey install83fd79c4Add first draft of content-management authors pageb0eddb63Add build issues empty page5c69a21dAdd TOC to format function63e2a46fdocs: Add Android to README2f2ea42chugolib: Fix reloading corner cases for shortcodes5f443bd4commands: t.Error => t.Errorfe472140dUpdate for crp before forums releasef039e3beparser: Refactor frontmatter parser and add tests6f3a6efdShorten text on homepage; update ordering lists page9c03693dUpdate types contentbca33c38Remove unnecessary content in type2779a288Add host-specific icons to source links in showcase14ddd029Add host-specific icons to source links in showcase4c51ebf8Merge lazy-loading from digitalcraftsman0f7ce22cMerge pull request rdwatters/hugo-docs-concept#12 from digitalcraftsman/lazyddc8cc00hugolib: Clean up redundant frontmatter error logging2a011b7cAdd admonition note for Snap users in install docs0e44f75edocs: Explain themes dir in quickstart guide690961badocs: Add myearworms.com to the showcaseeb41128aAdd lazy loading to showcasefe41bd61hugolib: Default rssLimit to unlimitedb841193dChange sorting of tutorials to weight0f24f217Fix typos on lookup order page149abc4eFix typos on lookup order pagef69dba20Fix search on M+ screens for HP; make typing faster in HP terminal6914e9aaFix search HP icon on mobilefc7fe4dbFix flex footer on overview pagescc0d8203Update docs contrib guidedf5eb4e7Update docs contrib guide5ef857a0Update docs contribute contente12f8defFix flexbox wrapping issues on homepage; tighten up gopher animationfe1a7557Move to kebab for secondary/toc menu7032ee8eAdd enjoyable recipes with new optimized img and FMb5ce1d1dFix external links icon placementb31ad2eeMerge pull request rdwatters/hugo-docs-concept#6 from sethmacleod/master68d58c29Merge branch 'master' into master8381df3bFix small typo and make content updates8e27de10Fix external link icon in contents listaba53d24Fix fontello for blockquotes icon1739a966Add README for gulp asset pipelinec1437ea4Add finalized views.md and usage.md60c2babfAttempt to fix scroll on focus issues in iOS9e999539Remove extraneous showcase imagesad6367bfUpdate doc contrib, baseof temps48120ccfall: Fix some govet complaints560ed6e6Update appveyor config0c45e638Optimize all showcase images7e3ef07aAdd missing markdown icon for code blocks1995b5d4Update permalink values to dl0467c189Add back CRP for last build of the day434edddcFix homepage layout766089ddFinalize more CM pages01545899Fix bash icon in examples8d0c9ac6Fix bash icon in examples74d7da54Remove GH buttons and GA temporarily for dev248fdef3Concatenate all js5c638b69Update to use crp and fontello45b9d722tplimpl: Add built-in print funcs to FuncMapdf5be925Update to use locally hosted Monserrat font3839a0f9Make nav accord to 1 item only, per @digitalcraftsman4e1ad212Fix forum link in site footera2a8a651hugolib: Don't report taxonomy count if disabled4bfa1890hugolib: Remove unnecessary params7bedd4e2Update content and CSS681712a9Update freebsd icon placementa2ec372adocs: Add enjoyable.recipes to the showcasefbe1b65cFix install row on homepage to not break lines in terminal on iOSf7ff4eefUpdate doc contrib guideline3a3828d7Update doc contribute guidelinesda06842eFix icon font family for code blocks87099898Revise "Front Matter" section (second round)da5b2435Revise "Front Matter" section (first draft)b67ee3a5Increase font weight on features row of homepage5f8d840fFix typo on homepage958cb423Update with homepage description & smaller default social imagee45a9713Add default social image for sharing49a83a41Set font-weight of function headings to 3003dfb2961Update AddDate functions and make navigation more narrow2f3fd84eFix toc scrollspy and desc for internal.mdee114747Fix toc scrollspy and desc for internal.mdb134f2c2Change title of additional templating languages26225d8bAdd first draft of internal templates page118704aaBegin first wave of taxonomy templates editsf9b19fabAdd GoHugo AMP to Starter Kits and increase font-weight on hp tagline07985120Add Poppins as a self-hosted fontfb9012d5Concatenate all scripts67c60f48Correct delimiters for YAML front matter example1a147b9bShorten descriptions for getting started pagesa3dd283dFix typo with @digitalcraftsman in Arch Linux install docsc5c7d5a5Merge pull request rdwatters/hugo-docs-concept#4 from digitalcraftsman/install-via-archd1672cacUpdate funcQR _index contente90f0b5fFix open source footer text on homepage2c776de6Fix more typos on installing pageb6c7d01eFinish edits to go templates contentc4aa9a34Remove unnecessary partialCached for footereb99500bClean up first draft of templates/partialsbfddd8abClean up first draft of templates/partialsc9506999hugolib: Populate the taxonomy term Pages list6c5ef713hugolib: Add a temporary workaround for page.copy() data race8e2e9fc8Add installation instructions for Arch Linuxc7b8c45ddocs: Correct toml syntax in Github deploy tutorial14915639Fix typos72685a74Remove all references to baseurl in templatese0c3e906Make small iterative improvements to copy in templating85707e92Add descriptions to all remaining pagesbe89f1e5Remove relpermalink file; fix sorting on functions QRec001f08Update with new homepage3f1de445Update master with homepage96544d23Clean up relURLs and extraneous templating90d7bfedMake further improvements to content organization page4b2d20fcFinalize types page under content organizatione52e2a70hugolib, target: Rework/move the target packageea165bf9vendor: Update cast1a0f38adUpdate homepage partials structure for easier management2e669359Add descriptions to features section22c89dcbhugolib: Fix HugoSites.createMissingPages6db2087eAdd fadeindown for homepage menu4c446c6aRemove call to homepage stylesheet in site-style.htmlb45c4b3aUpdate homepage features data fileeb0e7580Add download button back to code block shortcode8d4584c9Fix bottom margin in global nav5cb9f686Add twitter row and dummy text for homepage features1b7b1f4fFix eye blinking animation on homepage4677cbecAdd animations to homepage gopher badget and cape29c1c9aaFix typo on homepagee7a9b447Add first version of adddate to functions144cc8eeAdd format and full date format explanation to functions78d55aecCopy tweaks to homepagefe211e9dFix phrasing on home page to make it more relevant to visuals7fb86c29Fix phrasing on home pagefd062680Add new article to newsd0e2a1fadocs: Add blog post from After Dark creator6b31541bAdd AddDate to functions listc9dc4276Add quotes to homepagee21aa250Add more content to home row7ff7a63aFix breaking error on missing bfconfig shortcode for BF Rendering33ed1b4cAdd webkit no scrollbars to navs395b2086Update toc for testing fade at bottom on PC28cc820fMake first content fixes to bfconfig readmed5b49fe3Fix tocbefd5d73Remove unnecessary sass files8074ff09Add Twitter references to data folderaa3ce7abUpdate content and URLs of About section0b1c31feAdd section lookup order change for v0.205a94e4cfhugolib: Add section template baseof test casef4779b25docs: Add new section list lookup alternative8203fc59hugolib: Add /layouts/SECTION/list.html to template lookup1dd2b163Fix more styling inconsistenciesfdcc05e7Add more icons to code blocks with or without shortcode9dc11d3bAdd SVGs and slide animations to homepagefb461856Add removal of iconsabe77bc1Update fonts per type kit8b09dfbaUpdate fonts per type kit7acec3c6helpers: Return partially cleaned URL in case of error in URLPrep anyway74ea81b8tplimpl: return an error on unsupported type in isSet577522bdhelpers: Remove unused arg8a8a0fc3Make first content commit with beginnings of new homepage (testing Netlify subdomain)23f5b9achugolib: Fix broken test1279ca20docs: Add some more quotesb1eab2beUpdate README with new URL38a9ffaaMake first commit to homepage branchd5f2560dAdd link to GitHub Pull Request Tutorial9671162ahugolib: Make sure that empty terms lists are still created50b301cbFix config to include noindex tag3669015fHandle Hugo version strings with patch levela0e3ff16helpers: Fix version string for Hugo 0.20 and similarcc158647hugolib: Only return RSSLink when RSS is available2c07f133Add styles for different languages in code blocksb19db039Add styles for different languages in code blocksd0c7f01dTweak code blocksc21fea82Move pipeline to root0366c01bSwitch to new Typekit "Museo Sans" fontsf0ebb43dRemove headings from note and warning entirely0ef29d31Change code block styles, and start first round of fixes for bf configb7a672fdvendor: Update Cobra972649c6docs: Correct date in automated deployment tutorialafb3334edocs: Correct link of 'now' tpl func in release notesc266cd2dvendor: Bump versions5ed3660bRemove heading from admonitions replacing icon with SVG0b91053chugolib: Only consider regular pages in Prev/Next2af9243eUpdate required fields icon in lists, esp contrib to docs63b78b38Remove old aliases afor abs and rel langurl functions4c048ac4Fix wrapping issue with prerendered text for code in lis9c6096dbFix odd behavior of content footer with flexboxbe081676Switch to Roboto Mono for codecc6aef27Add first round of themes submission guide781574beFinish local file templates pagefcb147cbAdd content to contribute themes page from them GH readmed5146d68Add contribute themes page396276aadocs: Revise automated deployment tutoriald3ea7920Remove temporarily JSON-LD schema.org metadata that is breaking build on Netlify66b7e324Update to ideal workflow in concept document58eb36f3Remove functions dropdown and adding content strategy section to concept page072cd003Bump version to 0.20-DEV0a991682docs: Some minor release notes fixes28198ce9docs: Fix shortcode param in release notesa1741f19Update versions to 0.19 releasef22a8eddRemove more unnecessary needsreview in front matterc9c889c1docs: Add release notes for Hugo 0.19f2706329Remove needsreview from all hosting and deployment pagesd219bd04Update descriptions for all of hosting and deployment section29edd7feAdd markdownify for function quick referencee6dc8c46Add GH stars button to site header for dev review770d3e96Make first round of updates for lists explanations and content viewsc41585f8Delete unnecessary sass files, shortcodes, and partialscd4613d8Make first round of cleanup for content organization pagef70b94bdFix ordering of pages in dev tools section in nav4bd4374dAdd updated command mds from bep's 2-25 commit to master515426a1Make final commit before submitting to Gitter channel72e1b602Update content changes in concept document6cf78346Update multilingual pageeb572c8adocs: Add documentation for disableKinds8d513222docs: Update RSS docs with rssLimit changes495d88efUpdate filenames and sections for shorter URL structure75935138Remove and consolidating countwords and countrunes1faf3d3cFix spacing issue caused by command line templateb8a606f6Update rss vars pagec0a626b6Add first round of functionsa9604235Fix spacing on section list pages0eb76b08Revert "hugolib: Add terms' pages to .Data.Pages"a8a8249fRevert "hugolib: Render paginator pages for taxonomy terms"3631fd2fdocs: Regenerate commands doce37e3dcctpl: Add title meta tag to twitter card templateb108e5eeMake first round of edits to ordering and grouping lists page82dcefe5Add last of shortcode display examplesef3edffeUpdate all built-in shortcodes with output and display examples6dd57f7adocs: Remove waffle.io graph from CONTRIBUTING.mdeaabecf5docs: Adds 'Using _index.md' pagee21fdbaedocs: Fix ambiguous typo in quickstart564bce71Fix missing link in articles page0c48be63Fix max size issue with toc on xl=d93008b4Fix footer for additional twitter list for bep spf13 and gohugoio718ed72aTry main element as full widthaeaaa42cFix broken link in site variablesbfd6a131Update with download button and new see-source icons in code blocksee008f4bUpdate function front matter across all filesd8c64b2dMake more copy edits to customizing themes tutoriale9921ae4docs: Mention Hugo's official twitter account950d1aa1docs: Add article to press.md + cleanup4c101c5eAdd external link icon to contents-list.html582045d6Add external link icon to contents-list.html91ff6ac3Add external link icon to contents-list.html0fa26bc5Fix non-markdownified titles in showcase0004cdd9Update few functionsba6104bdFix delimit description81596493Make small mods to heading structures in several WIPsc1425a16hugolib: Fix preserveTaxonomyNames regression8b180ffdUpdate homepage tile descriptions1dda1b25Add first few functions and site hierarchy SVG74277187Add first drafts of lists, sections, taxonomy templates831bfd36Update Docker file to Go 1.84d679627hugolib: Render paginator pages for taxonomy termse117b1b2hugolib: Add terms' pages to .Data.Pages48fecc42Add tree.md to root27f206deUpdate local file templates page7e64e217Enable TOC breaking layout with content footeracd850f0Fix headings in dev tools - comments.md2e899e41Fix typos on single page template pagecca1ef53Revise description of Archetypesb7c91e4fUpdate other templates pages with toc trued15d7dc9Add missing toc to certain content files691544f4Finalize single page template content9e6b5eb9hugolib: Temporarily disable leaktested22a83fFinalize syntax highlighting2eb2431cFinalize syntax highlighting pagec8d5a2baUpdate syntax highlighting page7b72d6baFinalize migration tools page1b7ee6e5Update migration page2414df12Add all weights to template section and updated go template primer0f109faehugolib: Fix broken shortcode tests62783935hugolib: Include full filepath on shortcode errorsa1512e50Update files for reviewers5d0694a4Change annotated content doc to just content changes06370ca6Remove redundant roadmap13c75f44Add first draft of strategy statement and content revisions87acf292docs: Add promotive.es to the showcase13972d6chugolib: Cleanup the Goroutine count calculation91968f3bvendor: Update cast7934db91commands: Cache logFile in createLogger9e52477dhugolib: Add relativeURLs and canonifyURLs to Sitec7535b9ccommands: Remove flagChanged from commandeereb27c47ftpl: Use og:updated_time OpenGraph tag on nodesdf1ff57dUse Page.Params more consistently when adding metadata2cbdd653tpl, hugolib: Fix live-reload of non-renderable content pages4e77c871tpl: Remove twitter:domain tag from internal shortcoded3fb1960docs: Improve documentation for menu renderingf8115778Add comments and analytics to partials page9bdc96faAdd content for syntax highlightingf8267ffeAdd Scratch function page122e3c4fAdd toc to most template pages1aafe65fUpdate content sections pagecbb0461cFix typos and revise text on install and tutorial pages2320c568commands: Make sure build error is logged in watch mode41857d03utils: Use local loggerd04a2457Add tree.txt03d0a338Update functions content footer and added new funcs for menus75d855c0hugolib: Add check for p.Markup == "org"86e8dd62all: Add org-mode supportd2f2d9a3Update temp command section and reverted to old favicone34a358eAdd first part of command section1645c501Add review badge on incomplete pagesa3af4fe4hugolib: Finish menu vs section content pages2a6b26a7hugolib: Improve menu generation for section pages with content782004baUpdate with aerobatic article on password protected sites807b2a9cRemove redundant press and articles pagef3e48405Change all overviews back to section titles on section list pages170e9616Finish though in create-your-own-theme admonishment49f468e6Update more content management files370d6686Add list-icon to overview/section list pages5860bf1bRevise order of variables pages in site navigationc184c685Add more content to getting started pagesfe9fd0achugolib: Cache the value of Page's RelPermalink840c71beAdd all variables and params pages7e0fa13fGet rid of some viper.Get* callsb4cd9e63Finish up last of hosting-and-deployment transfer from old site0a76c785Add finished Quick Start9acdc1bbRemove breaking relrefs in quickstartfb1911e0Consolidate all install pages into single paged40ebc68Add mac install guide3483642aRemove wercker yml validation ref - 40416513c9aAdd wercker tutorial as example for reviewers3d4e99edconfig: Remove unused var02b120d1hugolib: Discard current language based on .Lang()6809ea1ehugolib: Fix .Site.LastChangea0b3d9dbhugolib: Add temporary date parse test2ea242d5hugolib: Minor Go vet fix99fbc75ehugolib: Fix regression of .Truncated evaluation in manual summariesec3c1997Fix broken links in features page2b06eb88Fix odd syntax highlighting in cross references docce58bedeFix local files shortcode1890155aAdd shortcode from live site for readfile example in local files templateb8fba275Add shortcode from live site for readfile example in local files template9416fdd3hugolib: Add missing page kind to allKindsed70c14aAdd shortcode from live site for readfile example in local files template4e159ed5Fix featherlight to avoid icon images3bedf1e2Add featherlight for body copy imagesb2e3748ahugolib: Enhance `.Param` to permit arbitrarily nested parameter references44e00b62Fix broken images originally used in how to contribute tutoriale028978dUpdate broken links55aae645Fix shortcode language in local file templates that was breaking Netlify build2cb5ad8eUpdate shortcode and shortcode templates, both of which need much more work56ecb233Add just a shit ton of content949bbd03Update functions front matter6d2281c8hugolib: Add disableKinds optione096917fappveyor: Add go version13ca0b4cappveyor: Fix build, take 23dade5deappveyor: Fix buildb360f9b3appveyor: Print Go environmentbe1bb5fcMake further improvements to Go Template Primerbdc02edftplimpl: Fix issue with recursive templatese24c1af2Make further improvements to Go Template Primer4493e8edhugolib: Fix issue with taxonomies when only some have content page960707a4Update amber and ace sections07ab7ae3hugolib: More test helper cleanupfa1e4780Update archetypes content82c02b84Update content sections admonitionbec195d1Fix page title issues with functions sectiona1ca69b9Fix broken tox on markdown and support pages pagebd3b1b53Make further fixes to shortcodese9c7e054Fix order of built in shortcodes605508d4Fix content footer next and prev linksce3eb287Fix toc sidebar, add icons to site nav, and add prev/next linksed847ed9hugolib: Test helper cleanupbf7399feAdd first exFile shortcode10c13f5dhugolib: Make RSS item limit configurableade20763hugolib: Fix Windows build failure, final take09466307hugolib: Fix Windows build failure, take 294216902hugolib: Fix Windows build failured3abb93ctplimpl: Fix instagram shortcode panic on invalid IDb7aa2304travis: Bump to Go 1.7.5 and 1.8 (Yay!)edfb9d55vendor: Update Viper53d07fb4hugolib: Add test case for empty Pages in regular pages9d68eb72Update homepage04a4a193hugolib: Remove deprecated marked for removal4b3ca38btplimpl: Fix data race in resGetResource77cbe4d6tplimpl: Refactor imageConfig into a structc507e271tpl: Refactor package93ca7c9eall: Refactor to nonglobal Viper, i18n etc.7483b8ceFix typo and update shortcodes body copy0a16b93dUpdate homepage cards description for getting startedfca2d1e2Update getting started guide homepage card descriptiondc5900baFix to homepage card descriptions for developer tools34063e94Add release notes9e3dfb66Fix tags missing quotes for v0.18 on Netlify2e55c924Fix front matter in getting started section files5629f7e2Fix terms table layout5091be1cUpdate terms layout to table88cad8e7Update contents list style and markupcbd08323Update shortcodes, needs works, and toc styles6f0eec31Fix bg color for code shortcode78213277Update toc with home baked scrollspye34af6eedocs: Add hugofy for atom to the tools section711fd889Fix minor typos in content mgmt section filesaeafa4a0Update issues via shortcode in roadmapf6a55a16Add section to toc header9aa2df68Add section to toc header19d7a56eRemove unnecessary math functions and created table for all0d0973d1Update breadcrumb colors1f50dca4Add contents list for section pages875a0642Add contents list for section pages658b7fc0Revise style of content footer and blockquote5851f4b6Start new callout styles691156c5Use OS fs by default16b16216Attempt to fix input rounding on ios51fc29a1Update archetypes content5dedeb69Remove unnecessary content from benefits of static page3db5aff4Remove unnecessary content from benefits of static pagec8963435Update next and prev buttonsed50c7dbFix js for toc7768124fAdd terms layout and section icon to taxonomy.html66bd832dAdd terms template63c79249Add taxonomy list page3fd4d241Fix overflow on file name for code block shortcode01f5105eUpdate toc style7982cfa3Add updated toc esp for mobile19fcf0ddUpdate taxonomy aliasesf9c5c3f9Tighten up archetypes contentf05a9f2dFix all links and creating new aliases for Hugo features page7ae01dbbFix toclayout9764af5bUpdate toc styles513a7852Add table of contents first attempta988d3cfdocs: Remove the source relative links docs360161f6Emphasize GitHub Stars rating of StaticGen in Why-Use-SSG md file493b7e11Update content0a87ef7fUpdate contente067e89dUpdate content management page order2ded3bf3docs: Update www.bullion-investor.com/report/ in the showcase212241b8Fix footer on mobile when menu is open6384a53fFix overflow issues on mobile safari1d52df22Fix overflow issues on mobile safari4b133eceFix overflow issues on mobile safari4a281e2eImprove to archetype copyc18d21d8Update archetypes sectionf9db26c5Update inline code styles234273a5Deprecate sourceRelativeLinks03dc2766Update search input styles5cc8b589tpl: Accept limit as interface in findRE func298ebc37hugolib: Add ability to sort by frontmatter parameters2618cfbehugolib: Fix error for non-renderable HTML content with shortcodes7234c140Update homepage iconsdfd84dacUpdate homepage icons28e5fb90Fix descriptions for homepage in data file91130d1bFix descriptions for homepage in data filec7874aa0Fix last icon for homepage99e53a95Fix scroll up by adding preventDefault for site menu toggle on mobilec4b40a8fImprove layout of homepage cards11df9370Add first batch of icons for homepage25bfa7e1hugolib: Use the site's Tmpl for non-renderable pageseb7f8aedUpdate algolia search stylesc20a89b3Commit first addition of Algolia search7d4b94b4Add a few icons for homepage87d4ad94Update directory structure to include dev and design resources7a5cc3cfdocs: Add instructions for customized domain962443adhugolib: Correct repeated spelling errors in documentationf26344aeFix typos26443287Update smooth scroll header links and config page68476fdfAdd smooth scroll to header links andpdf icons to anchors872a67a8Update code block2e677d5aUpdate styles for code blocksf9016d40Remove public folder20b57f87Attempt further fixes with Netlify build0093be60Fix build error in single and section default layouts092b3e3cFix flexbox safari issues085ccbf4Fix section default layout167b7001Fix content header in single.htmlb8de89b4Fix flexbox issues with Safari99ee283bUpdate with more Getting Started and improve code block styles9d209adaAdd tags060fe019Replace Font Awesome with Fontelloa89fb86ctpl: Must do a extra lookup of cloned base templatesf4046033Revert "hugolib: Add some baseof test variants"d11f37d9hugolib: Add some baseof test variantsb0de2c1eAdd note, caution, and warn shortcodesb9a13344Add more to Roadmap and to Getting Started section24fd81abUpdate anchor styles3e5ad4aedocs: Update Bitbucket Hosting Tutorial9c979495docs: Add article to press section73ccb153Update font family for functionsa71f7e0cChange font and stylesheet5dfb3097Update more section descriptions36156cfcRevise site main menu and stylesheet, etc.e459a55fRevise site main menu and stylesheet, etc.d02359cdAdd edit button7fd88fb1docs: Update link to blog post in community/press.mdfaba90abhelpers: Fix misspells2af2ff3cdocs: Add tuorial "How to use Google Firebase to host a Hugo site"dae6a453docs: Fix typo in templates/functions.md19aff029hugolib: Skip rendering for the page testsc71e1b10all: Refactor to nonglobal file systems0ada4059vendor: Revert to previous castc2f69226vendor: Update castf9fd6978Revise link to stylesheete0897d3cUpdate site scriptsa01a0533Add more content and stylingfdce08fcUpdate for base templates and blocks pageb676277aMake further changes to navc5f367f7Make first update with actual layout (4/4)0a5944c9Make first update with actual layout (3/4)304e6eaeMake first update with actual layout (2/4)868dccefMake first update with actual layout (1/4)8e879422Update with first round of nav scaffolding48677581Update README to include link to Discuss forum and proposed source org9b152d88Update theme.toml for first Netlify build3e04d066Update theme.toml for first Netlify build24512fa8docs: Add engineering.invisionapp.com to the showcase7241253cdocs: Multilingual documentation for frontmatter params1e799008docs: Add netlify to the list of static hosting solutions72cffed8docs: Add picturingjordan.com to the showcasefeeb93d4Add pygmentize to the hugo snap95ad3ad2tpl: Improve generation of OpenGraph date tags91c569c7docs: Add petanikode.com to the showcase99fd7c68cmd: Remove empty tags/features strings in theme.toml templated949c34adocs: Add Dokuwiki to hugo conversion tool7dc94581make: Fix typo940c5d8bdocs: Add tumblr-to-hugo to tools section3ac1b9fetpl: Fix deadlock in cached partialsdc61d3b6docs: Update author credits in GH pages tutorial3818d696docs: Update tutorial on GitHub Pages deployment85c75783tpl: Fix broken benchmarks0d0e0699Add first round of single files for functions92ba7219commands: Fix newly broken server flag handling1d7b9606Clean up Makefile (#2924)db33a33eShow full template errord6000a20all: Refactor to nonglobal template handling4ea4359ahugolib: Avoid double-encoding of paginator URLsbc06135chelpers: Allow tilde in URLs45e3ed51all: Refactor to non-global logger24a28679Add the instructions to install the snap56c5eadchugolib: Remove summary.go3d058a93hugolib: Allow arrays of arrays in frontmatter Params3286b24fcommands: Show OS and ARCH in version output2989c382tpl: Add truncate template function9c19ef0ftarget: Add COM0 and LPT0 as reservedNames on Windows9f20e648hugolib: Sync page collections with Site.Info on rebuild in watch modec60c41e0commans: Remove unneeded build constraint01ee525fhugolib: Correct usage of "shortcode" in error messages1b46d2cfcommands, vendor: Remove log level setting in Jekyll commandfff6617cvendor: Update jww logger0dad6932docs: Vanity-update of site meta description001dd01ehelpers: Remove unusded WordCountb8544389Create first commit of new concept hugoDocs (continued)e856f241docs: Update references to _index.md49a840bedocs: Add new article about Netlify's PR site previewe3e5600bhelpers: Fix minor typo in error message for Seq()19b6fdf2tpl: Fix Unix time test case in TestDateFormat()b8057b49vendor: Fix broken build2127203aUpdate documentation and test for sitemap templatecb63e87fhugolib: Clean up a benchmarkc344b190commands, helpers, vendor: Update to the latest jww logger2ac9817ehelpers: Add doc to Language.SetParam4352156acommands, helpers: Fix docs52976da0commands: Fix case in default config variable6fb4f048commands: Fix case in names of some methodsbe39ae5edocs: Fix typo in overview/source-directory.md2ece1b32docs: Add heimatverein-niederjosbach.de to the showcase433c0361docs: Add dbzman-online.eu to the showcase0d330b0ddocs: Fix typo in v0.18 release notes6a51216cdocs: Don't use binary version in docs site5834efd5hugolib: Add a taxonomy test casef79877cbRemove waffle.io graph from READMEa60ec063docs: Replace .Now with now09a0af94Fix Appveyor Windows build and GitInfo path issue on Windows6e0f326bhugolib: Deprecate Page.Now695be00chugolib: Bump the current warning deprecationscabc6b31tpl: Add now function707d3cf1docs, tpl: Fix documentation of UniqueID7d072fbbsource: Make UniqueID ... unique02d6f532tpl: Use HTTPS in Google Analytics template73c1e271docs: Add HugoPhotoSwipe to the tools section6374d82btravis: Add GOARCH 386 teste9e4fd90docs: Add release notes for Hugo 0.18.1a18b9e72vendor: Update Cobra95a473e7Fix Dockerfile211d20a3docs: Update GitLab depleyment in /themes/installing.md164d0fb6docs: Hide next arrow in theme8a63e092docs: Remove right padding in theme83b4c405docs: Fix h1 size on small breakpoint in themec22b7ff8docs: Remove unuseful breakpoint in theme84896080docs: Fix menu arrows position on mobile devicesbcb3ef74hugolib: Fix preserveTaxonomyNames regressions862f09badocs: Add hugofy for VS Code to the tools section6affd31blivereload: Simplify RefreshPath88b5bbd5hugolib: Fix IsTranslated for "old" node typesd1b89f5chugolib: Use reflect.DeepEqual in tests17f85178hugolib: Fix redundant URL file extension on taxonomy terms pagese78dd3cddocs: Enable ToC for extras/shortcodes7d991ed8hugolib: Make template error messages more verbose3e4fbbaahelpers: Add patch version99e5fc63vendor: Update Afero63d3c4cevendor: Temp roll back to an older Aferobc060ee1tpl: Update dateFormat test expectations for epoch valuesb0e86dcdvendor: Update dependenciesd055862atpl: Fix crash when using imageConfig8b0c3b9bhelpers: Remove "no theme set" warning34c87421tpl: Update getenv to accept interface{} params29caaddctpl: Update title to accept interface{} params661d64c4tpl: Update upper to accept interface{} params4e5b4ac5tpl: Update lower to accept interface{} params6b8422bbtpl: Update hasPrefix to accept interface{} paramsf25f8373Update Travis go versions441476b6docs: Convert code in multilingual.md to TOMLec34ed05docs: Add neavey.net to the showcase.a4fc20a1docs: Fix typo in templates/blockse7ff094ddocs: Add details about binary names for setup on Windowsb2687ab1command: Add `themesDir` command argument to specify themes directory4845a13cdocs: Update christianmendoza.me in the showcase1881f60ahugolib: Add a test assertion for IsTranslated1eb07954docs: Regenerate commands doc1e313cedBump to 0.19-DEV8b410347Add GoBuilds to .gitignore09cc7915docs: Add new alias feature to release docs3d6fdb8eBump to 0.18 release version4de808aedocs: Add 0.18 release notes018813cavendor: Update go-toml71aa797bdocs: Fix broken link to Content Types6fd4bfcadocs: Update layouts path name79b2725adocs: Improve documentation for block templatesa3a67163hugolib: Enable override of theme base template only596bbea8docs: Clarify single page template search path26084ad1docs: Fix pipe examplesfa09e20ddocs: Fix Ref and RelRef syntax2f0e8198docs: Document partialCached func9c2ea369docs: Add .Site.RegularPages docsd332aa16docs: Update GitInfo usage docsf8190777docs: Cleanup Extras menu orderingaecabfcddocs: Add Extras > GitInfoef03c6f9create: Allow empty dates in archetype in newe4ebe0d5docs: Fix querify example7862de91tpl: Add a querify test case that is actually and URL83c68065Fix menu URL for node type pagesc7f67dd6docs: Clarify usage of archetypes provided by themesb4404a95docs: Update File variablesa1c25beaCreate first commit of new concept hugoDocsb4cbccaadocs: Fix prev/next links in content sectione90cb153next: Move content files to prepare for new layoute3d48760hugolib: Fix commentd4b9fa96hugolib: Respect disableRSS5b1eee44tpl: Avoid repeating the same test case in TestMD5 and TesSHA*22360566docs: Fix linebreaks in templates/variables.md0f6c73cftpl: Add sha256 template function01b8bc1bdocs: Update description of querify0ba9fb96docs: Document querify template funcba8a00a6hugolib: Add regular content page count in publish summary15622c80hugolib: Remove superfluous assignment2f026ab3hugolib: Make RawContent raw again971d1bafcommands: Add noChmod option to disable perm synca4b9abf0vendor: Update fsync529574e6create: Run all the test variants in TestNewContentc87331aehugolib: Fix rendered empty msgb2eadd93create: Simplify archetype logic96018ab9create: Fix archetype title and date handling65d4d96evendor: Update go-tomlb7e80045makefile: Add test-cover-html20d82a7ahugolib: Create the permalink once only046320d3tpl: Fix params case issue with nested template funcsc38bfda4hugolib: Fix regressions with uglyURLs1f6e0de3hugolib: Avoid repeated Viper loads of sectionPagesMenudbb0c1cfhugolib: Add shortcode for Instagram001e2bbedocs: Set correct default archetype directory in overview2c7cbca8examples: Update blog example68ebf616examples: Update multilingual example4c72eb12commands: Simplify65e5959bhelpers: Simplify139585f8tpl: Simplifya721fbedtarget: Simplify3739871ftransform: Simplify43604520hugolib: Simplifyf1ed89feRevise the deprecation strategy0a0db9cdhubolib: Simplify map rangeff2498eeRemove ShowPlana6d584bfvendor: Update go-toml1156be3bvendor: remove afero/sftp depse0b27820Fix alignment of go gets in Dockerfilec06c3234helpers: Fix typo in language.Get documentationc8d41141hugolib: Add missing paginator test casec33eb935tpl: Add some missing test cases174f97a9tpl: Fix spelling in test7665dd23tpl: Drop an else block in checkCondition581291dchugolib: Omit type from declaration of var lang32336e9ehugolib: Camelcase ALL_CAPS vars and const in tests75e55cd0hugolib, source, tpl: Fix docse81c06c3helpers: Rename WalkRootTooShortError to ErrWalkRootTooShort647540d0helpers: Add documentation to some Language methods700d531ahelpers: Use iterate operator by int in Emojify713f577acommands, hugolib: Unify case of config variable namesdec1706acommands, hugolib, parser, tpl: Use errors.New instead of fmt.Errorf1f130fd6commands, hugolib, source, target, tpl: Get rid of some fmt statements120f6b0call: Use jww instead of fmt for printinge1da7cb3Fix case issues with Paramsa5b3b076docs: Add Pages to variables section382582fcnode to page: Re-add translations sort of regular pages6c0ecc2ddocs: Add release notes about node to pagee29f6fe5docs: Add sections on node now being a page0eb5f54dnode to page: Fix site pages sort976f8f84node to page: Fixe index page translation issuesaafbd3b4docs: Revise docs to reflect that Node is goneae1de7abdocs: Make the tools content page a section page7e81971bnode to page: Don't repeat the RSS title if it is the samef776af6cnode to page: Temporary set RSS date to zero0bbdcf24node to page: Render aliases before pages32fb1e6fnode to page: Need to append theme templates28031b08node to page: Only return regular pages in home.Data.Pagesa843d5d3node to page: Final TODO-fixes99d11386node to page: Fix the Page copy()62e9e7e6node to page: Misc. TODO-fixes524eb166node to page: Handle URLsc8d3124dnode to page: Remove Node9347084dnode to page: Make Kind a string9fba2a30node to page: Rename PageType to Kind96f71141node to page: Export GetPage to the templates487b210fnode to page: Handle Date and Lastmodc80308e6node to page: Add Pages to Page063b78d2node to page: Make Nodes into Pages88972b0dnode to page: Refactor the build process640b8bednode to page: Handle sections with only _index.md2d91b17cnode to page: Handle aliases on home page etc.7cb0e34dnode to page: Handle menus on home page etc.ecedc85cnode to page: Handle taxonomies on home page etc.d3d3863cnode to page: Add all nodes to sitemap7cc637e9node to page: Do not create section node for root503fb299node to page: Get Rebuild up to speed80e453f1node to page: Fix home target path on Windows94ea12ebnode to page: Remove unused codebde1bfd3node to page: Handle aliases, 404, robots.txt, sitemapec2d502bnode to page: Handle translations698b994fnode to page: Fix the page collectionsc175407fnode to page: Use _index as identificator for the list nodes3ff25b37node to page: Handle RSS75c38071node to page: Create pages for nodes without contentf8bda16enode to page: Handle taxonomy terms3737c9bcnode to page: Handle taxonomy listsc2f3cb2dnode to page: Handle sections734b6508node to page: Handle homee371ac0bnode to page: Basic outlinee7d0bc8aRevert "Fix case issues with Params"239c75c7Fix case issues with Params1eb3c4a8docs: Fix list template link30317934docs: Add a simple list template3b42640ehugolib: Don't write zero-bytes files to disk65f803e1docs: Rename RSSlink to RSSLink29fda0e6commands: Make benchmark command more useful7b8a09d5docs: Add balaramadurai.net to the showcasece5f41ffvendor: Update depsa49f838ctpl: Add imageConfig function950034dbsource, tpl: Fix staticcheck complaintsbb36d57bdocs: Fix typos in extras/scratch.md4d4c7791hugolib: Must update PathSpec on SiteInfo per language85a2d81ecommands, tpl: Get rid of repeating viper accesses4b4ab475hugolib: Fix page sorting when weight is zero52e2fd27docs: Add article by Zetao Yangb619eb5adocs: Compress Hugo logo (hugo.png)07eb3a50tpl: Golint fixesd4830fc4helpers: Golint fixes72156e40hugolib: Simplify range8dace9addocs: Update roadmapf4afd133Enhance commit message guidelinesec44ad5cdocs: Link latest change as commit in the footer774f13bddoc: Add a "Deployment with rsync" tutorial page0cd0addatransform: Return any read or write error from Apply3a86aba5commands: Move initialization of flags in separate functionc9be931edocs: Remove non-showcase Hugo sitese8380e61Add GitInfo186db7cdFix page names that contain dotcda3b36fRevert "docs: Add www.bullion-investor.com to the showcase gallery"b5bc74cadocs: Add www.bullion-investor.com to the showcase gallery01cfcce6docs: Add two articles written by Hash Borgir6a3d1037Fix RSS Title regression342b6fe8Make it clear that Path is relative to content root4ad39445Refactor Page testsf5b26455Remove Wercker config301e4c7eMake Amber read from the Afero source file system0406be3dAdd missing template error logging89e31256Get rid of the rawContentCopy field of the Page structc936b6c8docs: Fix punctuation in content.mdc859810bdocs: Add clearhaus.com to the showcasea2cc2e75docs: Fix typos in content section333bb055Remove now superfluous lowercasing5859c691vendor: Update Viperf21e2f25all: Unify case of config variable namesd9f54a13Handle ToC before handling shortcodes165edc7ftpl: Fix commenta10b2cd3Avoid reading from Viper for path and URL funcsdffd7da0docs: Clarify installation of themes6427fba9docs: Improve instructions in quickstart.mddb86f480docs: Add dmitriid.com to the showcase1992b356Bump Travis to Go 1.7.3d0d24b43commands: Do not print error on missing unknown dirsf0af8075commands: Only watch relevant themes dirddf2a340Add page context to error logging in rendering67df33d8Fix a more summary corner case58f31d27Consolidate the Param methodsfaa64abddocs: Add singular/plural i18n examplee6f2426edocs: Add christianmendoza.me to the showcase3a5b7027docs: Add fixatom.com to the showcase6a7f989ddocs: Add hugojoomla to the tools section7f4d9025docs: Remove merge artifactdf943595helpers: Slight improvement of ToLowerMap40b1b8f7Fix case issue Viper vs Blackfriday config4d6cd3cbdocs: Update link for Ace template site2ea22a42docs: Add docs.eurie.io to the showcase0456f950docs: Add GitLab to Forestry.io integrations35dda2d9Fix pygments check in test9ee2538evendor: Add external2e0e77beMake the pygments shortcode test matching less specific10a773cdImplement support for alias templates88675473Updated link for Ace template site8b43d39eUse govendor sync instead of get3ce90466Rewrite TestRSSOutput to use Afero58825677Add workaround for block template crash794589fbUse example.org for replace-this-with-your-hugo-site.com4e0c71a6Added GitLab to Forestry.io integrations8fa871a0all: Remove dead code766c82a6Add context to asciidoc/-tor error logging9f9b93afAdd logging of asciidoc/-tor errors998034faLog on error in translation fileeb00c621tpl: Remove the spamming template errors8ddd95e3tpl: Factor out double Lookup in executeTemplate474eb454tpl: Add partialCached template functiond2bc64beAdd draft test5355ddf6docs: Remove deleted article "Hugo on Netlify — Insanely Fast Deploys"bfe9b870docs: Add "Hugo on Netlify" article to press.md8a63ebcbdocs: Add shapeshed.com to the showcase9d0b1320docs: Add thecodeking.co.uk to the showcase71422a7ddocs: Add Firebase Hosting to usage.mddf7b8b5cdocs: Add Firebase Hosting to hosting providersb3bcd78fdocs: Add webhook to tools for deployments8d509258docs: Mention GitLab hosting support8b8a1e0aFix broken build0206be02hugolib: Prevent TestShortcodeTweet from accessing network7b0f92dbvendor: Update Viper1f087794snap: Add "network-bind" plug for "hugo server" to worka7e2a04ddocs: Add Forestry.io to the tools sectionc2bf748edocs: Refactor /docs to use the block keyword56512e81Allow to set cache dir in config file3616fb62command: Fix hugo new for multiple architecturescf5d2e27vendor: Revert latest Viper1c214fcbAdd quiet mode7cdd230evendor: Update dependenciesa22294aadocs: Stylize "Mac OS" as "macOS" in v0.17 release notes6195d8f7docs: Fix grammar in v0.17 release notes1adfaf49snapcraft.yaml: Bump version to 0.18-DEVd54d6633release: version bump to v0.18-DEVe1e677f6snapcraft.yaml: Bump version to 0.17 for releasefe2d246ccommands: Bump min_version to 0.17 for "new theme" subcommand5b9f4883release: version bump to 0.178bc390d8vendor: update viper to latest versionf9c70c0fadd release notes for v0.1757d7dd5bdocs: Add rahulrai.in to the showcasefbce8445Whitelist startinline pygments option27d7aa5ftravis: Reintroduce asciidoctor to buildf8e968b2snapcraft.yaml: Change grade from "devel" to "stable"00b3667ftravis: Remove asciidoctor from build217d6ea6travis: Fix asciidoctor buildf37f57a8travis: Lock asciidoctor to 1.5.4b3a113b7docs: Regenerate commands doc2a4ed1c4Add hugo env command80367ea2docs: Us vs you88ec7d88docs: Improve home pageffbf3dd3doc: Improving language in archetypes doc0721a9c7Update Dockerfile to pull in missing test dependencyd9c1f1eedocs: Add Lipi to tools sectionbf0dfa3eFix URL in multilanguage sitemap indexd30c6a26docs: Fix typo in tutorials/how-to-contribute-to-hugo.md50c43c36Contributing: Link the "How to contribute" tutorial0043b486docs: Add notes about multilingual menus78e5263cReadme: Clarify usage of Gittere36b0305docs: Add tryo labs article to press.md614dd2aaDeprecate PageMeta.WordCount etc.59df7db7Fix half-broken self-closing shortcodes8b0d16b8docs: Fix typo on hosting-on-gitlab6b4d3263commands: Revise instructions after "hugo new site"0c223d9cvendor: Update Vipera61b1497vendor: Update casta0167d83Fix leaky goroutine63a6da06Make multilingual respect DisableSitemap73894ccaAdd TestChangeDefaultLanguage2071d470tpl: Polish i18n testse7e2a1catpl: Improve tests and docs for i18ne7ff5c2dvendor: Update go-toml608b90davendor: Update dependencies894b69dbRemove some unused vars9c017e51commands: Add some band-aid to convert2105e42atpl: Set i18n bundle once per test run6e692f2dAdd vendoring with govendorb3a72155Fix i18n with missing translations and add testsbacc1706helpers: Skip TestGetRealPath on Windows when not in CI98c12b7bFail early in TestGetRealPath4a79fa0cRevert the "standardize author data"83533a88docs: Improve Overview Configuration manuala7af6303Make suure SectionPagesMenu setting is always loaded per languageb6673e53docs: Add documentation for author profiles56afd943docs: Add multilingual alias example51c9bfbcRemove Authors.Sortcf978c06Add First Class Author Support44bf76d0Add snapcraft.yaml file74291114docs: Clarify difference between slug and urle80453a9tpl: Add EnableMissingTranslationPlaceholders option0dd57b90docs: List i18n folder in source organizationbca567fadocs: Clarify usecase of data files0c49370cdocs: Fix example of displaying taxonomies3410007ddocs: List multilingual tpl vars and show menu creation9dab62c5docs: List config options for multilingual feature4e16a6d4docs: Fix markdown in content/extras/scratch.mdcdf1edd5docs: Fix French translation in multilingual.md0d1e9670docs: Improve Traversing Local Filesb86a605bMake paginate settings configurable per languagebbb11a4aDo not add lang prefix in URL when set in frontmatterdd45e6d7Lazy calculate WordCount, ReadingTime and FuzzyWordCount4abaec5cImprove TotalWords counter funcbcd43479Avoid splitting words for summary74ffb45fhelpers: Improve the language prefix logicf53145b2helpers: Avoid adding language prefix if already present8d040c96commands: Improve error messages in converta04abf0dtpl: Make the *langURL funcs tace interface{}7615ef0ccommands: Report errors in convertbe09781aFix broken convert command69a97823Add Language.LanguageNamea7dc3c08Support site menu per languagef0ac26c9commands: Fix typos3908489ctpl: Extend where to iterate over maps64012142tpl: Fix typos in tests46342ad5hugolib: Fix typos in testsc700cdc3Replace some leftover os.Stat with hugofs.Sourceef3c4a56Fix reload dir matching in theme364e69abHandle symlink change evente70cf1acdocs: Remove JPEG as format for showcase thumbnailsd5379fd1docs: Add davidyat.es to the showcase4d1cb500parser: Use strings.Contains instead of strings.Index798bf60cparser: Simplify err conditions60baec80commands: Delete useless conversion2294b022commands: Simplify err condition1e180873commands: Delete unused newUserErrorF5867cb5aFixe target path location check in jekyll import command7d3dfba8Prevent panic on empty authorlist33921331Remove redundant field in sort helper struct9c5f2beftpl: Make it more clear on missing language string43bf9ed3Redirect to root when DefaultContentLanguageInSubdir = false4df86a70Fix paginator counter on x86-32eaf2f9bcAdd TODO list support for Blackfriday76bf2dcdFix shortcode vs pygmentsccb3040aFix pagination page counter on 32 bitfe0c2705Reset the i18n func map on reload5ef45becdocs: Fix typos in multilingual section97c57fe3Add missing read lock in getNodesa8fad866Bump Travis to Go 1.7.134fe5cd3tpl: Fix echoParama00edff5Make it the DEV version35d2eac4Fix go vet 1.7 issues09ed41beAdd a global Reset funcdc3618abMake sure the 404 node has .Data.Pages30d65fd4Fix site reset for benchmarks etc.b3563b40Fix multilingual reload when shortcode changesa823b157Set lang template globals for each site when render shortcodes28696b5dSmall adjustment to SiteInfo init2f7e8df5docs: Fix spelling: HasTranslations > IsTranslated1bce8a85Create a copy of the section node for RSSbbfebdeaFix Data in multisites93717aacdocs: Get the variable and funcs re multilingual up-to-date4fbce787Add JSON config to the multilanguage testingd8a256c1Fix YAML loading of multilingual config446e606aAdd data tests5b331a18Add temp MULTILINGUAL version suffix to this brancha07293cfCreate a Node map to get proper node translationsd1212307doc: Fix TOML vs YAML in multilang section45c69dd1Handle error in config loading76108440Add IsTranslated to Node and Page8b55bfc8Remove unused Multilingual Viper defaultf1e1cdabImprove i18n string handling8da04034Render main content language in root by defaultd953e39eAdd parent as owner to Site9798a956Make the check command work in multilingual mode6b552db7Make sure drafts etc. are not processede56ecab1Multilingual TODO-fixes, take 10a7d1d0dFix some corner cases in revised summary handlingd18a8cbeFix livereload in multilingual mode506e131fFix the shortcode ref tests54141f71Improve language handling in URLs2079a23dMake it possible to configure Blackfroday per language596e0e98Make it possible to add a language in server mode7cac19b1cmd: Load config from the common config loader in hugolib8b657a11Get the list commands up to multi-site level90de5110Make taxonomies configurable per language36f2a1f6Make the config loading testableb6fcb3d0Add sitemap index for multilingual sitesd5720717Redirect to main language from rootf0b91852Rework the multilingual docsed098540Render the shortcodes as late as possible708bc787Optimize the multilanguage build processf023dfd7Move the Build* methods to HugoSites5b9c2a40Move HugoSites to hugolib3a028079Add Translations and AllTranslations to Node52bf8f90Rework the i18n template func handling75dd596eIntroduce HugoSites type618948e4Reset translation slice on rebuildc447b7ddRename MainSites to Sitesc4e7c370Add Translations and AllTranslations methods to Page06d12ab8Add proper Language and Languages typesec33732fAdd multilingual support in Hugofaa3472fdocs: Fix typo in Quickstart guideccc51fe7docs: Add open.cinegy.com to the showcase723d4656docs: Add Vim/Emacs plugin to tools sectiona48ac6e9docs: Clarify first level URL generation0614a59bdocs: Improve Quickstart guide696c67b0docs: Clarify Creating a New Themebb1812b6docs: Mention theme config option on Usage page8e1bcea8docs: Update documentation for URLsb6635e1bhelpers: Fix bug in emoji renderer7cb81077docs: Correct spelling for "parameters" in partials.md38d034dfdocs: Document shuffle template func6eff9e50docs: Update highlight.js example to latest version2fc05daddocs: Add location of block templatefee9ee72tpl: Add missing arg to Fatalf20c4311dSwitch to a more up to date TOML library81f04ef4docs: Clarify Usage2530087adocs: Add Spanish video tutorial by Verónica López to press.md715d4425hugolib: Use named keys in composite literalsc5d07299docs: Just a small grammar fix in quickstart.md3ce9de76docs: Follow through on watch default68c8e0e2docs: Correct name of release archives for OS Xbe429d22docs: Correct all erroneous swaps of "it's" and "its"8474b9dedocs: Improve section 'Why did you write Hugo?'de1ca477docs: Fix URLs in examples sites with path prefixf914774fRemove broken Bitdeli badge from README.md5498a1bdtpl: Return all errors from castingd3627b17Simplify Travis buildd72c454fFix command for getting hugo in CONTRIBUTING.md97c37732Add a global Reset func2175ea5bBump Travis to Go 1.7661c9787commands: Suppress 'missing static' errorf6d4801bSkipt Twitter test in short mode09612f7atpl: Fix faulty ordering of relURL test cases88dcbc6etpl: Make absURL and relURL accept anything26725515docs: Convert toml to yaml in config overview39df7724source: Normalize file name to NFCb33bfd40docs: Add doc for time template funcf2faae08Remove maximeguitare.com from showcase0d9c0677docs: Add rdegges.com to the showcase914e4d85tpl: Fix typo in FindRE test93f3a85bFix the time template func test70544f9etpl: Add time template funcd7f364c2Fix for meminterval not using specified interval5824e809docs: Add romansilin.com to the showcaseb426c20eReturn specific error on walk path too short15b66935Adjust the sanity check to path length 494d99898Add sanity check to the file walker802d43cbDisable Go 1.5.4 in Travis285807baTake 2: Load templates from the Afero source fsec23aa99Load templates from the Afero source fs5f5fccbcDo not return empty theme dirs4ddd5361Use the Afero source fs where relevanta0859dc6Make LazyFileReader use the Afero source fs94892726Handle errors during filesystem walk0087beefdocs: Add tumblr2hugomarkdown to tools section0d0a7596docs: Add tumblr-importr to tools section5b40eeedexamples: Add example for translation files04889a5edocs: Document .File variables for pages333646c5docs: Drop .isDraft to new linee3e1f7a2docs: Add a link to hugo-openapispec-shortcodeddd5a922docs: Removed comma from json example.df0a4534docs: Add missing configuration option disableHugoGeneratorInject9c458657docs: Add weilinshi.org to the showcase17f53526docs: Add CTL Compiled edtech blog to showcase76f332bfdocs: Add www.leowkahman.com to the showcase3e1b579cBe less aggressive with CHMOD filesystem events91b61b97Simplify the configuration of HugoHTMLRenderer4d4da001Fix broken shortcode test39a452a4Add "missing slice" to the Params test593a546fCheck for nil Params in shortcode's Get0bdc0d62Add shortcode null param variant198efc89docs: Add Algolia as commercial search servicee9924e96Add shortcode test for mmarkc0eedfe9docs: Update last-mod date of installing-on-windows.md10ad648edocs: Fix PATH issue in the instruction for Windows 1020555b16Add `htmlEscape` and `htmlUnescape` template functions7dd5cd67Bump Travis to Go 1.6.33564f09etpl: Add humanize examples to smoke tests55a4f6e4Do not double-escape in querifyef9b9156Revert "Throw a noisy error when a post has no layout"318558f2docs: Add 404 templateb1593400Throw a noisy error when a post has no layout Fixes #1313af34613fUpdate frontmatter.go0a812bebtpl: Modify tpl.humanize to ordinalize integer input330639d2Fix panic when using URLize32d82a44Ignore emacs temp filesd44bb4ecRevert "Use bufferpool in Asciidoc handler"7c125ebbRevert "Use bufferpool in Rst handler"adf40549Fix humanize when string is emptyd9bc233fUse bufferpool in Rst handler00d70e55Remove []byte to string to []byte conversion in Rst068a7715Use bufferpool in Asciidoc handlered5ad12aRemove []byte to string to []byte conversion in Asciidoc1d7f4413Consolidate the Render funcs4a48b5f3Replace replace-this-with-your-hugo-site.com with example.orgb8af06f2Make auto-date disabled by defaultb581bbd8Make config flag global223073c6transform: Add missing GoDoc39fe42cfSimplify querifyfbf48824tpl: Add a querify function to generate query strings inside templates770df77bAdd Docutils to Travis05a33e31Add Asciidoctor to Travise6d97c4fAdd Rst shortcode test5388211cAdd Asciidoc shortcode test6c0f7052Fix Emoji benchmarkaa66478cAdd Emoji test case7e08d23etransform: Explicitly bind LiveReload to server port0ce64382docs: Update install instructions to reflect hugo.exe filename changee140070cdocs: Add tutorial for GitLab Pagesca6b26fecommands: Allow schema-less baseURL on command line5572e349Update Travis config to Go 1.6.2195a2b38docs: Suggests the use of delimiter for taxonomy listing364686ecdocs: Add additional example for taxonomies listingeda36787Add automatic page date fallbackc21e2b3btpl: Enable safeHTMLAttrcdd6a124Add test for shortcode in fenced code blocke3b162cctransform: Don't use helpers.StringToReadere2aea651helpers: Remove ToReader funcs29ca323adocs: Regen commands doc1accd3baFix example for autocompletea4b84962docs: Fix typo is 0.16 release notesca5ae50cRevert "docs: Refactor /docs to use the block keyword"3a2748e0docs: Refactor /docs to use the block keyword357c9db2docs: Add mtbhomer.com to the showcase714d4a9aFix failing Windows test44edd938Add tests for embedded shortcodes8b54843ahugo: Revert git commit message guidelines373ca662hugo: Update contribution guidelinesc52bb4efcommands: Specify os port generic errorsaa690c8ecommands: Fix charsets in mimetypes34f40044Fix shortcode in markdown headers6ba07456docs: Add upbeat.it to the showcasec01f9825docs: Add mayan-edms to the showcase85881033Unexport ShouldBuild and AssertShouldBuildeeaafb4bhugolib: futureStats pluralfb0c1350hugolib: Handle unpecified date for IsFuture and IsExpired673e41bfhugolib: Add expiredStats to build feedback32c0e3fdhugolib: Bug fix futureStats4724a579hugolib: Refactor page.ShouldBuild and table driven testf7b2e532docs: Add ExpiryDate to the list of variables448f0306docs: Example of how to use Order by ExpiryDate02d2f05edocs: Add instructions on buildExpired in build configurations6e9fbf8adocs: Add expirydate to front-matter doc5461a5e0commands: Add listExpiredCmd for expired pages51f7cd9bcommands: Add buildExpired flagc1c8ecc9hugolib: Add GroupByExpireDate function091915c7hugolib: Add sort ByExpiryDate function6472f158hugelib: Add expiredCount as a Site variabled4156e61hugolib: Support an expiration date2564f46aFix Emojfy for certain text patterns683888ebChange hugo to Hugo in help text5d3aabcbUpdate the alias generated HTML files to conform to the W3C HTML spec75deb923Remove unneeded casts in page.getParamacbedf62Fix urlesc import url in Dockerfile48ebd598docs: Add jamescampbell.us to the showcasef9cadee8Bump version to 0.17-DEV7212e513Update release-notes.mdb7513ea6Get Dockerfile up-to-datea7f51703Add Hugo generator tag to home page if not present80ebe057Update release-notes.md60184823docs. Add the guranteed exit -1 on eror to Hugo 0.16 rel notescf10d4ceSome polish and addends to 0.16 release notesd4e5fa6fPull the shootouts about 0.16 into the intro section26c18005Remove HugoVersionSuffix "-DEV" prior to 0.16 release834d4177update release notes for 0.16 releasef94cd281Handle errors during rereading properlyd1cf262bIgnore __jb_tmp___ files created by IntelliJf8e4a060Annotate temp files that Hugo ignoresce05dfa5docs: Grammar fix in overview/quickstart.md4ab5ed6cdocs: Add Digital Ocean articles to press sectiond486396fdocs: Add c't magazine article to press section20358f46docs: Document UniqueID page variable56116315docs: Add an example of how to use .PrevInSectionc21b1558docs: Add note about live reload script injectiondcee05b2docs: Fix minor typo in overview/quickstart.mdefae41c1docs: Add novelist.xyz to the showcase90362933docs: Fix typo / readability in extras/menu.md6dec7b3edocs: Add stefano.chodino.uk to the showcase gallery.dec74431docs: Add klingt.net to the showcase gallery9305decadocs: Clarify that watch is enabled by default9aa70af1docs: Fix git clone for hugo_theme_robust in quickstart guideac938d9ddocs: Improve description for .Hugo.Generator64817cc0Fix broken template test26906d85Don't add any space around Emojis608cfe62Remove kr/pretty dependencyfd40fe39docs: Document relativeURLsb5030782Ignore Byword temp files273a6840Add non-string support in markdownify7cbafa4edocs: Fix typo in overview/configuration.mda07889d4docs: Fix typo in templates/content.mdbf4206a0docs: Fix links in the documentation5caea6f2docs: Add 2626.info to the showcase09038865tpl: Add intersect operator to where functionffbd2b6cdocs: Add appernetic blog to showcase2b02a402commands: Sett mime type for CSS in Hugo servere4ee1b89helpers: Use net/url for URL parsing in AbsURL16b71bbbExport "detectFrontMatter" to fix caddy-hugoc5723a89docs: Add aydos.com to the showcase4152ce88Update release-notes.md7da9163ddocs: More on release notesefa9bdccdocs: Order by Lastmod in release noteseb627ca1docs: Order by Lastmod10af9063Add ByLastmod page sortfbca53acdocs: Add notion of exiting the themes folder in quickstartfe2b22fedocs: Grammar fixes in overview/quickstart.md19afa5eedocs: Update showcase screenshot of yulinling.net81a2466bdocs: Add some more fixes to release notesebefa476docs: Move image-width fix to style.css48fce611docs: Move Algolia styling into style.css22683a3bMake alias redirect output URL's relative76738347docs: Fix findRE typoa8e05b11docs: Fix some typos in release notes56cd3081doc: Get feature list of 0.16 release notes up to date01c33898📚 Add ENV support to release notes9ddf5202Update import path of fsnotify5e9b147cdocs: Add some doc about ENV configb7fd4102commands: Support config from ENV0743c767docs: Fix typo in tutorials/how-to-contribute-to-hugo.md77159b4bAdd some schemaless BaseURL tests215b8939docs: Fix grammar in templates/partials.mdfed5f20fdocs: Add tutorialonfly.com to the showcase4b4bfa6adocs: Fix lastmod date for chipsncookies in showcase6fdb0ca6docs: Add barricade.io to the showcaseba0a6614docs: sa.muel.be has moved to chipsncookies.com in showcasec40bc274Improve build labels in README24cb0d1ftpl: Do not write to cache when ignoring cache5d50c464Chomp Unicode BOM if presentd48b986cRevert "tpl: Extend where to iterate over maps"dc8659c5Update Travis config to Go 1.5.4 and 1.6.10141a021tpl: Extend where to iterate over maps206440eeFix broken tests88759eecdocs: Add plainIDAnchors change to release notes0d9a5f80docs: Update default for plainIDAnchors06772eefDefault to plainIDAnchorsc3d28d28Revert "Add Node.ID"39c9ae31Revert "Use Node.ID for anchor ID"2468b10edocs: Fix example for Param methodcd558958Use Node.ID for anchor ID5ef52294Add Node.ID37fb2d43helpers: Ignore cache for Pygments when flag setc0cf1a7eFix section menus for lazy bloggerdde967d8chugofs: Add package doc16ee8566create: Add package doc257dee53bufpool: Add package doc4d34a98aAdd GoDocs badgeff7eec2fdocs: Regenerate the commands docsb7efbdc1hugolib: Add option to disable rendering of 404 page72bda5adMove section initialization to Site.assembleSections8fe48a65Fix potential data race in test39c74b70docs: Add commercial services to the "Tools" section51ee3fc7docs: Document how to install dependencies for tests88a07b75docs: Fix missing step in Windows version check instructions65f94270docs: Document Go 1.6's new ability to trim whitespacee4d328d8docs: Fix Go version in install guideac1ec5c7docs: Remove remaining Mercurial references9f6b5ad3Save auto-detected markup type in Page.Markupe6e98bf5docs: Remove Mercurial from contribution tutorial6c900380tpl: Add replaceRE to the "smoke tests"f2ff77f3Make Hugo build without Mercurialebf3cef1docs: Add "How to contribute to Hugo" tutorial970f15cfdocs: Use HTTPS links in README where appropriated3e82950commands: Add helpful instuctions after "hugo new site"1c3c148bhugolib: Un-export internal Site-methods16ad6281docs: Fix references to section list templates6d2898b3docs: Correct date for proper sorting in showcase18738266docs: Add one more quoteef933e4adocs: Limit the quotes on front page to the last two years40f62a86docs: Use data folder for website carousel1648e327Document and clean SourceRelativeLinksEval code819271cbRe-export the methods used in page group tests3950b137hugolib: Camelcase ALL_CAPS vars and const in tests05b88887huglib: Add even more missing GoDoc85bcac53source: Add missing GoDoc in Fileddd02b2fhugolib: Camel-case ALL_CAPS const in test98ee8c3fhugolib: Add GoDoc to pageGroup.go57c347e4hugofs: Fix GoDoc969f9311Build Hugo in Travis with race detection enabledfd5d5735Add go test -race to make check27f9e62bRemove Wercker badge5bfe16eftpl: Add findRE template func54750b07Do not create robots.txt by default43b5dfabDisable syntax guessing for PygmentsCodeFences by default0698f294docs: Add yushuangqi.com to the showcasedea06f86docs: embed YouTube video in Windows installation tutorial23046146docs: Update set PATH instructions for Windows21e0515fdocs: Fix menu in firefox1adf4035docs: Add alternative for Wordpress importf0dbf2c8tpl: Add the other test case for hasPrefixaaee0385tpl: Sort the smoke tests80d02a14tpl: Add hasPrefix to the template funcs' "smoke test"4502c4e3docs: Add documentation for hasPrefix template funcfe929114tpl: Fix panic in sort of nil sequenced15fda50tpl: Fix panic in pairList.Less7d5c9fbfMake ByCount sort consistentlyc6c2c689hugofs: Add missing not nil checks to testsb678e90dUse to most specific interface in WriteDestPagec2277fcbdocs: Add doc and a test for readDircb89ae63tpl: Make readDir use the WorkingDir fs4f66f790Add readFile template funca89035bddocs: Mention CLA in the showcase contribution guidelines6a3a6f68docs: Remove incorrent reference to list.html93e41a1fdocs: Fix typo in templates/functions.mdd65fbfe1docs: Add surge.sh to main page of static site hosterseffaf6c2docs: Document GitHub flavoured code fences Fixes #1259e35a6921docs: Document lastmod variable Fixes #135150506ebedocs: Document the split function Fixes #19974c95b700docs: Add silvergeko.it to the showcase79af7143docs: Add robertbasic.com to the showcasedbfc7ea0Fix error handling in SymbolicWalkbfe80094helpers: Fix SymbolicWalk for the root folder977b0e34docs: Adapt commit message for showcase additions8890885adocs: Add search form powered by Algolia8aec5ee2hugolib: Some more unexports7c81c86bcommands: Apply Golint rules5d3705dfhelpers: Apply GoLint rules7fa2cec9tpl: Small Golint fixesb71f391cparser: Remove unused vars6dbae7b6Be explicit about the type in Scratch testd7701305hugolib: Remove unused Tmpl on Pagec846b051Do not use defer for unlocking in Scratchfa1a9653hugolib: Taxonomy GoDoc cleanupb5bced1dAdd a simple benchmark for Scratch7c84e6b3hugolib: Even more Golint fixes3e77886ahelpers: Fix GoDoc in Hugo version constantsa7953e25commands: Apply Golint rules to hugo.go3bbfd991hugolib: Apply Golint rules to rss_test.gob8bf01cdhugolib: Add missing GoDoc in pagination.goc2c73c2bhugolib: Some more GoLint fixes218fceaclivereload: Add missing GoDoce467d233hugoblib: Clean up the time tests94409072transform: Group vars and consts in chain_testc7869fd7transform: Clean up the var naming mess in chain_testa6de8dfbhugolib: Some more Golint fixesdac34f9bhugolib: Fix spelling mistakec31fa378hugolib: Add Godoc to pageSortc20dee9dparser: Make the constant vars ... constantsbf76e744parser: Fix ALL_CAPS var names in test1cb7ed6aparser: Spring code cleaning937592cbhugolib: Fix some more Golint warnings8a60571fhelpers: Fix and add Godoc in path*6ff2e1dbhelpers: Remove the else in MakePathSanitizedfaf2e506Do some minor code cleaning of Site626874b9transform: Golint fixes67289033target: Fix some Golint warningsdc7d8a9eSpring cleaning of the menu code4f00f1c9heloers: Add a linefeed to make Golint happy9cf93e11commands: Fix remaining Golint warningda4d4164utils: Add godocdf92fc31hugolib: Fix Java-styled all-caps constsb0e21f96helpers: Silence some Golint warnings283b8663commands: Do not use named return vals in Jekyll import35b79824Check returned error in Scratch-test691c2ea9Do make check in Travisb319c189source: Consolidate if conditionsc54df37fsource: Remove unnecessary else conditionb1b7ac7ehugolib: Use field keys in composite literalsb9127ecchelpers: Apply gofmte8cf8b40hugo: Add check tasks to Makefile048e0742Add Scratch to shortcodede8fc876Re-render shortcode on template or data file changee5e1bcc2Add plainify template functione5aa4774Add support for symbolic links for content, layout, static, theme6258d48bUtils methods refactored for readabilityc42982f7Add '+' as one of the valid characters in urls specified in the front matter Fixes #129002effd9dProtect against concurrent Scratch read and writef52b040edocs: Draft of 0.16 release notesd45b55bdhelpers: Rename getMmarkHtmlRenderer to getMmarkHTMLRendererbec1ac7blivereload: Run go fmt on connection.go9323707bcreate: Refactor NewContent to be testablebafb7717livereload: Simplify conditional2c5e4f76helpers: Support EXTENSION_BACKSLASH_LINE_BREAK for Blackfriday4c4ce552helpers: Fix minor typo in content_test.go0a768ec9Simplify GetDottedRelativePath8d86f1ecReturn early from parseOptions02e50c01Remove duplicate doArithmetic42b302fcRevert "Add Codebeat badge"3529152eReturn early from appendThemeTemplatesc50c6687Add Codebeat badge0ec8fc54Add Go Report Card badge to README21054f73source: Consolidate filepath.Split callsdf44b193tpl: Send actual values to in from intersect60055827tpl: Add missing printf param in t.Errorf callb0326a1ctpl: Treat booleans as set in default functionb5c718a4docs: Fix typos in functions.md and contributing.md575ae1b3Remove CircleCI badge for now58802de3No block support in shortcodes3a2a4c3btpl: Make the safeHTML and cousins accept more than strings70739c97Remove unnecessary type conversions3a82ae71parser: Unexport some internals5d915e7ehelpers: Unexport some internalsaedb13b2tpl: Fix race condition in regexp cachef6c3ca8btransform: Remove unused code263daaeatarget: Remove unused code4ada1cabsource: Remove unused codedf3f2af0parser: Remove unused codedea185aahugolib: Remove unused codec21dc16dcommands: Remove unused code91ffc76bhelpers: Remove unused code0fb31e4aCreate an alias from shortcode.Page.Site to shortcode.Site734dd1c4Bump Pygment version to 2.1.3542e220cMake tests green on both Pygments 2.0.2 and 2.1.3988962e8Add Pygments 2.0.2 to CircleCI build989c7487Add emojify to the template func smoke tests612c6114Docs: move tutorial screenshots in their own subfoldera103d581Docs: update Windows install instructions6fb4e071Docs: add Aerobatic as a deployment option in the Introductiond9049752Docs: add tutorial for Hosting on Bitbucket153dccc0Add debugging steps for no variables defined0ab41624Ability to config layout and content dir via clicafb7847Add emoji support5926c6c8Update showcase entry and article link to softinio.comb8d36512tpl: Add replaceRE functione9008b91Allow picking a specific file out of a gist7cd69aaaExit with error code on any error077b0fa7Add package prefix to the commit message guidelines0667d8a0Add engineering.mongodb.com to the showcase941b4caftpl: Add Copyright reference to the Go authors6cb032b6Docs: use Shekhar Gulati's Hugo tutorial as quickstart guide2d0650dbtpl: Add custom index functionf3f9763atpl: Add time note to default func description09c8c17btpl: fix default function0743646fdocs: add better default examplece9ee3cftpl: Add default function09624708Make absURL properly handle baseURL with path component94c3825eAdd md5 and sha1 template funcsbe3519faUse default sitemap configuration for homepage0945673fUpdate Dockerfile to use golang:1.6 base imagea2abad96Add support for Go 1.6 block keyword in templates924028a9Fix for page in multiple menus973393c9Create template clone for late template execution9896cd00Add reference to parent shortcode866176beDocs: fix missing words, tense in datadrivencontent.md7705e32eResize showcase thumbnail of h10n.me0f486313Add viglug website to showcase64ed64d9Add h10n.me to the showcase2a75e970Add fale.io website to showcase429b669adoc: Correct Scratch slice examplec7d22604doc: Add some Scratch slice samplesc7acc318Add some missing resets on rebuildeaba04e8Add list support in Scratch435e996cAdd jsonify template funcc8c6f5d0Add json mime extension typed774b142Make where accept slice4e32dc80Simplify the IsHome test cases023992abUnexport the target handlers27f8d8f9Allow URL with extension in frontmatter3c100cc3tpl: Unexport the rest of the internal template funcsf6591ecatpl: Add some dateFormat testcases with both time and date8aa90f2bTry both prepped and unprepped taxonomy keysccd2f4c3Prevent capitalized taxonomy labelse85b821dtpl: Fix broken chomp testf223f17ctpl: Make chomp return template.HTMLdaaf4eb3tpl: Add integration tests for most of the template funcs examples in doc80e1fd29Log fsync errors5b065a27Some missing shortcode replacements7f682d78Fix shortcode handling in RSTcc38a40fDocs: fix typo in tools sectione2965a35Remove superfluous FontAwesome files6b922750Revert "Create template clone for late template execution"93b04e67Create template clone for late template execution80460315Check for the presence of pages before setting dates75cf3243Set Date and Lastmod for main home page1f61f403Use flagChanged in all placesc1f8b188Add template function slice9349a889Do not try to find available port if set by userff4ca992Press: add "Comparison site built with Hugo"455df107Optimize replaceShortcodeTokens83759953Enlarge data in BenchmarkReplaceShortcodeTokensac2eaca0Press: add tutorial written by Shekhar Gulatic59bdc20Press: add article from sitelabs.esd1bf2f54Docs: fix typo in introduction.md086d6540Add cdnoverview.com to the showcase060f0206Docs: remove .Taxonomies from Page variablesd607f4c7Docs: fix small typos in functions.md3749dc76Docs: add "Minify Hugo Generated HTML" to presse9853642Listen channel before sending values to it253a6188Go 1.6 is out!284e959fClose file handle when finished reading filedf17fae5Docs: add hugo-lunr to the tools section50182cd0Remove superfluous Errorfc1e43095Clean up the trim template func test8c840480Force full rebuild when site config changesad176055Export MainSite varce7c2671Docs: clarify that Amazon WS is, actually, AWS4ecf019eAdd gntech.se to the showcase2b1ad546Docs: fix typo in YouTube shortcode descriptionbac1ba46Fix spelling and go vet errors0d415e45Link Gitter as Dev Chat in README21b0aa86Restore the wercker status badge to original small size06e90b12Add documentation for Google Analytics internal templatea0eec02bSet the wercker badge to track the aaster branch only207a574fDocs: fix Disqus shortname referencecfbae7cedocs: Add guideline for showcase additions4a15051eCrop, resize and optimize shelan-tn.png2d11551cIgnore temporary file "4913" created by Vim42f43ad4Add jorgennilsson.com to showcases28e6e19dFix git commit blog article link8fe10708Prevent confusing template errors when seq is nil2b3b90a6Add test for Hugo hanging up with empty contentd1b0290fAdd shelan.org to showcase page2b0fad79tpl: Add two more doArithmetic test casesf90b45f7tpl: Test with nil value in first, last, after and shuffle3cc468a8tpl: Add missing test variants for slicestr05c8bccfhugolib: Add test for parseSitemapb3c2d90btpl: Add missing substr test variants4dcb63c2tpl: Add highlight test0a8583a4tpl: Add missing base64 tests0888ddd0tpl: Add tests for word and rune countingec49dbb8tpl: Consolidate and complete the Inflect tests1e8b4d9cAdd some missing doArithmetic test cases0f6c8439Add missing menu testsc462440dAdd Page tests for simple methods66570d2fAdd Node tests for simple methods75044c19Add menu sort tests5995eaaatpl: Unexport all template funcsd1d7702cAdd a benefit and a simple example to return current year49c2761bdocs: Fix typo: Janapese → Japanese0586bf0dUse filepath.Join in locale resource getting8d8e9ddeMinor cleanup of some of the resource getting codeb3a70abetpl: Complete coverage for Humanize7c3dceeaFix buggy Menu.Limit()a95426d4Remove Printf in test88a320fbFix buggy Pages.Limitb21d280ctransform: Complete test statement coverage08b582e1Only do one livereload replacementdd1db334transform: Add missing test case in livereloadinject96e99045transform: Add missing test case for NewEmptyTransforms21cb5264bufferpool: Add test1f326ad9Fix bash-completion for Hugo builder flags such as --theme45df4596tpl: Add humanize func and cleanup linte95f3af9helpers: Test coverage increase318a9845Apply gofmt -seebf00f7Re-export HugoCmd08670e6aFix README.md to list the correct -ldflags for Go 1.5+ed23711eOptimize seven recently added Showcase thumbnails61197f9fOrder the hugo comand flag vars74539deaUnexport the remaining vars in hugo commanda89b2f41commands: Get BaseURL from viper in server mode792b2438Add --renderToMemory as an additional Travis build step3b596b85Add renderToMemory flag87ca0d0cClean flagsbd0176a5Add CONTRIBUTING.md447228a7Revise README.md emphasizing "good commit message"8f368114Update Travis CI status in README.md to track master branch only5a7837cdAdded showcase for datapipelinearachitect.com868d0745Added showcase for davidrallen.com68e2e63dFix Hugo hang up with empty content directoryec02b990Fixed example and cross-reference in content/variables.md243fbbf0Update lastmod date and screenshot for Rick Cogley site9b8d2ce5Remove destination from config file docs9015aa5bDocs: fix some typos in templates/variables.md57eebbf2Use FEEDBACK instead of ERROR for empty home page warningca0c67dcFix a minor typo discovered by Lintian (Debian)817d6948Expanded the Page Params section in variables.mdd158f7e3Provide more detail on static sync when running with verbosecd36d752Add autostart option to YouTube shortcodee8eb6181Do not call watchConfig() when not in watch modec438f456Add flag --cleanDestinationDir=false to retain prior behavior5def6d9aMake the watch logger less chatty3054a461Make the DistinctErrorLogger more generic3b3e771dCheck for exported fields in embedded structs12876ec9Fix hugo benchmarkd08e4c87Rewrite commentary on static event handlingb0b4b821Permit directory removal during static syncdb18fd15Ignore .DS_Store changes (thumbnail cache file on mac)9413cf84Handle self rename operations gracefully74c90553Static file incremental sync improvements in tandem with Afero improvements7e196a82Handle remove & rename source operations incrementallye01c3409A single file can be replaced in site.Files45e50914Process only the source content that has changed9f3796a3Read/reread individual source content files next is incremental conversionca6ca4f4Separate handling content, data and template changesbcc42c05Separate reading source and processing source operationsf3aa93faIgnore temp files created by IntelliJ when saving0525fbddAdd leepenney.com to showcase pageeae46bdcAdd Web Study List to showcase page8537cecbDocs: add Hugopit to tools sectione27beadfAdd Rakuten Tech Blog in showcase pageca8d187badd javaunion in showcase3526afc7Fix some Go vet errors58a183c3Docs: Add doc for string and int75ba84acAdd int and string cast template funcsf89eb349Docs: Enable plain id anchors78f9bf24Add one more menu testab70e6f5Add menu test for external URLdd85c290Docs: Add missing "-b master" parameter to "git submodule add" commande69e276aUpdate Travis config to Go 1.5.3e8ca52e9Add one more temporary template test for linux/armbca2d38eAdd temporary template test for linux/armed3015c3update server to match latest aferodd1d6556Docs: Change the pseudo-absolute path to a relative one082476e7Docs: add emilyhorsman.com (buttercup theme) to showcase1ce184b7Add some p-wrap shortcode tests48870fefGroup vars in paginatorb47652fbDocs: add panel showing the last revision of a page2c661674Docs: Copyedit extras/robots-txt.md01f71babdocs: Add lastmod to content files9d70e780Update press.md9a6dc6c7Add embeded template for robots.txt7c5a1fd1Replace *bytes.Buffer with io.Writer in rendering4c596483Update and refactor to ack Go Authors6a23cd65Docs: Update copyright year on gohugo.io front page851c16efDocs: Run "brew update" before "brew install hugo"9ff36c5aAdd some trailing newline shortcode tests7bc5d366Use a Docker container to build hugobc48b460Added documentation about variable scoping in "partials".8f8120baAdded "Caddy server"'s handling of 404 errors.dcad0660Small refactor: don't call `p.Permalink()` for all aliases, call it only once and only if necessary.0bb3b49cUpdate doc to reflect default value of watch variable6cdb8109Allow renaming of sitemap.xml26d23f7fadded remaining relevant optionse904ccffadded more pygments opts9008ac0bRename random to shuffle. Remove count parameteter to simplify its role. Add tests for randomising.302a6ac7Add Random function to template functionsb1f2b433Fix /.xml RSSLink when uglyurls are enabledff28120eAdded async version of Google Analytics internal template8f6f1310Copy static files changedf310492cAdd to press.md two articles about Hugo on AWS Lambdace0304a1Change Gitter badge to "gitter | dev chat" in README.mdb309fe85Update press.mddfa34afdAdd template funcs countwords and countrunes2e92f368Add hasPrefix template function.0f6b334bSource file based relative linkingb78f13b0Write a simplistic test for site.refLink47587321Add themesDir option to configuration40fccf22Fixes #1292b56362deDocs: add hugodeploy to tools section3b2a78baAdd to press.md Beginners Tutorial for Hugo (German)fc627d55Docs: remove unnecessary --watch flag796ef3a3Docs: add cross-references to installation guidesf807953aUpdate Hugo examplescd54042cAdd Coding Journal (blog.kulman.sk) to the Showcase1d6286b0update to use cobra's sub package doca291f3c5Copy only the static files changed277425baIgnore temp files created by IntelliJ when savingcb8f4591Docs: Add nohighlight shortcode and improve formatting22bd4850Docs: Add lang attribute to Chinese and Japanese Press entriesea75985cUpdate embedded livereload.js to 2.2.1 in livereload.go5b1261c4Upgrade Bootswatch, Font Awesome and jQuery in examples/blog7cf7f85aDocs: Upgrade highlight.js to 9.0.0df92a6b9Docs: Upgrade InstantClick from 3.0.1 to 3.1.0aee92f2aDocs: Upgrade livereload.js from post-2.0.8 to 2.2.123abad7bDocs: Upgrade Owl Carousel to 2.0.0-beta.3 (2015-06-19)4b521b4fDocs: Upgrade jquery.scrollTo from 1.4.6 to 2.1.2cca49ad0Docs: Correct file permissions from 0755 to 0644f6f0111dDocs: Rebase bootstrap-gohugo.css on Bootstrap v3.3.688343144Docs: Rename bootstrap-theme.css to bootstrap-gohugo.cssad6717bdDocs: Upgrade Bootstrap from v3.2.0 to v3.3.6f8f128a0Docs: Remove octicons fonts7c84ad56Docs: Remove unused GitHub:buttons files217d25f5Docs: Upgrade Font Awesome from 4.1.0 to 4.5.0a84d8212Upgrade jQuery 2.1.1 to 2.1.4 in doc7a5a52f4Clean up the loop counter variables confusion in TestPageCachef24ffc9cDocs: Allow HTML in Showcase titlese1af7cb9Use MkdirAll instead of Mkdir in `hugo gen doc`de82404dFix hugo server "Watching for changes" path displaya1d232f4Docs: Make <hr> slightly darker on gohugo.io00fc038dDocument 32-bit `hugo server` crash in v0.15 Release Note5af8cc29Add gadgetplayboy.com to Showcase and an article to Pressfe7ca7d7Fix build13d14ab9Remove "Host:" prefix from Host headerdd2ab282Correct the strings.Contains syntax in failing test31035f8aFix remote test on Go 1.489f8fa58Set the request Host on http test server9edc58a0Fix failing template related tests in Go 1.68cea4288Fix data race in non-renderable pages0c01fef3Fix 2 data races in TestPageCache32da9b20Docs: add hugo-lambda to tools section3574304cImprove some random feedback messages9c39593dMove cobra.MousetrapHelpText to hugo_windows.go70510433Docs: Enhance contrast and increase font-weight868e4798Fix formatting of "Installing on Windows" tutorial67b4c524Regenerate the commands section of docc1e134f1Add `--source` flag back to `hugo new` command41a3af1aUse absolute path when editing with editor78576019Docs: reference Jekyll import command in tools sectionebc187b4Docs: add Contentful converter to tools sectiond1bec542Do not fail on unknown Jekyll filed5ebf648Remove/update outdated links in Press and Showcase9569d116Duplicate p.Description in Params map38c5db98Added a missing closing tagf22d59bbRevise docs/content/tools/index.md (minor fixes)1469ce0eRemove Duplicate "Editor Plugins" Section280b2f29Document PreserveTaxonomyNames4a2623c8Regenerate the commands section of doc768370a5Docs: remove references to dynamic CMS products9ae07c4fDocs: document Node.IsHome8509727fAdd copyright header to that source files that don’t have one.e29ede70Fix some of the "new site" testsb81fc1beadd more architectures to .goxc6042fc2bmove some of the path helper utilities to afero and provide wrappers in Hugo.de14ceecUpdate "Join Chat" to "Dev Chat"56d6c0beTurn off failing new site testf3c74c9dAdd boolean value comparison to where tpl functione445c35dFix copyright headers in source filesf13db932Sort and remove "" from "Available templates" listd35d8206Remove transformation of menu URLsf6fdfcd4Added 'themes' as a default new site directory6a519e69Update Travis config to Go 1.5.2cd062623Fix crash with "config", "check" and "benchmark"69c28985Fix broken Highlight testc1b5a48fAdd sanity checks for `hugo import jekyll`00d04774Change most global flags into local onesc9526f6eRevise format for "Unable to locate Config file" errordf85e5a0Switch to container-based Travisbe28d9d9Fix some errors with format patternsf363faadAdd a number sign "#" before a GitHub issue number6812229bAdd gh shortcode to docs sited48781baOne more error fix in the server commandc5287e78Some more error fixes in commands3f0f7eedImprove error handling in commands6959b7faUpdate external tutorial links in usage.md75c61236Move `import jekyll` functions to import_jekyll.go666ddd23Enable dirname and filename completion for more flags0d1d33d7Print error when /index.html is zero-lengthf8302768Run `go fmt hugolib/site.go`afbc18c0Bump min_version to 0.15 for `hugo new theme`e9894683Make noTimes command flag work6c810314Copy static dir files without theme's static dirc5e68ba1Fix typo in "Creating a New Theme"91771ee3Add Draft page variable to docsb0b6a8c7Use .Site.Pages in the documentation examples instead of .Site.Recentd7ef272aAdd Camunda blog and docs showcasesb557f624Change plainIdAnchors to plainIDAnchors in docs249cd625Copyedit the shortcodes documentation some more2e3d5c2dDocs: improve shortcodes pagecf732940Remove an erroneous "$" prompt in quickstart guidec83e10a4Added the command in the documentation.50b5d0afSupport setting target directory in `hugo gen man`09379e89Update for version 0.162519b707Docs: remove note about config changes and manual livereloadffb1a96eDocs: improve usage.md37676a25Docs: improve quickstart guide72a66972Update press.md26af48a5Add note in doc about Jekyll importf77a899dRegenerate the commands section of docd356720fVersion bump to 0.16-DEV6faf1d01version bump to v0.159c1319cdUpdate license file in the docs/website to apache9410d25eUpdate release notes with additional new features171fb883Update and reorganize 0.15 release notes0f11eb4fMake the release note about renderToDisk more consise234fac4aUpdate release notes311307c9Add IsNamedParams property in shortcodes86dcac61Add documentation for built-in shortcodes7d31d5f5Add shortcode for tweetse03f27ccAdd shortcode for github gists3027b151Add shortcode for vimeo4424288dAdd shortcode for youtubecc3f52b9Add shortcode for speakerdeckfe2a9fa2Update shortcode docs with .IsNamedParamsf045d7a6Change the license to Apache 2.0b00771caSimplify ExtractRootPathsc3931ef7Add PygmentsOptions option99acbb2ePermalink on Node and Page should be of string5838420aMove blackfriday site-wide config loading to NewBlackFriday()fde47c5eAdd shortcode IsNamedParams property3d09de89Restructure the gen commands831e9368Improve "watching for ..." logging098a0c81Add commands/genman.go to autogenerate man pages87274755Fix missing word in code comment (my own fault)6fa7f2acAvoid multiple locks for shortcode templatec5f40e8bImprove RW-locking of template in shortcode handling58c446f5Fix recently introduced new data race in the shortcode handling5c723401Copyedit long help message in commands/server.go3abb2675Add RSSLink to SiteInfoafbd52f7Apply absURL on social tag urls05c29ad5Return error if shortcode template.Tree is nile59aabcfdocs: Change "Github" to "GitHub"a871c87fdocs: Optimize a few large showcase thumbnail PNGs2e1d2ba0Add Go in 5 minutes to the showcasesa5bd101dDocs: fix typo in template function sectionc5a4c07bAdd SafeJS template function7c9a2dfeAdd increased time.Time support to the 0.15 release notesf6ba48f2Update Travis 1.4.2 > 1.4.3f99730e8fix broken image in showcase83f19d8dfixed documentation link923e4557Add Arrested DevOps site to Showcase97d06895Hugo server watch by default35abd179Add time.Time support in ge, gt, le, lt8d8fa722Remove some superficial tests3f5ddd52Revert "Disable render-to-memory on Windows"91e0c2b1Disable render-to-memory on Windows4679fbeeDo not rebuild on extra Spotlight filesystem eventsb08d9f26Make replaceShortcodeTokens rewrite the input slice4ecf56b8Add latest review from Smashing Magazine to Press pagedf824fa3Hugo server renders and serves from memory by default (30%+ improvement)e1618e9dpermit the notimes flag on hugo servercb48425fNo double slash when destination set to '/'ef0b9b51Handle sync (file copy) errors better)18a29964Fix trivial typos in code452ffab4Copyedit docs/content/tools/index.md2fec32a2Add @wicast’s "Hugo is cool" post to Press pageacd720dfAdd docs/data/titles.toml to set title "Site Showcase"5c6d8c57Add ReadText project to Site Showcase39933111Adding LosslessLife blog to showcase.28436059Emphasize that commit message titles should start with a capital letter619c16fdre-simplify SafeHTML function1a26e351Docs: add hugofy to tools5c1204c2simplify rssuri logic062f6c33rewrite safeHTML functiondcf1f96cRevert "Update Go release version to 1.5.2 in Travis config"53a5932fGet rid of allocation in the BenchmarkReplaceShortcodeTokens itselfd7588facDocs: fix typo in tools sectionb8effd8aDocs: add hugofy to toolsb4ebd0ebUpdate release notes8e68a648Adding article about moving to hugoa50133ffImprove the server usage output3bbd02a1Print parse errors from Viper469d268cdoc: Add new article by Fabiano Frizzo to Press30ebf6b8Update Go release version to 1.5.2 in Travis config139be09fFix GroupByParam to return original param stringbccf957eAdd support for dynamic reloading of config file when watching488966dcAdd hugo theme site to the sidebar570713a4Use Identifier as last sort resort for default menu sort01c87d2dSmall Doc Changes1758db29Cosmetic change in README to trigger new build341dcc47Docs: fix broken links9dbb6dc5Add internal Google Analytics templateca55ea50Improvements to Automated Deployments tutorial5bda0398Export Page.Layoute1729935doc: Add new article by Thomas Peham to Press08b3004fUpdate link to S3 deploy instructions217ffa87Fix doc render on Firefoxc8f2a574Fixed link to Google Prettify42453357add bugtrackers.io to hugo docs showcases277d0ae4Fix spell mistake in variables.md1ce3bb22add ninjaducks.in to showcase83e46555Disable directory listing for Hugo file server50c819ceRemove dots from snippets.3d96dfc9Docs: fix typo under tools section6c6905d5Fix missing "]" in README.md in commit22427122242712bAdd CircleCI status badge to README.mde95db67bAdd smartDashes flag for Blackfriday6b34a4e4Remove anchor from fork link in READMEf77279bbTurn all README headlines into imperative mode4974a62cTrim down 'Adding Compile Information to Hugo' in README5cf1475eImprove README36adb5fbPreserve Unicode marks in MakePath9d603ce8Show usage when new site creation failsab7223dfImprove error message on new site command5e97cf30Add force flag3a412543The missing static directory shouldn't fail the build4e9a5d8bFix some typos in docs0c66ad87Add CLA assist to the contribution workflow in READMEfb0e17a3Update README.md698019a5Disable LiveReload when Hugo is not running as a serveref4dfcecLoad livereload.js from "/"0f438d18Create minimal default.md in archetype filebea7b2e2Fix typo in shortcode testsec9c6912Insert code tag for server-side syntax highlighting6a3aced1Rename prettiyPath to prettifyPath5619fe52Unexport internal path helper4c04d710Fix In func given an []interface{}ddd8c779Use https17fb7522Correct number of args to Errorf72f14a82Apply project wide go fmtc274e213Add Param to release notes65beca13Add Param to the docs078fad49Add Param(key) to Node and Page3586d77bDocs: Add pointers to the new themes.gohugo.io site63d9859cExpose canonifyURLs as a command flag002227e0Add `dict` func to release notes3a27cefeAdd dictionary function to be passed into a templateccd83c30Docs: Added `hasCJKLanguage` global config flag and `isCJKLanguage` FrontMatter7b4e4769Fix comment for NormalizeHugoFlagsc1a60732Remove Go 1.3 from README82333487WordCount and Summary support CJK Language2c045ac4Remove RuneCount from doc5ec6a61dAdd Mmark GitHub-flavoured markdown to release notesc2c694f1Add GitHub style code fence support to mmark7ecf2a55Docs: Added RIDING BYTES to Showcase Page622d8724Adding maximeguitare.com to showcaseb25ba8b0Let Cobra do the usage error loggingb9aaa007Improve command text for import commandac1e3c3cCapital J in Jekyll0387deeeAdd Jekyll import to release notes9a2f6c62Hugo import from jekyll08d41c3aFix strange carousel width on http://gohugo.io/218554e3Rename NormalizeHugoFlagsFunc to NormalizeHugoFlagsead339abis it .md instead of .ad?7fd42af3Used leading slash more consistentlyd06ebc98Marked the whole path as codedcd9c69aUse filepath as the last default sort key for pages7708d455Add the base64 template funcs to release notes79f8bb62Add base64Decode and base64Encode template functionsa1e32439Allow for any (short) line begining or ending with html commenta43b0376Change port number from 1414 to 1313 (default)82f770a6Remove superfluous `g` in docs493147a7Tools: Add more to tools to the list06caa025Fix typo in docs8d695ec5Add singularize template func751d4906Add pluralize template func74924dd5correct spelling for 'including' and 'counterpart'ab0d29aaPress: Update URL to Spencer Lyon’s “Hugo and GitHub Pages”740dc2caPress: New URL to Kenny Woo’s blog about Hugoc397c0b2dead link0bdb9b7dLink no longer works - Dead linkb29ca44cShow both baseURL and bind address in `hugo server` outputd984dde2Update .travis.yml for Go 1.5.1b5b8cc9bTest builds on OS Xc2a7c456Fix typo in terms.mde67bee93Revert "docs: Fix URL to yulinling.net (https → http) in Showcase"1abc12a9docs: Fix typo in url extrasca74dd23docs: Fix URL to yulinling.net (https → http) in Showcase68b8dd73Add yulinling.net to Showcasecd4f36badocs: Optimize recent thumbnail images in Showcase0a80ead5docs: Fix formatting in overview/usage.md397080eadocs: Add a few more blog articles to Press3679fe67Add "control code" and "trailing space" to alias validationf5308da3Move isThemeVsHugoVersionMismatch to /commandse71bef79Validate aliases to prevent directory traversal etc.db85299cComplete the Url-to-URL transition in docs29aa9baeComplete the Url-to-URL transition in testsd05b297eAdd helpers.NormalizeHugoFlagsFunc() to handle flag name changes833a396fDocs: extend the migration tool list and add a cross-reference in the start guide60f7394bDocs: Add a section about tools around Hugo0e1fd78fWordCount Summary support UTF-8 stringc7521b3ddocs: Change redirect documentation to aliasescf7318a0Convert example/blog to use new syntax for Hugo v0.14+cec9054bdocs: Remove empty sourceLink from two sites in Showcase93b38986Add FxSiteCompat.com to Showcase9e526b65fix showcase to render properlydaf5f32cAdding RichardSumilang.com to the showcases.aec0e17aDocs: Add Humboldtux.net to Showcase pagec7b701eaDocs: Add new french mag article by @humboldtux to Press page9f75a518Added details about generated files and development flowsfd7b3155Add a 404.html file if a new theme is createdd6f69455Update organization.mdbfa06fffshowcase layout improved when thumbnails are different proportions138ffefdAdd NoDesk to Showcaseea852b8dAdd NoDesk to Showcased584ca59Describe the use of custom archetypes in the docs16cbda97Add GreenITGlobe website for showcases page570d4e4cAdd Chinese Grammar to showcase1b8440afDocs: Add new blog post by @CoderZh to Press page52d94fa6Add config option "disablePathToLower"49fe04c0Correct check of published boolean311593bfAdd undocumented published setting to front matter5b90b388Unexport FileAndExtfd2fc1d3Polish 0.15 release notes1e06dfd1Add first draft of Hugo 0.15 Release Notes0c98d8e9Use LazyFileReader for reading file contents97eb55daAdd LazyFileReader type to source library3982854eUpdate Travis for Go 1.5c2869aeaFix -ldflags for Go 1.5e791835eFix typo, "delemiters" -> "delimiters"35ff685cUpdate press.md4047ca5cSearch current directory for config file by defaultdac9c0daUse cast.ToIntE for int conversions in substr and slicestr5b51b3b9Slicestr fix for other int type paramd313bc78Documentation update on Template Where Function for nil29c9a40aImplement `hugo --theme=[Tab][Tab]` bash completion7555e364Print feedback for `hugo genautocomplete`c69835daPrint feedback for `hugo gendoc`fee55191Use spf13/pflag's new SetAnnotation helper209166a2Added sitemap configuration documentation.caaf6370Added mention of .Data.Pages, removed duplicate .Site.Pages mention.cafcd190docs: Remove minodisk's http://dsk.mn/ from Showcase68b424c2docs: Clean up and align Showcase thumbnail images36b374f8docs: Add site title; set pluralizeListTitles = falseb14b9043Add Arqueart to Showcase8c3b6f8bCreate arqueart.mdee7dd292docs: More detailed explanation of .Site.LastChange6511e2c4Removed extra .Site.LastChange listing7a681035Doc for other supported formats (external helpers)04b4c996Reset Scratch for 404b05a292cRevert "Fix some Go code doc issues"0f1fb8c7Avoid panic in shortcode param handling35bb72c8Do not panic on index out of range in shortcode.Get2805a6f8Also rename readDir in docs shortcodecea82842Rename ReadDir to readDir15333270Make sort tpl func accept field/key chaining arg56534beaFix sort tpl func to return explicit type valuec7aa881dFix Unicode issue in Slicestr and Substrde7dd70bFix some Go code doc issues1583d8d0Add missing formatting directive in Printf call5b19a265docs: Extend documentation on Blackfriday options0b7229f7Add some float tests to TestArethmic4a2eda49Add option to disable Blackfriday Smartypantseb519afedocs: Fix typosab8e189adocs: Bolden the blackfriday flags to make them stand out5505ac0ddoc: Strip trailing whitespace; other revisionsb0416e9bStrip trailing whitespace in codef2ab0b26Improve formatting of Hugo command descriptionse64e571bBump `hugo new theme` template min_version to 0.1498659bf3Fix searching YAML/TOML delimiters in frontmatter4bed6962Add map support to scratch8d28686eTrim trailing spaces from YAML and TOML delimiters211b757f[Docs] Add <br> to an extra-long title in the Press page738f9561docs: add netlify article to press section252ea96dRemove deprecated fields and methods for v0.15b23b546aAsciidoc[tor]: use --no-header-footer option43891e39Always use the template provided in page.Render3037d200Fix inconsistent front matter handling81e69c41Add ReadDir function to list local files.72ecd0cdIgnore non-presence of "layouts" directory in watch logic Fixes #69118d69d7fFix periods in taxonomies create bad paths Fixes #1188c1a2b7a1Replace strings.Compare40efc867Fix sort test and title sort36e0d005Fall back to link title for default page sort6674189bThe guide is updated to fit the current Wercker interface and configurations. Wercker changed its interface and default infrastructure (Docker).da0715a0Remove point 7 in contributors guided25cd039Make small fixes to README file - Add a step to Contributor instructions for those modifying commands - Change forum link to http (https does not work) - Add "Sign the forum release thread" to contributor instructions027abcfbdocs: fix prev in highlightling9c8ce0d9Added szymonkatra.github.io site to showcasecdefb5a0Fix links to Ace and Amber pagesde38524cAdd scottcwilson.github.io to showcase site28020f86Move apply before cache put47e65c4adocs: Rename dynamic content to data-driven contenta9c5133aFix data races in sorting and Reverseea6ae769Fix broken test5cf0aa2fAdd benchmark for sort and reverseaca0f604source/File: Fix data racesdec9749bDocument Amber templates Fixes #10648a48412cOn error, return error message, not nilc00a1fcbAdd a check for the setting of watch flag in config file03a70161Let Amber template call Hugo's custom functionse3ea4b48Fix name logic for Amber templates7f1bcd89Fix link to front matter85f4935dFix unclear RSS template docsbfcf95b9Add mention about .Hugo.Generator in 'Creating a theme' sectionc8477c4fFix typo: "taxononomy" -> "taxonomy"1a94148dAdd paginator support for page groups2c22a8b7fix TestHomeNodeMenu test24757497Allow page.HasMenuCurrent() and node.HasMenuCurrent() to proceed with multi-level nested menus Currently HasMenuCurrent only process the first 2 levels.354192d2Log missing theme as FATAL029cdb68Checks to ensure theme directory, if specified, existsa2fa3895Fix log message in test3663828fOptimize RuneCount77c60a34Add RuneCount to Page90af334cOmit protocol from embedded font resourcesc4f81840Change arianv sourceLink to master branch88fe0e7cAdd learnoverpass5f69d3d6Add arianv6807151aadd a showcase of sa.muel.bec6d46ff2[Docs] Press page. Fix URLc139c6e1Add support for GitHub-flavoured markdown code fences for highlightingfdab1180If no language is provided to Pygments, then try and guess it450dc7a4Add a showcase of Kangkonaa9454124Add how-to for foreign language month names617fa2feAdd Rick and eSolia's sites to the Hugo docs showcase9b3d0cf5Added missing "Social" section to SiteInfo24c8226cDocument Page.RawContent in templates/variables/c9fc0e78Add Page.RawContent() to access raw Markdown as a string.dd732e84Add nil comparison to where tpl function033a13e1Fix watcher detecting changes as static when no themea509a232Add doc for new Blackfriday options483fc8faAdd config option for Blackfriday HTML_HREF_TARGET_BLANK05c07c56Add option to disable Blackfriday LaTeX style dashes664a9781404 is homeless50df3140added thumbnaild118d037Create mariosanchez.md1b50ccd1add vamp.io site as showcasec4ad8f64Use helpers.GetThemeDir() to find base templates.1058cb17Refactor theme path helper functions.0987e98dAdd support for baseof.ace templates in themes.29e786aaProper parsing structured array from yaml based FrontMattere764a6e6Use pooled buffer in replaceShortcodes67209dbfdocs: make the named value Data File example simplere96624ccUpdate datafiles.mdd4b6f9acFix map-order dependent menu testsc5072291Print URL when failing menu testdbd93f51Remove unused var004fcddcRemove superfluous p-tags around shortcodesae4f72b0Comment out mystery test6bcb7e83Revert "add preliminary support for content/index.md file to be homepage content"3eb301b5Revert "refactor and clean up site tests"f25ce7feRevert "Move matchRender to test helpers file"d770fa59Revert "Add tests for homepage content support"59c6ba4eRevert "Make .IsHome work when homepage as page"7e765cc1Make .IsHome work when homepage as page24351c58Add tests for homepage content support32d91d61Move matchRender to test helpers file99e25091refactor and clean up site tests5f84bc02add preliminary support for content/index.md file to be homepage content50269f25Remove superfluous return4b7c1342Make removal of accents in taxonomy and section paths optional847ad36eAdd new tutorial for multilingual sitescc9536ecUpdate docs for `last` template function0a2e5424Add `last` template function627d016cRefactor var name limit to index40a92a06Add `after` to template function documentationc335efddAdd `after` template function82cc1ac0Add Blackfriday definition lists extension supportbe6cf6a9Revert "Add some debug to failing menu test"becc627eAdd some debug to failing menu testbed8197dMove Viper reset to correct level in menu testsbeda46d2Reset Viper for every duplicate menu test iteration53c9e890Make sure target destination has the right path separator.3ab00e6eLet travis test against go-tipbee46915Temp remove tip from Travis51cabe6fFix substr tpl func's int type variant issuebe443452Silence chatty JSON testbeeae6abAdd some tests for IgnoreFilesbeaa1b3aAdd some docs for IgnoreFilesbec3f403Rename WatchIgnoreFiles to IgnoreFilesbed22788Add configurable list to ignore files in server watchcc5d63c3GetJSON/GetCSV: Add retry on invalid contentbe38acdcAdd PreserveTaxonomyNames flag3ea4df35Remove accents in URLsbe0903c7Fix FullFilePath3cee9b77Allow custom RSS Uri for section and taxonomy feeds2690a8c1Update introduction.mdbe0314b1Fix Windows Ace path issuee4ed9d6bAdd some Ace test casesbe45399cExtract Ace handling to a methodbe7404e3Support `Fish and Chips` sectionbe535832Add IsHomebe6dfcc4Add some missing page permalink test casesbe964e95Never remove trailing slash in RelPermalinkbeffe756docs: getting usage up to spec2a404752Add two articles about Hugo to the Press pagebeaa008cMake deprecated warning for this release more alertbe381683Hyphenate DEV version601a2ce1Add `time.Time` type support to `where` tpl funcbeaa09a7docs: add bepsays.com to showcase102a3b95Document techniques for debugging templates.cd06e89badding goxc config filed4de2615bumping master version to v0.15-DEV6af9d678Bump version to Hugo v0.14.0fa58ef53Add GopherCon to the showcase6f0b80c9Add GoGB to the showcase45efc5e4Add DavidePetilli to showcasefe38dc2fupdate release notes20cb4c93Add new directions for maintaining press pagef49b63a4Move press page to top level menu4a177396add dozens of articles to the press pagebeee679dUnexport filepath/path bridge typesbe79c35bPass RenderingContext by reference in Mmarkbefb54daApply gofmt -sbef34597Add Go 1.4.2 to Travis config4c850b69Update release notes in prep for v0.14.0bec697b0Remove unused Completed chan on Sitebe7c3bbbPrevent cyclic ref crash in JSON encodebe778c31docs: some more on absURL, relURLbe136607docs: add doc for substrbe4376a0docs: add doc for slicestrbe2e08c4docs: add doc for seqbe4a404fdocs: add ToC to some more pagesbe71fda5docs: avoid navbar hiding when jumping to in-page anchor0d65ca27Docs: Add taxonomy term variables to the list of vars.7125103bAdd ".Render" to the list of functions.321bac2fClarifying Edits for templates/rss.mdbe0784bbGrammar fix in error messagebe7f5a42Do not consider single.html for the home pagebe2842daFix formatting in hugo command descriptionbe831d74Fix CLI command description for the top levelfc946dedAdding default handler & tests Fixes #147fd5cf9acBetter organization of loading defaultsbdb187e4Merge branch 'master' of GitHub.com:spf13/hugoa584ff20Stop Viper from leaking across many of the tests (now tests pass regardless of order tested)be026278Add benchmark test for replaceShortcodeTokens599d1b97Add gendoc commandbe920fdbAdd a line in doc about the RelativeURL settingbe5f865cAdd bugfix to releasenotes2890b6dbFix UTF8 permalink8a96234bAdd Page tests with UTF8 pathsbefa26b1Remove trailing spaces in completionfile flagbe1bac9fAdd some bullet points to 0.14 rel notesbe9224d7Add Bash completion84f4c21dFix datePublished to publishdatebee9718aDo not shout about missing baseURL if relativeURLs is set6b5ed88cEdits on aliases, comments, theme customizing6453bb58Edit docs extras syntax highlighting.mdbeaa8b1bAdd support for URLs relative to context roote522e5f4Edits to templates/404.mdd0a4645aSet s.Info.LastChange to Lastmod3882e7ceAdd Lastmod fieldbe534a86Remove old baseline.txt with no current relevancebef92baaAdd convenience script to run benchmarksbe1a5662Only uglify 404.html on server rootbe1287fbAdd data-no-instant to livereload script tagbe5fa2f3docs: reverse taxonomy entriesd5c77bdfAllow to reverse taxonomy entries.be3a3506Allow forward slashes in Hugo new on Windowsbe72f234docs: Use ToC length to pick the compact versionbe823555Add doc for absURL and relURLbe4f4865Add ToC to long pagesbe16e5ffAdd absURL and relURL to release notesbec839e6Add relURL template funcbe0cbeeeAdd absURL template funcbec90e08Make page 1 alias uglybe0c1bfeAdd docs for Section Menu for “the Lazy Blogger”be7e746fAdd list of deprecated names to release notesbeb1735dAdd issue to release notes0e00ca6aFix paginator with uglyurlsbef496b9Fix .Truncated in manual summariesbe52eff6Some notes on 0.14 rel notesbe325a30Fix IsMenuCurrent for SectionPagesMenubef0f281Make sure that complete server URL is logged on startupfeba35cdAdded in set PATH and new site output.a52e508dUpdate test logs for uniformity and consistency2b91b480IsMenuCurrent now resolving correctly when baseUrl is not at the root pathb4871787add undraft command563a6302Very experimental support for mmarkd4acacd4Section menu for the lazy bloggerbeb4ab16Make RSS output test more realisticfd08e16eAdd RSSUri to specify the name of the RSS filebeccdc04Add bind to release notes2bfa9fb7Make server bind interface configurable.24d8ac1fFix multilingual styling with small screen.9cd8673fAdded missing files, make the site look better.9123ac55Fix multilingual site layouts/templates.3596b1b8Add blackfriday/ExtensionsMask option.ee5a1bbfAllow 'classprefix' pygments options.bec2c1e3Add shortcode support for HTML filesbea9280fDo not add trailing slash to baseURLbef3df74Polish absurlreplacerbe918d71Rename field i to the more descriptive idxbe57b1feabsurlreplacer: remove superfluous code, take 2be4ca217absurlreplacer: remove superfluous codebe96aacbAdd benchmark tests for srcset handlingbeb601c7Fix testdata: srcset items should be comma separated, according to specbee6a698canonifyurls in srcsetbe648260Disable faulty range validation in applybee521c6Try to make it more visible that you have to set baseUrlbe159278tpl: check that types in args match the target func's typebe049ff9absurl: export a base url var for testingbe9df847shortcodeparser: fix panic on slash following opening shortcode commentbe7b830ftpl: add sanity check to prevent panic in seq on big numsbe190fdbtpl: check for too many arguments in applybe017f18tpl: check slice bounds in slicestrbe3b8a13tpl: avoid panic on too few args to applybeacfcf8doc: move the index func reference to where it's usedda08fad5Add index reference to go template primer doc pagebe15b077Fix typo in testbee1358eReturn error from HandleShortcodesbe29c0bfPrint ERROR on theme vs Hugo version mismatcha8f91aceClarify partials folder subfolders9e13ac9aSingle rather than double backticks in types.md6b69f951Clarify hugo new command in types.mdbe2c67adFix broken Travis testsbeb32af7Do not fail on unknown files in /databe366bfepagination: export pager to make Golint happybe8e6d4fUse fmt.Errorf to make Golint happybe01f843Add shortcut to Scratch from shortcodebef25432doc: clarify Scratch usage in shortcodesbe62c948Check spelling and some minor additions to Ace docbe7c1e5dAdd doc for Ace templatesbeff6805Expand the ACE base template lookup patternbe46a4b9Polish func naming in shortcode handlingbed05307Remove unused types Shortcode and ShortcodeFuncbe0d9770Only write highlight to cache when CacheDir is setbee52f85Fix broken Highlight testbe6a92c8Temporarily disable Highlight testbe24457aAdd more options to highlightbe540f5bFix potential Windows path issue with Pygments cache0fcb78e4Added isso as a Disqus alternative to the docs1b5b0b3aAdd "Google Cloud Storage" article to docs Press page1f4a3c1fTypo in mathjax.md3b1db70aAdd Google Cloud Storage to docbebb1b9dFix spelling mistake in commentbe31b9e2Add custom Windows mousestrap messagebe4a9dd5Remove section about the buildDate being configurablebe25acaeFix README part about missing Windows testsbe1b7f67Add git commit message guidelinebe2097e1tpl: split template.go42dcaabfDocument getenv template function9a499b56Add a section comparing the 'build' and 'server'6b50c8fbSort function names in templates documentation9de78aabdocs: how to compile on mac, fix minor errorsbeb66c19helpers: add some missing documentationbe57ec53Fix the last Go Vet errorbe01d048hugolib: make Page implement the ReaderFrom interfacebea42218helpers: fix some go vet errorsbea5feb3Return early from DistinctErrorLogger's Printf99a18b21List directories being watched when server is run72aa516cdocumentation: mention data files under liverloadbe627fa7Remove paragraph tags produced by markdownifybec9b92dMake contentTransformer names consistentbec4bdaeReturn error on wrong use of the Paginatorbec22f89Add pager size argument to paginator methods06d704f2Updates documentation with instructions for a Windows computer3b2e1006Capitalize singular0ab34523Updates documentation with instructions for a Mac6a539db5Update embedded rss.xml code in the docsbe21e2cbAdd some more corner tests for ReaderContainsbe1429faFix shortcode handling in ToCbe6696c3Handle views in combo with Ace base templatese8ca8602Hash all pygments parameters.beaf5db3Use helpers.FilePathSeparator const61a02c4dFix section name guessing on Windows15463d3dCache pygments rendering between runsbe8c0675Add support for Ace base and inner templates0921761eAdd missing ".adoc" extension in handler_page.gobe84f937Change to variadic int args in Slicestr5b0245caImplement substr template functionbeb423a2Rename Slice to Slicestrbe82b5a9Polish Slice docbe19f4ebRename Substr to Slicebe4fe8f8Polish Substr and Split tests04817c7bAdd Substr and Split template functions9cc3d67cPull Data Files tests into its own file1e8e5d4eFormat docs66cf3bdcRename interface contentRewriter to contentTransformerefb56477Change safeHTtml to safeHTML in sitemap templatea8bfaba0template: add some missing test cases for Firstb15d0a16transform: remove some superfluous int conversions658cfb28Remove URL param from exported AbsURL methodse7099cfaUn-export ContentReWriter98ee69bcWrite to rotating ContentReWriter in transformer chain9688ed25Comment out shaky Seq testf4244be0Calculate the next Hugo version in Deprecated3273fce0Refactor Hugo version49f20bbcAdd UrlPath to the deprecated liste39a258eImprove type handling in Seqb3bd71feUpdate Hugo docs with the initialisms suggested by golint8b8fb417More initialism corrections (golint)ca69cad8Press: Add "Migrating to Hugo From Octopress" by Nathan LeClairea220a3ba[Docs] Copyedit http://gohugo.io/extras/dynamiccontent/bcdad02cUse ReaderToString in site testse1340c06Fix crossrefs on Windowsa0447345Add "getenv" as an wrapper for os.Getenv32bf8b76removed duplicate word in readme27ed49e5Revert "Added image support to the sitemap.xml template"3c147bd4Added image support to the sitemap.xml template0be2aadeAdd Seq template func358dcce7Experimental AsciiDoc support with external helpersfbcda030Do not ERROR-log missing /data dirb190ad0fsource: add some test cases for Filef8a840a1Add double checking in Deprecated6e30c10dAdd deprecated loggerf848dc92[Docs] Update and expand http://gohugo.io/overview/usage/d3c0fde5Update press coverage: Fix URL; new tutorial in Chinese232398f1Remove trailing space from site build statistics67df33f5Correct initialisms as suggested by golint00f07c53doArithmetic: add test for division by zero43742e02Add some basic tests for doArithmeticb9b70fb6Skip directories like node_modules from the watchlistf85d1a7dparser: add some frontmatter test casesc641ffeaabsurlreplacer: write replacements directly to the byte buffer3ba279c2Do not parse backup files with trailing '~' as templates81695717Switch from fsnotify.v0 to fsnotify.v1 API (watcher)634548b9Add new min_version field to theme.toml template4784b63eAdd test cases for Ne and Eq type normalisation44cdb37bFix eq and ne tpl function issue91d16fbbFix UglyUrls on Windows602ceec0Handle 404 thread safely851badcbThere is only one s.PageTarget() - so we cannot change it, even tempoararily. We have to find another solution to this. ...63ffb916parser: apply some Golint rules81c41d6flivereload: apply some Golint rulesa91bcd85source: apply some Golint rulese007c9b2hugolib: apply some more Golint rules57590078menu: make receiver name on Page methods consistente24a7759page: make receiver name on Page methods consistent8539f781hugolib: apply some Hugolint rulesb9f8c0c1author: fix docbd2b679ehelpers: apply some Golint rulese685dfc0Apply some more Golint suggestions224a2ddfFix some Go Lint errors103ea842Fix errors reported by Go Vetc4c19ad3Prevent 404.html from prettifying into 404/index.html3343caccAvoid panic when pagination on 0 pages6e1b0e0cApply gofmt -s8557e2cbAdd benchmark for the shortcode lexerecb2aca6Update github-pages-blog.mdfb0facefTidying the Readme a bit more6c9bdc28Using a smaller Header Image8aa646ceFixing image in readme1e210a43Restructure top of Readme.mdfa5cbb2aMerge pull request #944 from gitter-badger/gitter-badge45d962c6Added Gitter badged5cb3695Update Readme.md with additional contribution guidesab5862cdAllow the same shortcode to be used with or without inline content241f9f9eImprove error message on missing shortcode inner content9d80ecb4Keep trailing slash when baseUrl contains a sub path176ce5deAllow hyphens in shortcode name967d001eUse osext on GitHubbb13d826[Docs] NetBSD and ARM pre-built binaries are already provided729a6739Bumping to version "v0.14-DEV"e43eabacUpdating the final release notes for v0.1388e7c031[Docs] Clarify the switch to `canonifyurls = false` as defaultac189fd5Update README.md and overview/installing.mddc7b7ef8Avoid race condition in target list initc33a8528Avoid race condition in isInnerShortcodea3892685Add trailing file separator to temp dirf0c8585bUse $.Paginator in template62752cfeReturn unmodified content if panic in LiveReloadInject4d708f09Add revocer in LiveReloadInjectd2e022f2Suppress errors for symbolic links witch point to a file.aeddaee9add note that running with watch doesn't produce a site suitable for deploymente31536ddAdd information to highlighting with Paymentsc4393257Adapt to relative path bug fix in purell41c0e82fMoved futured getSQL topic to another branchb209f443getJson and getCsv documentation proof reading by @msjulias4342dd84Update Dynamic Content docs48a6d447Update doc47b7cfebAdd getSQL ideafdf8db9cInitial doc file: Dynamic Content32d645d9Fix bug where running hugo without options causes to create $TMPDIR/hugo_cache/ directory.076b618fGetJson and GetCsv have now variadic URL parts so that you can submit pre or post parts of an URL. The parts will be joined to the final URL.10c2b41bAdd --ignoreCache CLI flag with description "Ignores the cache directory for reading but still writes to it" as @spf13 suggested.c168666bAdding getJson and getCsv to funcMap41a51681Fix bug on windows where the backslash got removed in func MakePath()5e2d3d2eMerge to stay up to date with current dev Feature: GetJson and GetJson in short codes or other layout files. For more details please see: http://cyrillschumacher.com/2014/12/21/dynamic-pages-with-gohugo.io/9bf223e5Quote strings in `hugo config` output82a08889Revert "Expansion of unit tests for utils/utils.go"c2e29138Fix canonifyurl vs schemaless links6b28e38cExpansion of unit tests for utils/utils.gocb9fa627[Docs] Minor copyediting of highlighting.mdbd0de85dAdd information to highlighting with Pygments1827680bList of variables09ed3c4bFixed a typo54e41768Make "Indexes" the alias and "Taxonomies" the canonical named33a42f1Merge branch 'master' of github.com:spf13/hugo159836edREADME.me: Add linefeed that got lost in the last commit63e7b970[Docs] Add pointers to roadmap; new tweet and articlef1fec88cImprove abs url replacement speed27c03a6dAdd benchmark for AbsUrlInXml366f9916Another link in the same pageb389a923Fixed invalid link to partials462e666fUpdate docs so that `figure` includes the `class` parameter.c14e7b10Add 'config' command to list site configurationd6f81c73Put back static theme conditionald10e05f2[commands/new.go] Update theme.toml etc.87975e04Remove nohup.out committed by accident48206833Doc Data Files: Add section about themes and expanded the example a bit12176323Remove now superfluous conditional8ed67169Fix broken data dir test8df59c81Temporarily disable broken testebcc1e66Add data files support in themes664fd991Change "ctrl+c" to "Ctrl+C"dbb86679Fix typo: GetJson -> GetCsv7e28db18Add showcase entry for consequently.orgfa71f6c1Make # survice Url cleaninge3daa359Update release notes for v0.1322d85c2aAvoid converting summary to []byte and back to string371c148cFix alias for data files doc03fff880Add docs for Data Files6afe70d5Better error message for data-file parsing errors1c50f775DataDir: Minor polish and add missing tests773812deReads data files inside data/ and makes data available in .Site.Data4c7e119c[Docs] Say which directory to clone the hugoThemes088d46a8parser.FormatSanitize() MetaDataFormat for date too08219161Use buffer pool in StripHTML5e34ae61Log ERROR on missing baseurl43e48a89Add benchmark test for StripHTML48b6777eFix Truncate2bee4a15Replace 4 strings.Replace with 1 strings.Replacer5df85770Add memprofile to pprof benchmarkf8704c1bAvoid calling strings.Fields multiple times with same content11a19e07Build PageMenus only oncedf734bc1Tighten README for the sloppy reader8b95cab9Avoid panic on unknown markupdd934481Scratch doc: Use the special $ variable to prevent confusion13d90094Use .Site.Params.description as fallback for social partialsb984ec96Optimize for the common case in Blackfriday configc5078093Print template parsing errors to aid troubleshootingd1364ffbFix defaults for Blackfridayf264076fAdd doc for Scratch420c9e4dAdd writable context to Node47c8f329Prevent site config being overwritten659f71e6[Docs] Fix more missing `.` in example `partial` calls20bed49fFixed syntax error in 404.html template codef4737689Updating shortcode imports & site test to work with new buffer pool functionse1e6aaedMerge branch 'master' of github.com:spf13/hugo4a9436c1Some more .Date.IsZero checks in internal templates230e7c02Remove _default prefix from SEO templates8db3c0b0page rendering and writing using BBP3d60955eUse .Date.IsZero to skip unset date in embedded templates35684e8fUse strings instead of byte arrays for replaceShortcodeTokens tests366c5572Use a regular expression in replaceShortcodeTokensb4c50728site's XML generation using BBP77074127page source creation using BBP4828fee1transform chain using BBP5441fc5dtemplate render with BBP2f2297bdshortcodes using BBP66ed5c5eAdding BufferPool. Implementing BP in ReaderTo{Bytes,String}().ba53799furl_path => urlPath523f38a9Fix for issue 839 and 490 on Windowsd397bc4f[Docs] Complete the transition from "indexes" to "taxonomies" (almost)ba44e860[Docs] Copyediting82d4b8ab[Docs] Use OptiPNG to shrink PNG images losslessly8e6cbe82Some housekeeping of the Showcase and Press pages831fbd5eAdd .mailmap to get a more correct author logee1045adignore root path, no need strip traling slash2d8e15a5Version uses binary name instead of hugo06b1a883Added three videos to documentation.e52a76f5Use runtime.GOOS to identify Windows specific path tests0b5f8c8c[doc] Improve paginator doc7c74a77dReplace assert.Equal(true/false) with assert.True/False251f5e9dDo not panic on permission denied8ad4fd05Split Windows and Unix specific path testsb155e8b4Temporarily comment out breaking Windows test casebedc2d84Introduce FilepathPathBridge5f9596e6Add more tests to helperde76d4a8Improve pagination testing0c229707Linkify release notesfb594fc6Set detault for Paginate to 10a6d22bcfAdd documentation for paginationc0fbe614Add Bootstrap-compatible pagination.html3628d0bbAdd pagination to release notes37445bc6Add pagination support for home page, sections and taxonomies407e80a9Add site-wide/per-page [blackfriday] `extensions` option39b2cdecWrong URL for Github Pagese72ce89aMove s.prepUrl() before prepending BaseUrl.ea72f15fCorrect wercker URL57b4f331Fix inverse notationf6c0b472Make Blackfriday smart fractions to really default to `true`eb686352Add site-wide/per-page [blackfriday] `fractions` option803865f8Fix for page.GetParam() for JSON and TOML mapsa0c6dba3Upgrade from gopkg.in/yaml.v1 to gopkg.in/yaml.v2bd1b019fHandle empty front matter in archetype.b345ca26[Docs]: Add new press/blog coverage about Hugo1b42dc57Fix RelPermalink() and Urls in menus vs canonifyUrls74399830[Docs] Document the new (temp?) default of `canonifyurls = false`60c6faa3Revert "Try to fix mysterious test failures on Travis"71fe85dfTry to fix mysterious test failures on Travis01ec44a6Add menu tests for pages with both Yaml and Toml front matter020c0b86Revert "Quick-and-dirty way to print details of template errors"6db6d33bAdd dateFormat to release notes37490ee2Add dateFormat template function878754c2Protect the innerShortCodeCache by a RW lockc8f8f48eCache the page's rendering context flags19c52ab0Register rstHandler to restore experimental reST support1cc63869Make ref and relref respect plainIdAnchorse5be592efix outdated MathJax CDN URL173aa53b[Docs] Use of `$.` to access global context from anywheref015e9b8[Docs] Recommend the use of backticks for IE conditionals02da4959Fix string comparison for .Truncated page variablea17c290a[Docs] Correct description of "Read More" links in Summariesedcdb6f4Fix two errors in two internal templatesd897b1e8Add missing assertion to trim-test932214d7fix --uglyUrls params2ec046afMinor polish in path/url9e688507Add more tests to general helper1b91fec0Add tests for IsSetee34a840Add test binaries to .gitignoref77f2a9bRefactor TestGt to also include Lt, Ge, Le, Eq and Ne1348caa6[Docs] Add a note about the plan to switch to Apache Licensef470cf95Add tests for Apply3f0f186bAdd inline doc for Applyeabe8e1aRename ignoreDotFile to isDotFile (which is what it is)077d726bReplace regexp based Chomp with builtin TrimRight99aee304Add tests for Replace26856c3bAdd tests for Trim4b1780bfAdd test coverage files to .gitignorea6bf6f52Add tests for Chomp42b33102Quick-and-dirty way to print details of template errors2342655f[Docs] Incorporate some great ideas by @mohae into the `safeUrl` docs724cc0ddAdd `safeUrl`; disable `safeHtmlAttr`; rename `safeCSS` to `safeCss`f5946ea3Add SafeHtmlAttr, SafeCSS template function53b4ab4cRevert "[Docs] Use <dl> for definition lists of variables"4609f77a[Docs] New testimonials and press coverage0e60c513[Docs] Limit `.fa { display: inline }` within #main-contentb56c9db6[Docs] Add FreeBSD logo beside the FreeBSD name3c4bc653Merge branch 'master' of github.com:spf13/hugo783c76b8Make RSS dates valid5d6dfe81[Docs] Use <dl> for definition lists of variables9712d06bFix the Hugo.Generator tag so it can be used56eead2aFix broken doc sectionc23dfd99Use an init() method to create the HugoInfo instance7257ab68Update release notes with the new Hugo var724357a2Make sure there are only one HugoInfo instance109e6f95Merge branch 'master' of github.com:spf13/hugo73d923e9Fix HugoInfo initac6b86afAdded 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.go1dfd0225[Docs] Minor revisions to future v0.13 Release Notea2c88715[Docs] New "Troubleshooting Overview" page90afe41eAdd trim and replace to release notes4f4015d7Make all the params to Replace an interface{}e08cabadRewrite first argument to interface{}871e8113Add trim and replace template functions32d15d91Change CR+LF to LF on gohugo.io front page, saving 286 bytesaf956c41Update gohugo.io front page for 2015; add @popthestack's testimony :-)b59dd163[Docs] More copyediting769ab9e2[Docs] Adjust sidebar menu width and capitalizationa4da5262Missing . on footer partials508788e6Update TestFixUrl() to expect BaseUrl to have trailing `/`3a9300ddMerge pull request #798 from bjornerik/fix/nestedshortcodes1cbdd3e5Ensure that BaseUrl used in `hugo server` ends with `/`714abd5cFix issue with nested shortcodes9150a98fReplace `if` with `with` in embedded rss.xml208086ebAdd ".swx" suffix to file watcher's ignore listf0b3979aDisable shortcode processing for html files4f66acdcFirst take on release notes for 0.13fc39019fAdd an alias to the old URL of github-pages-blog.md433ce3b7Rename github_pages_blog.md to github-pages-blog.md4107fd50[Docs] More random revision and copyediting6fda9012Fixed error in tutorial, added site variable docs6c5a7b7bTutorial: Automated deployments700c2b8fTrivial fixes to get RSS 2.0 feeds to validate.5bfc812d[Docs] Remove references to "ATOM" feeds6ee35f65Correct typo in hugolib/path_separators_windows_test.goa4eef4ebCorrect spelling of two test files: seperators → separators78e9229cFix "hugo new" EOF error with an archetype file without the final EOLb6ab6618note in archetype.md to alert that ending carriage return may be nessary to avoid EOF errors.b0181e27Some more random copyediting of Hugo docs49f5eb5cMoved a test regarding a content.go function to a new test file content_test.go. Added some tests for general helpers, especially as a way to document the expected behavior, and as a warm-up welcome contribution.2b46f3e5Do not exit server watch on error190964c5[Docs] New Troubleshooting sectioncb909cdeGoogle Custom Search: Open link in _parenteba33459Add basic Google Custom Search to Hugo docsd12f6cd7Fix `echoParam` template function to accept string key namec0f54aefRename to plainIdAnchorsa0e44bb7Add Blackfriday: documentIDAnchor documentation4adf58ccGroup both options under Blackfriday: documentIDAnchorb7716948Add config options: disable footnote anchor prefix and header ID suffix New config options:dca6eabaAdd config file example to variables.md0b7392b3Update configuration.mde6c27f76Add example code to Summariesd3763147use fsnotify 0.9.3a5f51061Add in-section Next/Prev content pointers837922d3Add ERROR logging on invalid date and publishdate0d17ee7eAdd operator argument to `where` template functionae9c25afImplement `apply`.6033abe1Add a chomp function.14e93de8Initialize funcMap in an init function.6a98d269Hygiene: Reduce copy-pasted code.c6f4b09falways use http scheme for localhostdd1001ceMerge pull request #762 from bjornerik/fix/revert-revert-menutest076a475dRevert "Temporarily disable failing menu test"fb1b795dBumping Travis to test go 1.3 & 1.4d3c36761Fix EOFec2566faAdd www.thehome.dk to showcase975f4cf1Refactor tpl codesfa8ac87dMake 'where' template function accepts dot chaining key argumentdd5bc034[Docs] Mention support for the Ace HTML Template Engineddf41901Docs copyediting: Add more external URLs; add backticks, etc.5792cc3a[Docs] Go 1.4+ required for building on Windowsafe5add8Add anchor ref to Blackfriday doc5e0a16eaFix a crash for ref page#anchor.029a3ae7Merge pull request #742 from bjornerik/doc/blackfriday7dacc999Add ability to canonify URLs in rendered XML output.f5a3fb14Wrap comments helpers package to fit 80-column widtha0fe1170Add doc for Blackfriday configurationfbf8bcacAdd configurable support for angled quotesbb376982Fix unicode menu URLse4a22255Temporarily disable failing menu test0cfdb2e5Revise README.md: buildDate expects timezone; copyediting8042e774Typo fix: "simple" → "simply" in templates/views.md68cea070Minor copyediting, no new content added.e3433e6aFix long descriptions of `benchmark` and `serve` commands331043b9Remove noisy Println in test717f702eAdded delimit & sort template functions, tests and docs8f6f871fAdded AuthorList, Author, AuthorSocial, SiteSocial, Image and Video structs Added Page.Author(s) functions Added schema, opengraph, twitter_cards, google_news metadata templates Added "" templatefd33e5d2Documentation for `ref` and `relref`.112c3c5cProvide (relative) reference funcs & shortcodes.14bce119Commented helpers package7436829bUse current working dir as WorkingDir instead of hugo executable's direc4b6c03Trigger an editor after `hugo new`.2c8e9a79Commenting helpers packageb11838daCommented commands package9b04c279Revert "Make Urls in menus respect CanonifyUrls"3ccb3979Make Urls in menus respect CanonifyUrlse6541c45ERROR-log on symbolic links9f77f930Fix various Windows-issues3a8c1241Add timezone to buildDatebe3d563aAdd an `install` target to Makefile.9f0f73f4Fix front matter for 'Creating a New Theme'a6d3862bDocs: Minor copyediting/proofreading736dd4b5Docs: Quote <!--more--> in <code> instead of italicizing it010f6057Correct URL of the favicon in the documentation11cdb815Remove Println that panics in test27840932Always use RFC3339 for version date format.a0d956c2Add Ace template engine support390c158fGithub page strategy for username.github.io repos1b36bda6Fixed typo in summaries description in the documentationc00788d8showcase: update ucsb entry742a064bCorrect aliasdf8e9366Fix missing shortcode in docb719ba7eAdding Prev/Next functionality to all lists of pages (sections, taxonomies, etc)78316903adding appvoyer support for Windows CI integrationd6166172Doc for markdownify53c707bbAdd markdownify template filterf0400697update summary.md with info on handling of html tags8f9cea7fEnable descriptive header IDs.0282c922fixing race condition in CreatePagesc5ae2a2dAdded makefile that builds with git information9b850c4aCorrect path in theme search order9e152989Added link to my blogpost about travelling with Hugo in asiaa1954c4fAdded stou.dk to showcases0eeaa4c8fix version command so that it will work with all supported config formats and added tests6c25cd52typo: practicalcdbc741cfixed #656. Templates work properly when watching.4a2f16f9refactor handlers to use types instead of structs.73f203adMove template library into it's own package (tpl). No longer dependent on hugolib. Can be used externally.92a3372aAdded a new command `hugo list drafts` and `hugo list future`728d0fa3Update shortcode doc for 0.13-DEVcb3576b6Fix broken convertbcaf3341Update shortcodes.mda6a9df39Fix failing shortcode tests on Travis596d6793Various fixes in RSS feed generationa07dd565fixing typob716dbecFix template checking order in site.go55fcd2f3Shortcode rewrite, take 2c8904756Removing dependency on go-html-transform (fixing the build).7e692544Fix `GroupBy` function issues91e03b9fReinsert deleted test6bf6a810Update creating-a-new-theme.md88881de2Update creating-a-new-theme.mde9917bfeUpdate creating-a-new-theme.mdca4e4ce2converted helpers usage of path 2 filepath99463f6aconverted path 2 filepath2c51bba0converted path 2 filepath7fd348cfconvert path 2 filepath4f2dfe70converted path 2 filepath7badd2ebchange path usage to filepath05300fdeadd support for fsync's noTime flagf037ae7bupdate README.md with info on adding compile information to versionfc20d0b4Fixed launchcode5.md description52ae1c75Added launchcode-tn.jpg to docs/static/img15dae3ccCreate launchcode5.md8ad9c0a7Make Where template-method accept methodname as keyfdae0907Params map has string as keye127a5cbAdded better error message for poorly formed frontmatters in archtypes3cec04e0Add Git directory deployment flow to tutoriald467ec0aFix a bug with taxonomy rendering.d7e6e490Allow partial without .html266511b6Fix missing space before 'width'cafd39ebFixing some tests55fb0242Updating tests to use hugofsa40bd3carewriting guessSection to accurately reflect intent and usage. Update tests.e2634752First stab at correcting GuessSection testsf81f9cebFix: rewrite FileAndExt5906c865Fix: remove the unnecessary dot in an extension3521e8b1Updated TestReplaceExtensioni, TestFilename and TestFileAndExt980d0f14WriteToDisk and SafeWriteToDisk test cleaned upbf07dc92WriteToDisk and SafeWriteToDisk tests now passa54ad2bfFix: Test TestSafeWriteToDisk now workse8bbc44aAdded the path modules test files6b619d2cAdded the url modules test files.57cd9539Added the general modules test filesb87402e8Remove the helpers_test.go file8a5dd06aUse page.Markup to determine which PageHandler to use if it's set.ade2ca60Adding an html file handler7fba2500Adding a proper css file handler (with automatic minification)4dcf734aUpdating tests to use new Targets & Writers and switch to using Afero.MemMapFs for more accurate tests.7b960ac1New targets & new renderers and write methods [WIP]e02dc674Cleanup file conversion handling3616d167Better error messages for show_plan_test07f2ef9cPage Group functions now work even when an uppercase field / method is provided.4b9ea105Setting to filesystems to the afero.fs interface so can be easily swapped out.ad69374fSource files can provide content as String or Bytes or Readerdcea0fa5Adding ReaderTo and ToReader helper functions2cb89a52Update menu test to work with revised source struct8cc7684aChange the type of .Site.Author from…f3e9cbc7Fix #593 problem with `hugo -w`c1942e91Change permalink validation and substitution.c07b10bbOutput a timestamp with hugo server --watch2060031cFix sourceLink for Hugod036ddf2Create creating-a-new-theme.md11ddc308Fix for issue 5836c238e14Fix broken link649a7d2bMinor doc correctionsaf47e5a2Extend template's mod and modBool functions to accept any int typesd4ed5919added note about pygment example code and markdown processing, updated example8e368e25540: add support for build information output to version command8cb435f1Fix redirect-loop for Hugo server5e28606bAdd 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.d013edb7Implement HasMenuCurrent and IsMenuCurrent for Nodes2b412d4afixed server reporting Web Server is available at https://localhost:1313 when server always serve http73ec0925update summary doc9e029fe4#463 add summary.md pagec5f1031eHandler WIP141f3e19Migrating Hugo to Afero for filesystem calls.dfb84825Handlers WIP - Convert now working30d4a26bHandlers WIP (builds)93f3d604Handlers WIP8bd0ffbaInitial Handler Architecture WIP20467e36Improved error message when config file not found.5dfc1dedBig refactor of how source files are used. Also added default destination extension option.24bbfe7dSet Content-Type for livereload.js0167fb48Copy content from archetypeda5d98e9Make First accept any intd064139cFix spf13/hugo#467. RSSLink now point to index.xml16330ceaAdd nil-check to Intersect1d4dde7aadded docs for 'intersect' and 'in' template functionsca7007bfMinor proofreading corrections to Hugo docs953cad6cDocument manual breakpoint of .Summary3da97656add 'width' parameter to 'figure' shortcodefb82f00fhandle https prefixes in baseUrlb98c2088Minor fix to error message when copying static files4b9e4c90#462 fix, remove leading and trailing dashes from urlized slug. includes test changesf52e6628Feed the titleized taxonomy key through string replace to replace '-' with ' ' for proper display of the taxonmy title938733f4added In and Intersect template functions9cdd2e54Use md5 against the file path for uniqueness.603b24a1Make each generated page’s footnotes unique.e68e7ef9Configure footnote rendering.eeaf343aMention .Params and .Page variables in shortcode docs. Also `highlight` variables.1614b824Correct desc for hugo new commandc739ec22Removed text from code block.879e90dcSwitch to new hompagee3d4d40dbetter error messages for template errors3f59abe8add some information to rendering errors so it's easier to tell what's failing.def79376Make taxonomy documentation match the example.30603070Make highlight.js example clearerb81ebf2aMaking the install on the homepage a bit more clear4e4ea958instructions for Homebrew installation26e44506adding memstat option to server5d565c34Extend template's basic math functions to accept float, uint and string valuesd5308e6fAdding a community link to the homepagebf980bc1switching website to gohugo.io & adding links to discuss1a0dc0b9Update urls.mdb590de69limit the number of goroutines used in taxonomy rendering to gomaxprocs*449045b1climit the number of goroutines we use for page rendering to gomaxprocs*4cf3e748bremove unused fielda72ca38cmake the value of the BuildDrafts flag available to templates.This can be useful for if you only want to show some specific information on your local machine and/or when showing drafts.71423743Sort by title if dates are the same275e1c0dmore examples and explanation of go templatingbecd4fe3refactor handling of amber to AddTemplateFile as the TODO note stated. Used switch statement to make it easier to add other template support4e9b0408fix tags not being in lowercase, #491012a473eadded "eq" function to docs.df489b47Enable soft livereload of CSS and images0099b5a3Change all uses of sort.Sort to sort.Stable.Using sort.Stable ensures that even if the sort keys are the same, the order of the sort will not randomly change. Using the old sort.Sort, if you had pages with no date, the lists of those pages would randomly reorder every time you regenerate the list, causing spurious changes to the output. Now they'll always get ordered in the same way.d9964451More error messages at syncing static contentsacf9561afix zero dateb336abcfFix typo in Archetypes documentation.2ca615c5Add Node.Site.Pages to all nodes and ensure all pages from the site exist in the list before processing shortcodes.b97c6c70add Name to File, which is the filename minus the extension16845791Go back to lowercase slugs. Also, use MakePathToLower in TestMakeToLower.5dd3eaabMore proofreading and minor revisions to Hugo docsac78d252A small fix and update to the multilingual example4bb5e326Taxonomies can now be provided as a single string value if there is only one in frontmatter (tag = "val" vs tag = ["val"])1b7f18e3Making partials context optional for compatibility with template.7b3df238Bumping Version to 0.13-DEVefc98a3bUpdate example blog to Hugo v0.12 conventions05102f1bFixing typo in ordering.md fixed #40113631289Bumping Versionb4d3195fAdding V0.12 release notesf36ed446Adding a bunch of new quotes to the front page and switching to Owl Carouseld2020506Fix loading of Lato font in style.css for docsa6022293Minor proofreading corrections to Hugo docsf142458cUse typographic quote chars in the carousel quotes section13a317b9Enable header id blackfriday extensionc1b9e8d5quickstart.md: Put long options inside backticks242d6b4eAdjusting the number of go routines to build the pages in to 4*GOMAXPROCS (from 2) for faster rendering.47c91a4cFix CreatePages93addfcbAdding documentation about 'where' and cleaning up docs around first.0ce4ec1eAdded more examples and cleaned up the GroupBy functionality documentation7e19fa40Making direction optional (and setting defaults) for GroupBy Pages functionality.b15eb889Adding .Reverse() to PagesGroup41b28462Switch .Data to .Pages in the PageGroup functionality for increased consistency.70dc370cMaking the term "Term" more consistent with Taxonomy usage.01caaebaMaking the Pages Sorting methods available within a taxonomy term.bb02a14bAdding a page listing the different methods available to Taxonomies.ba8f652aMore taxonomy examples in templates.6f9f93f3Fixing the taxonomy example. Fixed #318.d3646aaaBe more specific about .Params content7de32092Shortcodes are content files specific.6f9db4a7Add document about page grouping functions53b7d5b8Inner Shortcodes now treated as markdown. fixed #185828401cbMore press additions4b71eb16Compressed showcase thumbnails further95449880Added ucsb to showcasedcda66dfMore Press4a91b8c7fixed #389 . Added alias for missing page.987a82d0small tweaks to the hover effect8a44deacCreating a showcase archetype to make for easier showcase additions1c1615d7Adding a bunch of new sites to the showcasec9a6b2b9Adding a bunch of new press to the Press page.733bff90Prettier link hover state1143a8faBumping Travis to test Go 1.2 & tip (1.3)294222acFixing a broken link in the docs4281cbfaLiveReloadDisabled works with Watching properly. Fixed #335.1b5f59b0go fmt site.go30af267bFix #302. Links now have trailing slashes.a31edb33Support subdir in baseurl.4b979b17added functionality to check the error message returned from Cobra, if any. for uage message text. If its present, the usage message gets truncated and the resulting message is returned to be used for the rest of the error message. If the resulting error is blank, no error message is printed4c735a78preserve alias case while lowercasing taxonomy348e123cUpdate 404 to be compiled to .html instead of directory50a8c507Add page grouping functions867683e4Add link for learning more about static directoryc750a95esupport for futre/draft summary info output946ad9c2Making the links stand out moref5157566Cleaning up a ton of CSS.. Removing unused selectors. Eliminated over 80% of CSS. Upgrading jQuery & FA34a93fa1Fixing the docs sidebar interactions04d412edFixed showcase image pathscece27fafix issue 411, /path/to/site/archetypes : is a directory errore31d4609Bringing back the showcaseb047e2f8Removing redundant bootstrap864f91d9Changing the docs template partials to be able to be used to render a sectionaae1ff3cAdding IsNode & IsPage functions to Page & Nodeb10dea29added evaluation for toml for metadataformat date handling27c0ec31Added a note after the script adding potential issues per @franklinwise's feedback5ae28327errors not propagating634d7b26switch to new location of goyaml002a5b67Add 'where' template function6e15f652Added yaml menu example5d8ac54fConfig changes and Live Reload09115a96Fix #394 - Docs: add a missing link to the livereload page in the introe9b47da0hugo builds no site if there are only drafts3e9fc47aAdding more presscbb29795Docs-removed bullet and broken link for catagetories. Included category text in bullet for taxonomiesb3130b52Fix #363 - Docs: make the fixed menu on the left scrollable1778f28cremove extraneous "Because"f556cb44update docs for permalinks with all fields29c45dd6make type-or-section more obvious756be987Merge pull request #388 from GraemeCaldwell/patch-2d8b78c3dUpdate press.md2850692aMerge pull request #370 from kevinburke/its657e4a46it's/itsbf9595aaFixed #328. Config file set appropriately.8d3fa7efGetting rid of bad scrollbaraa42f430allow site to be built with empty content73dd4f38report errors78962a14Allows 404 templates from themes/THEME directories.ac99ceccAdd shortcode template loading from themes directory.35d04671Add PluralizeListTitles option (default true) to allow disabling use of the inflect package3eb480a6fix link to template primerb7671974taxonomies -> Taxonomies836b1800Fix minor typo in file docs/content/templates/overview.md0e57e32fdo not use angle brackets in hyperlink labels5969315cswitch back to master blackfriday; enable footnotes406233f0Included instructions for omitting disqus comments on localhost.86c3de4bFix #263, document HTML comments & IE conditionalsb2b7ba42fixing typo in docs4483a665Centralizing the template execution logic in one placec297d745Adding 'partial' template function to add theme / local awareness to the partials directory.4e99d6b5Adding proper error message when view is not found.. fixing #303640ab3c7fixed #303. Adding theme support to viewse0ea6b99Support embedding <script> tags in markdown pages7b7ce117Add empty line to correctly render a listca18cfefSetting new version05875153Converting front matter to YAML2b90779fActually bumping the versiona3d6e7c4Fix docs script and css references to refer to the correct location012823a3Update menu documentation to be accurateb9bba2b9Updating Convert to handle dates properly for yaml and json0c254460Add future details to documentationc502f078Add handling for publishDates (which will be ignored if in the future). Fixed #2604ebaec89Include Section Taxonomy into SiteInfo35a60597SiteInfo is now a pointer on the Node7a8b754cFixed #301. LiveReload works on any port now.4076d770Simplifying the siteInfo handling280df4e3Fix Viperized .Site.Paramse98f0014Allow to use filename in permalinksd65061dfAdding TechMadePlain to showcase79767f56Fix links to GitHub repo for spencerlyon2/hugo_gh_blog1ba63f15Make the header not jump around2a44ca54More doc site improvements. Added documentation's new layout79dd1d02Fixing bug with Live Reload where it broadcast instead of sending the handshake57ad3abePre and Post in Menu are type HTMLa87f171bUpdating / Rewriting / Adding all of the documentation in preparation for the next releaseaeb06c7bRename chrome to partials (in builder)9173022eSet verbose to Info levele7991003Fix bug so watch works on theme directories as well6b8244banew site works in an empty directory nowdf4bbcefAdding instant click library to docs so even more responsive navigationbe1ee220Proper integration of live reload with automatic injection60ed5bdaLive reloading is working! Still need to incorporate cleanly.296d218eBetter handling of when the specified port is already in useb520f885Switching docs highlighting to highlight.js .. Docs build super fast again!b198cb26Renaming indexes to taxonomies in docsa4a1e39aFixing issue when two menu items have the same name.4f75ec98Homepage renders with _default/list.html or then _default/single.html when index.html is not present.025a37dfFix permalink functionality, which was broken in62dd1d4.05b76dcbAdd a blank line after the front matter when writing back a page.73cbefdbMake template comparison functions handle floats667a047cFix date issue with home page in Sitemap0053be97Correctly print server URL when base-url is specified in the command line2194cc77Add pygmentsstyle and pygmentsuseclasses options5df0cf7eAdd Sitemap documentation content35926dcfAdd Sitemap testing6049c3a1Update Sitemap default value syntax2a902bbcAdd Sitemaps config values handlingf8e675d0Add base Sitemap support17922544Add template comparison functions (Go 1.1 compat)4e0208d4Doc fix: replace "hugolibs" with "hugo" in "contributing" page, fixes #271.c38d694fChange some typography in the docs.ec4b1526Fixing broken link. Fixed #278.9b192e67Adding more information about client side highlightingbc9f69e7Add client-side syntax highlighting example6b9d4a93Adding new commands (new site [path], new theme [name])be3e5592Adding an archetype file for the docs site28ffb92bAdding the new command and the create package08c30b6eUsing new helpers in page.gobff1f1e6Adding some new methods to helpers (GuessSection, MakeTitle & Filename)ef2ad4d9More feedback where errors happen during metadata conversion6d9a2d24adding a front matter format to lead rune methodfb7d45e6permitting empty files again. Fixing some tests to now pass.3395e1cbAdding a command that enables converting site to a different metadata format. Doing this revealed some bugs in the encoding functionality in some of the underlying libraries. Please backup before using.859a78e1Providing the ability to save (write) a content's source file.1302ef9fMaking site page initialization a bit more granular and accessiblecbd9506cmoving front matter parsing (and creation) to parse package58f8b43fmoving writeToDisk to helpers to make it more accessiblef271faeaDon't process dotfiles5581e33aUpdate broken localhost link96b6ae81Adding example blogb52e9463Little syntax mistake2e954d85Fix permalinks to subdomainsbdf7cd9fCreating site menu configuration and have the docs site use itac82fe32Making active parent in nav reflect when child is active page in docsef87dffbFix accidentally removed line from menu template.4f813c09Fixing some bugs introduced in prior few commits. Tests now pass.11fe227bImplementing new menu system in the docs site9ecf58e2new menus system including active link & nesting69c1944fAdd handling of deeply nested front matter4a8de8eaAdd Disqus support out of the box. Move template/bundle into hugolib.41adafbcUpdated to work with the latest viper8afff8c7Preliminary Theme Supportc0a046cbAdded internal rss.xml template and config option to turn off rss creationbb9bcdcfAdd more information to the siteInfo (and configuration options) for better RSS generation.93bcddebRenamed Indexes to Taxonomies. Old template and config parameters still work.aae6fa0bFix test to not fail when order is different, but slice contents are the same.be37c0b3Adding more articles to press page.bd022534Adding Params to node for easy template access of page.params without throwing errors.c8269d6dMaking node.Keywords the correct length4161d542Misc doc fixesd1c500c1Adding Press page to hugo docsaf1acfbcwriting indexes under more configuration conditionsad34be9dstrip trailing baseurl slash. Added a new template function "sanitizeurl" which ensures no double slashes. Fixed #221a6170154add: yslow-rules showcase9a83f7a0Fixing all tests to pass with new Viper Config62dd1d45Hugo config abstracted into a general purpose config library called "Viper". Hugo casting now in own library called "cast"a01056b9typos in mathjax.mda7ca39ccENH: added tutorial for hosting a blog on github pages2e4158b0added appliance.cloudshark.org to showcase also cleaned up thumbnail view to not show source link if unavailablee50b9d8aAdding support for logging & verbose logging. Consolidation of error handling. Integration of jWalterWeatherman library. Fixed #1372fa3761eDOC: added tutorial for using MathJax with Hugoc02a0207change golang to go5ee0a3b9Typo: s/executible/executable/895fe536Adding a few more logos and powered by/made by images.f733e70eAdding apple touch & favicon meta links51b078a7Homepage update. New Logo. Minor site updates.6205a16bFixes #227 by properly scoping the variables within the go routine.85c04ca2Add Tutorial With Steps to Migrate from Jekyll.7135d897Optimizing thumbnail & preview images17fdf7d6Add www.heyitsalex.net to Community Showcase.1b3525d6fix typo of readme38131837clearer pseudo command in quickstart docd5c58b45Order ByTitle and ByLinkTitle addedeec0e512Add sort pages by Title and by LinkTitle3dfb4751Parallelizing the largest build processes (templates, pages, indexes). Seeing 300%+ improvement of total build time.d84f707dAlso ignore Emacs lock & recovery files.3a0ab5a3Bumping version to v0.11-dev0447c759Adding the right date for the release of 0.100a775650bumping version for 0.102540d884Fixing issues go vet reports.2c0ded7fAdd test for ignoring ~$ filese53bc948Ignore content files ending in ~0becad72Make error message when encountering unrecognized file extensions more helpfulea8d0981Make per-page url overrides take precedence over section permalink settings732b5d42Add Kieran Healy's website.ae954d51updating the intro page14227351Reorganization of helpers. Centralized Url/Path logic. Fixed #175.64572d2dShortcode cleanup. Added a ton of tests. Much more flexible with input. Doesn't crash with bad input. Fixed #193dc068ccbFix imports so hugo builds on darwin8fe78f6fA bunch of small documentation changesde05a0d9Adding documentation on Pretty Urlse74d1b86Adding documentation on Table of Contents functionality30e804eeAdding an introduction to Hugo82fdfa2cWarn about bad shortcode parameters (and don't crash)5cff3e62Adding Else If exampleed0fe9ddMake 'read a string' code understand float64 (json) and int (yaml) as well as actual stringsb41622bcAllow 1/0 for true/false in Yaml front-mattere4af4f65Support ISO8601 date/time format without timezones0bfe9276Make the invalid date/time format error message more helpful1dbed5eeCall the json delimiter 'json_lead' instead of 'java_lead'8ebb85f1Fix build1bead0edAdding Documentation on using Syntax Highlighting56dfdfe8Adding Documentation on Hugo Template Functionsbf640775Minor Docs Tweaks80086759Adding Go Template Tutorialdca7a901Updating Release Notes and Roadmap75c260faOnly change rLimit on OSX (where it is needed). Fixed #19411ca84f8Add unicode support for aliases, indexes, urlize template filter. Now aliases and indexes are not restricted ASCII letters and can include any unicode letters.24ffe043Add Ant Zucaro's showcase.5cfb690eFix docs error with json comma72ba6d63Fix permalink bug in uglyurls mode (refs #187).3e87d7a8Automatically increase the process ulimit to maximum available. fixes #168.ae9cc09bAdding the ability to check the system limit on open files (important for watching large sites)c1b9380dAdd back blackfriday extensions during Markdown conversion6dd2e9a4gofmt all go codeff9f6e1bFix panic with HTTP serve initialization problems.0ce6f05fAdd text transformation template functions.18b9948fUsing table of contents within the documentation.1882ffabAdding support for boolean params1da3fd03Continue with TOC integration and page refactor. Updated a few tests to match new generated output.f45c6bc3Moved TOC test into page_test. Some general page_test cleanup.9666f33eDon’t render short codes on summary twicef82c645bfixing 178.d0825a21Big refactor of pages code. Changed TOC code to only parse when actually usedf62e3e99Add new TableOfContents Page variable (Markdown only)4f1807c7Replacing hall of fame with showcase. (new type, content driven, thumbnails, etc)9564e6e9Adding support for some primitive template math functions0e013b52add andrewcodispoti.com to hall-of-fame3851117crenaming MinRead to ReadingTime and adding to documentation.50a7f97aUpdating page variable documentation (for templates).f0634ec0fixed #171. RSSlink is now RSSLink (and matches existing docs).ae15ff09Fixing test which erroneously checked values and order, rather than just values.44186c6aExtending rss item limit to 50… can reduce further in template with ‘first N’ functionality.fa2e58fdHave travis build with latest go.cb040533RSS improvements, now limit to 15 items and provide accurate date. fixed #172303be735Adding github button to docs homepagec51d040eAdding Werker status to readme845d0976Create wercker.ymlf8243624feat(docs/hall-of-fame): add ifup438c2198Add `canonifyurls` config option.2ff108fcAdd highlighting of code in documentation and clean up a bunch of the docs.13b5c10dRewriting some homepage text74d7ae1fA bunch of style updates. Switching to bootstrap carousel.01da9a40Report error, but don’t fatally stop if pygments has error. Return original string. (+1 squashed commit) Squashed commits: [849a7af] if highlighting doesn’t work, just return original string3fd6c1a2Adding some embedded short codes (including code highlighting)13b067b5Adding support for embedded templatesf78e2cb8Removing Twitter jsa70acd11New Icon Font for Hugo247db151Adding some analyticsb82baa28Adding chimeraarts.org to hall-of-fame5550c414Added append-port flage5aa08ffIf baseurl is set then print that on the command line, else leave as default of localhost8b84156fExample of a multilingual site.8055838cAllowing empty files (ignored) so you can touch a new file while watching1c60d5bfDon't shutdown hugo on an empty file.8d80f9b3Added batching behavior for page building.1979f7d9Avoid locking the files for an extended amount of time. Sublime Text doesn't like this and shows an error when modifying a file in rapid succession.e46148f9Fix static file change detection on Windows. Fixed windows uses different filepath separator. The filepath.ToSlash shouldn't be used, because it can cause errors in filepath suffix and prefix testing since "c:\a" isn't a prefix of "c:/a/b/c".065928fcAdding page sorting by weight function (the default)34ac562cAdded documentation on ordering indexes, content and content within indexes70745e8cComplete refactor of indexes, move (and rewrite) page sorting to page.go, add tests6aa3e512Added PageSorter and PagesByDatec7083a5dSection in example was wrong for happiness.md950d9f55Testcases for multilevel structure were wrongde670cedFixes #141: Wrong section in multi level structure6da23f74Gofmt1abc2f0bproperly use non-localhost BaseUrl in server commanda1051964Adding better contribution guidelines from the read me to the contribution page.dd574628Adding community section to the documentationceb70805Adding selected tweets to the homepagef09505a6Adding example short codes to the documentation6410965bAdd go fmt to contribution guidelines357ab956Add Contribution Guidelines0e04b9a0Moving processing short codes to the paged0ef3d43better handling of detecting markup formatf432b187render shortcodes prior to converting to htmla45de56dadding support for shortcodes with opening and closing tagsdb29f57cAdding (source code) Highlight template helperfa29e94eAdding Pygments helper44d57fdcReorganize helpers10c7cf29Create directories in publishdir with mode 0777.ba5dadffTypo fix in docs.32d9345bFix a minor typo in types.mdb351731fquickstart docs - fix flag needs arg error860f982cfixed trailing dir slash when using sluge425226aDocumentation updates, mostly for my bits07978e4aconfigurable permalinks support4f335f0cUpdated release notes.445b7d23Updating docs to include ‘first’ functionality for the homepageaedfa6a2Version bump 0.9ad2c0b56Homepage now has all content available, use sorting and first to control rendering13fa7cb7lowercase template function first to be consistent with all other template functions50d9046bremove initialization loop error from compile40d05f12Truncated; .Site.Params; First function6017599arestored behavior of respecting config values unless set by command flags. fixed #116ef595aedHandle schema-less urls when apply absurl90a902c8fixing double slash during absurlifyb69694a3Merge branch 'master' of github.com:spf13/hugo532e2e7bSome mobile and other fixes for docs0b6a11c9Merge pull request #113 from oyvindsk/masteradc559b0minor documentation fixad04f6c8Adding baseline86233c00Remove the hugo-nav function1cebce12Adding RSS test case.b2236457Fix Test Name1fbcaf92Buffers instead of pipes226bc8f5Updated release notes23a5711dFix benchmark panic23a711a2Hugo updated to work with latest cobra9af47f07Improve rendering timef4cb8e16Adding benchmark for transformation module.789aa6adRemoving check for directory: static, layouts861472beSmall tweaks to Homepage and CSS1d0d280eAddition of an indexes section to the docs. Updated most of the existing index content.a7dae30aMore work on indexesbc7c9221Better mobile support on docs site90355eecBig visual overhaul of the docs. Docs now using indexes for all menu generation.df0523ffFlipping around weight order. higher weight at the bottom. use negative to pin to top.5003f7f7Docs menu now powered by indexes.. converting some of the content to use this.d20b41a2Big index overhaul. Now supporting ordering tokens by count or alphabetically. Also made full indexes available to the Site variable.9388f236Adding support for linkTitlesb580a25dBetter error handling when rendering error found when in watch mode In watch mode it should continue to watch for changes, in any other mode it should exit with a -1 error code so can check for success when scripting764abd20Update homepagedde965a5Migrate docs to Bootstrap 3.0cd71eb73Watching doesn't built site 2x on write (ignores rename events). Also ignores temporary files written by editors.a5606b06Adding support for ordering content in indexes by other than date (weighted indexes)471fb1ffAdding support for date field in front matter as date (as TOML provides)f3c816eaAdding support for more front matter types (int, float & date)3558e3d6Add support for weighted pages Now pages can be sorted by other than date90090175Adding preliminary support for weighted indexes (for ordering by other than date)678ddef4Adding a quick start guide to hugo docs4d333e81New Homepage for Hugo4263094dAdding support for MinRead. Closed #106be5ace15Wordcount restored. fixed #92e58d8fe7fixed #95, fixed #93f5fda804simplified buildSite & better error handling around it0318f7c1Clean up server & build site logic. Fixed #94e6ace71fserver command now builds prior to serving4993152dPermalink to include multiple directories levels6e1268f4Test case for permalink functionality89563843Adding back the hugo homepage.9500ec1bRefactor layout selection code197aacb6Add support for Relative Permalinks06da6091Refactor Permalink to private function6fa6f69aChange transformer orderd712d6f3Moving transformation on a per-page level9032a228Better handle missing layouts54a2790fUse io.Pipe for chaning render tasks.689cda17Code cleanup19cb6c78Move writing next to rendering2176d2c1Reducing scope of RenderThing*ff8b5275Move in memory target into target module.80009b42Change the order of Apply to be more Unixy94a3184aFixing up source code formatting.5a66fa39Chain transformers and test caseseb117eb9Move AbsURL into seperate filef0211b84Rename Transform to AbsURL03d1a57fSet the name of the Nav attribute to select5e14af95Proper handling of 404 page return value7468292cFixing bug where RSS for site was rendered in wrong locationd829e050Fixing bug where only the first index list was created.2aaf92b5Summary can now contain short codes when using <!--more--> to define end of summary.be7ba0e9server defaults to localhost unless overridden by command line flags266f583aRestoring former snippet behavior & adding test to ensure future behaviordcfcbac5Enabling Nitro ('--stepAnalysis') again. Fix #5818f2b826Switching to the rjson library which is more friendly to human generated json.48e1068efixed #858efb90ebUpdating usage documentation to new interface3ae8dda2Restoring build and watch functionalityaa9b9d59minor documentation cleanup. - changed it's -> its where appropriate. - added post/ parent directory above happy/ to the organization examples8ce4bc7aUpdate filesystem.go94d7fe52Change the interface to use commands and flags instead of just flags. Better organization of main (controller style) code.92cff055go fmt so codeff2b98c9Better error message when no source content is found.f34ea610Add the ability to set navbar li class to activedb50154eSupport index.html indexes in content directory4250bf8eFixes #80 - Homepage now renders correctlyc9223cfdsource: Fix failing build on windows8df88496Fix breaking test cases on unix platformbffe4bafCreate a TargetPath() method that provides OutFile52e8c7a0Section is determined by the source, not the url784077daFix fragments being AbsUrlified in final html311e1022Allow non-markdown content in content directory5374242fMore expressive --check outputc510140cAdd renderer information to --check67b2abafAdd IsRenderable to Paged8e18349Fix parsing edge case of frontmattera82efe5bMerge remote-tracking branch 'origin/parser' into mrg_praser6b0752e8Move AbUrlify to post content transformationc6fe87b1Add a transform stepc75da346Fix alias documentation.172ff5eaInitialize HTMLRedirectAlias before ShowPlan()d45fb72fAdd /index.html to unadorned alias paths803a0fceRemove RenderedContent from page.2ebfb33fMove alias logic to target module2f10da15Move alias rendering to target74b55fc7Normalize paths within hugo998b2f73Added safeHtml template function6274aa0aHomepage "/" respects PublishDir610c06e6Introduce source.Filesystemd4d9da9fRemove page module dependence on opening filescb00917aExpand the ShowPlan functionality4004687fMove to target.Filesystem7919603fAdd Translate to targetc6ad532bAdd file reporting to planner13d2c552Adding Planner79d9f82eCode reorg, helpers.go has been decomposed.207d8fb7Date rendering unit tests in pages3ecc698fRemove hugolib.HTML and hugolib.URL typesa591a106Include building hugo docs as part of test.d841d522Include building hugo docs as part of test.ba82a203Add support for amber filesee5865f2Abstract html/template dependency0a9dc705Use s everywhere for consistencyb268e639Return an error (other than 0) when ./hugo fails6c8e7edbThe <!--more--> (summary divider) now works even if it is on the same line as content4349216dSmall code cleanup0fdea0c2Return an error with WritePublic097b782aRemoving site.Directories.b14b61afExternalize the writing of content to a targetbc3c2290Ensure Section is set before returning Page object.c32f401bRevert "Return errors when rendering"a792ec09Cleanup formatting - go fmt ./...4ed43e80Fixed bug where Url specified in front matter as pretty url wouldnt render71678a71Adding .Summary to page variables3ab52450clean up logic1bb00b8cRefactored added RenderThingOrDefault and tests554375b2Using new parser.1de19926Return any error reported by RenderHomePage9930011eWordpress summaries7b1f0960Add 404.html for gh-pagesf28a8fa0RenderThing test cases9d15262eTest cases for ignoreDotFile0fabd51aUpdate .gitignore to ignore *.swo files7461ed63Fix benchmark so the buffer is read each time.599e6672Removing GetSectionae711297Skip "dot" files in layouteb4288e3Merge pull request #53 from hugoduncan/feature/print-error-on-invalid-index00839567Merge pull request #52 from rozza/StaticSync35b35a70Merge pull request #51 from cabello/patch-36f424175Merge pull request #50 from cabello/patch-23d0dc1acMerge pull request #49 from cabello/patch-1301d2bafPrint error if index value in a page is wrong type5aa47a7bStatic changes shouldn't be destructive to existing files8415c5e6Remove extra quotes from meta dataacd5ea0eCheck .Prev and .Next pointers before using it8058abd7Fix broken link to Index pageeff8457aMerge pull request #46 from rawfalafel/sync_static2dcdd673Watch StaticDir and sync to PublishDir on change New behavior adds a special case for file changes inside the static directory to fsync PublishDirc4bcdebcMerge pull request #44 from cactus/avoid-redirect-with-slugse2744d40Merge pull request #43 from hugoduncan/feature/allow-xhtml-aliases2542836bMerge pull request #41 from rozza/skipStatic8f330626Merge branch 'noahcampbell-index_reporting'c713bebaFormatting cleanupec821739Removing the use of slash8eca8f8aDetect missed index from front mattere66ba5d2Return errors when rendering0a79edd4Removing extra links on homepage3ae8078dAdding "fork me on github" banner8c0ab4deComplete overhaul of the docsb76b80c5Merge pull request #40 from VonC/clarify_uglyurls_flagb9e835b1avoid handling a redirect from slug to slug/23a98ad0Enable aliases from .xhtml paths0f143dcfSkip Static directory if its in your content directory9308cd6aClarify uglyurls flag.3c3fc45dMerge branch 'master' of github.com:spf13/hugo480e01ebFurther work on path/section stuff. Tests passing now.7a51a8a5Merge pull request #38 from noahcampbell/workflow_dotfileb4bcc591Now support for nested paths. Better section detection.6e272394Merge branch 'master' of github.com:spf13/hugoca5a94a9Merge pull request #37 from noahcampbell/masterc661d980Merge pull request #31 from cactus/issue-31ec02fa4bAdding support for a default content type template default template found at layouts/_default/single.html89685249Adding support for recent content.97eb9225Ignore dotfiles in content directory5664780cgofmt pass2d11d1bdTest GetParam and the various incarnations of frontmatter.31a1ade1move "dot" in regex to avoid it being part of a rangec689d46aMerge pull request #32 from cactus/issue-32b13afc41fix sanitizeRegex to not strip "dots"023567b0fix bad tab/space due to paste2f9b582dfix wrong renderlist feed permalinkcb39f052Merge pull request #36 from noahcampbell/master8c031413Use / for template names regardless of platform.ec1a3a8dMerge pull request #35 from noahcampbell/master3fdcd0baSupport for non-standard formats.0305c825Move timezone tests to integration test.f610d45cAdd additional details to date test cases.dd19d0ccProvide better support for various date formats.17aafb39Avoid error if no content.5b3b0f95Merge pull request #26 from noahcampbell/master02337089Started new release notes, added nitro step for aliasesac26de20Adding correct canonical link to alias pagesd5518c09Adding support for aliases (redirects)45ce6e2bMerge branch 'redirect' of https://github.com/rozza/hugo into rozza-redirectbb273df4Add support for continuous testing.733c0207Merge branch 'master' of github.com:spf13/hugo2bf24877Merge pull request #25 from noahcampbell/master2bbecc7bBetter reporting when the template is missing.309db474Nitro timer is encapsulated.e26b43f6Adding more test casese67db666Adding benchmark for parsing pages using unicode.085ce15fAdding ability to read from io.Reader274d324cIntroduce unit testing for page.gofa55cd98Remove unreachable code path.0595f27eUsing a composite literal to create a page.19538a1bSupport pages without foldersfc5e92ccProvide better error handlinge2a28114Add redirect to page parameters and redirects example4f17ad69Merge pull request #22 from nsabine/master7a13434dMerge pull request #21 from duncanbeevers/mastera8b3e153Added examples to indexes.md04a0dbbfAdded .Content variable to docs6a5e4b36Merge pull request #20 from VonC/version49b8ac5fMake sure hugo --version prints the version and does *nothing* else.a870f4d9Fixing missing trailing slash in baseUrld89c7ec7Merge pull request #19 from nsabine/master780e2f31Populated page Site metadata. Enables accessing Indexes from Page template.42de9bd8Merge pull request #15 from hhatto/update-doc0e57fcc9Merge branch 'master' of github.com:spf13/hugo783f0d61fixing badlink on homepage6789b6c5removing erroneous debugging output78afe8d3update document for content directoryc5715e98Merge pull request #12 from imrehg/docfixf31ec3c2Fix example in docs that wouldn't work in practicede9f9ae1Fixing getting started link.57b206caMerge pull request #11 from noahcampbell/masterf6e590e5Fixing link to contributor page on github6a1a038cShrinking the readme to just the basics to avoid dupe with doc site6efbd93aUpdating a bunch of the docsdef5f101Including documentation on indexesdff86cb2Renaming indexes template to indexes.html21a7b725Moved static content to /static52c089ffAdded support for indexes of indexes & ordered indexesddad1e04adding previous next capabilities66610a65Removing OSX files from repo. Updating .gitignore to not track these files.d36d7fbaMerge pull request #8 from SebastianM/doc-json-fix47783c1fMerge pull request #10 from noahcampbell/master3e539c71Adding error message when no content pages exists.03e804ffUpdating the .gitignore for windows and vim users.c9a09418Fixed section labels causing panic on windows. The filename path was being split using a unix specific path seperator. This fix uses the os.PathSeperator to ensure proper evaluation regardless of platform.4efdb909Fix JSON syntax error in example configuration61258858copying static content to destination736677a2Using MkdirAll instead of my own logic7ab28c56Adding support for destination dir, split out static92c31bbepermalink now respects pretty urlsd5f55430create content at any level of nestinge08d14adfixing issue with some urls missing '/'b7bbc28cfixing bug with server not finding right pathc560a753adding more verbose output to server functionalityb2385f06create missing directories recurisvelydd9a7e64Fixing headers in readme16b1f284Improving installation instructionsf2e4c9d7Merge branch 'master' of github.com:spf13/hugo3ad3f2f0Merge branch 'doc-fix' of https://github.com/brandonblack/hugo into brandonblack-doc-fix580bb9bbminor: adding some more instructions for building from source2dde27f0Update README.md627cf265Adding proper command line option parsing8fae5f0dDefault is now pretty urls (without .html) Adding --uglyurls option to retain previous behaviordcd8ff71Adding better source build instructionsf1990049GO -> Go8d50dd91fixing typo in config readmec24112ceRender shortcodes before index and section rss feeds649560fcproper BaseUrl handling (if has trailing slash or not)7a521ad1Fixing some RSS issuesb7b6f054Accidentally left in debugging code75a2e6d4Now support for config files as yaml, json or tomld9b5f9cdfixing incorrect import pathf857f4caadding helper to create absolute urld4caa8eeAdding total time to generated stats.51e30985Writing relative links to absolute so they work in feedse76c3febFix bug with JSON front matter parsing.a6914e9cBetter error handling for parsing front matter8403dba3Merge pull request #3 from tychoish/rst-fix4951ff99rst: fixing rst output processingaee48725Adding version number to command line optionsd2a6267aAdding support for TOML, updating documentation3c80cd32YAML support similar to jekyll (start and end with '---')94e57774Merge pull request #2 from tychoish/yaml-rst-supportd0ff3126minor: correcting examplef851c416fix: changing terminal yaml line, generalizing forematter splittingb024454efixes: returning json parsing, error messages, yaml header offsets67f4da30revert: adding json support6c42d3d4fix: parsing of yaml forematter431fa0e2changing to suport yaml rather than json and adding optional restructuredtext supporta7f5f97bsanity: move from json to yaml4d2fbfc7Merge pull request #1 from tychoish/add-gitignore8aff6cc3gitignore: sanityf8755771rendering shortcodes earlier for better performance77d142bafixing typos1aa125cffixing two typos0d63bf00better install instructions and fixing usage typo3ec920acadding better install directionsd1162555updating readme6e16449eadding hugo50a1d6f3Initial commit git-subtree-dir: docs git-subtree-split:b0470688f1
This commit is contained in:
1 parent
37c69054e2
commit
6dbde8d731
580 files changed
+20561
-16233
No files matched your search
@@ -0,0 +1,3 @@
|
||||
[submodule "themes/gohugoioTheme"]
|
||||
path = themes/gohugoioTheme
|
||||
url = https://github.com/gohugoio/gohugoioTheme.git
|
||||
@@ -1,20 +1,3 @@
|
||||
---
|
||||
aliases:
|
||||
- /doc/license/
|
||||
- /license/
|
||||
- /meta/license/
|
||||
lastmod: 2015-11-25
|
||||
date: 2013-07-01
|
||||
menu:
|
||||
main:
|
||||
parent: about
|
||||
title: License
|
||||
weight: 50
|
||||
---
|
||||
|
||||
Hugo v0.15 and later are released under the Apache 2.0 license.
|
||||
Earlier releases were under the Simple Public License.
|
||||
|
||||
Apache License
|
||||
==============
|
||||
|
||||
+13
-6
@@ -1,6 +1,13 @@
|
||||
+++
|
||||
weight = 5
|
||||
[menu]
|
||||
[menu.main]
|
||||
parent = "x"
|
||||
+++
|
||||
---
|
||||
linktitle: ""
|
||||
description: ""
|
||||
godocref: ""
|
||||
publishdate: ""
|
||||
lastmod: ""
|
||||
categories: []
|
||||
tags: []
|
||||
weight: 00
|
||||
slug: ""
|
||||
aliases: []
|
||||
toc: false
|
||||
---
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
linktitle: ""
|
||||
description: ""
|
||||
godocref: ""
|
||||
publishdate: ""
|
||||
lastmod: ""
|
||||
categories: [functions]
|
||||
tags: []
|
||||
ns: ""
|
||||
signature: []
|
||||
workson: []
|
||||
hugoversion: ""
|
||||
aliases: []
|
||||
relatedfuncs: []
|
||||
toc: false
|
||||
deprecated: false
|
||||
---
|
||||
+9
-10
@@ -1,14 +1,13 @@
|
||||
---
|
||||
date: 2013-07-01T07:32:00Z
|
||||
description: ""
|
||||
lastmod: ""
|
||||
license: ""
|
||||
licenseLink: ""
|
||||
sitelink: http://spf13.com/
|
||||
sourceLink: https://github.com/spf13/spf13.com
|
||||
tags:
|
||||
- personal
|
||||
- blog
|
||||
thumbnail: /img/spf13-tn.jpg
|
||||
title: spf13.com
|
||||
---
|
||||
|
||||
sitelink: ""
|
||||
sourcelink: ""
|
||||
categories: [showcase]
|
||||
tags: []
|
||||
image: ""
|
||||
toc: false
|
||||
notesforauthors: "Go to gohugo.io/contribute/documentation for more info"
|
||||
---
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
linktitle: ""
|
||||
description: ""
|
||||
godocref: ""
|
||||
publishdate: ""
|
||||
lastmod: ""
|
||||
categories: [tutorials]
|
||||
tags: []
|
||||
author: ""
|
||||
authorurl: ""
|
||||
originalurl: ""
|
||||
draft: false
|
||||
aliases: []
|
||||
notesforauthors: "Go to gohugo.io/contribute/documentation for more info."
|
||||
---
|
||||
|
||||
+193
-107
@@ -1,13 +1,21 @@
|
||||
baseURL = "https://gohugo.io/"
|
||||
paginate = 100
|
||||
defaultContentLanguage = "en"
|
||||
enableEmoji = true
|
||||
# Set the unicode character used for the "return" link in page footnotes.
|
||||
footnotereturnlinkcontents = "↩"
|
||||
languageCode = "en-us"
|
||||
metaDataFormat = "yaml"
|
||||
title = "Hugo: A Fast and Flexible Website Generator"
|
||||
baseurl = "http://gohugo.io/"
|
||||
MetaDataFormat = "yaml"
|
||||
theme = "gohugoioTheme"
|
||||
|
||||
googleAnalytics = "UA-7131036-4"
|
||||
|
||||
pluralizeListTitles = false
|
||||
|
||||
# We do redirects via Netlify's _redirects file, generated by Hugo (see "outputs" below).
|
||||
disableAliases = true
|
||||
|
||||
[blackfriday]
|
||||
plainIDAnchors = true
|
||||
|
||||
[outputs]
|
||||
home = [ "HTML", "RSS", "REDIR" ]
|
||||
|
||||
@@ -23,113 +31,191 @@ baseName = "_redirects"
|
||||
isPlainText = true
|
||||
notAlternative = true
|
||||
|
||||
|
||||
[social]
|
||||
twitter = "GoHugoIO"
|
||||
|
||||
#CUSTOM PARAMS
|
||||
[params]
|
||||
description = "Documentation of Hugo, a fast and flexible static site generator built with love by spf13, bep and friends in Go"
|
||||
author = "Steve Francia (spf13) and friends"
|
||||
release = "0.24.1"
|
||||
description = "The world’s fastest framework for building websites"
|
||||
## Used for views in rendered HTML (i.e., rather than using the .Hugo variable)
|
||||
release = "Hugo-Next"
|
||||
## Setting this to true will add a "noindex" to *EVERY* page on the site
|
||||
removefromexternalsearch = false
|
||||
## Gh repo for site footer (include trailing slash)
|
||||
ghrepo = "https://github.com/gohugoio/hugoDocs/"
|
||||
### Edit content repo (set to automatically enter "edit" mode; this is good for "improve this page" links)
|
||||
ghdocsrepo = "https://github.com/gohugoio/hugoDocs/tree/master/docs"
|
||||
## Gitter URL
|
||||
gitter = "https://gitter.im/spf13/hugo"
|
||||
## Discuss Forum URL
|
||||
forum = "https://discourse.gohugo.io/"
|
||||
## Google Tag Manager
|
||||
gtmid = ""
|
||||
|
||||
# First one is picked as the Twitter card image if not set on page.
|
||||
images = ["images/gohugoio-card.png"]
|
||||
|
||||
flex_box_interior_classes = "flex-auto w-100 w-40-l mr3 mb3 bg-white ba b--moon-gray nested-copy-line-height"
|
||||
|
||||
#sidebar_direction = "sidebar_left"
|
||||
|
||||
# MARKDOWN
|
||||
## Configuration for BlackFriday markdown parser: https://github.com/russross/blackfriday
|
||||
[blackfriday]
|
||||
plainIDAnchors = true
|
||||
hrefTargetBlank = true
|
||||
angledQuotes = false
|
||||
latexDashes = true
|
||||
|
||||
## As of v0.20, all content files include a default "categories" value that's the same as the section. This was a cheap future-proofing method and should/could be changed accordingly.
|
||||
[taxonomies]
|
||||
tag = "tags"
|
||||
group = "groups"
|
||||
category = "categories"
|
||||
|
||||
[[menu.main]]
|
||||
name = "Download Hugo"
|
||||
pre = "<i class='fa fa-download'></i>"
|
||||
url = "https://github.com/gohugoio/hugo/releases"
|
||||
weight = -200
|
||||
[[menu.main]]
|
||||
name = "Site Showcase"
|
||||
pre = "<i class='fa fa-cubes'></i>"
|
||||
url = "/showcase/"
|
||||
weight = -180
|
||||
[[menu.main]]
|
||||
name = "Theme Showcase"
|
||||
pre = "<i class='fa fa-puzzle-piece'></i>"
|
||||
url = "http://themes.gohugo.io"
|
||||
weight = -170
|
||||
[[menu.main]]
|
||||
name = "Press & Articles"
|
||||
pre = "<i class='fa fa-bullhorn'></i>"
|
||||
url = "/community/press/"
|
||||
weight = -160
|
||||
[[menu.main]]
|
||||
name = "Discuss Hugo"
|
||||
pre = "<i class='fa fa-comments'></i>"
|
||||
url = "https://discourse.gohugo.io/"
|
||||
weight = -150
|
||||
[[menu.main]]
|
||||
name = "About Hugo"
|
||||
identifier = "about"
|
||||
pre = "<i class='fa fa-heart'></i>"
|
||||
weight = -110
|
||||
[[menu.main]]
|
||||
name = "Release Notes"
|
||||
url = "/release-notes/"
|
||||
pre = "<i class='fa fa-newspaper-o'></i>"
|
||||
weight = -111
|
||||
[[menu.main]]
|
||||
name = "Getting Started"
|
||||
identifier = "getting started"
|
||||
pre = "<i class='fa fa-road'></i>"
|
||||
weight = -100
|
||||
[[menu.main]]
|
||||
name = "Content"
|
||||
identifier = "content"
|
||||
pre = "<i class='fa fa-file-text'></i>"
|
||||
weight = -90
|
||||
[[menu.main]]
|
||||
# High level items
|
||||
|
||||
[[menu.docs]]
|
||||
name = "About Hugo"
|
||||
weight = 1
|
||||
identifier = "about"
|
||||
url = "/about/"
|
||||
|
||||
[[menu.docs]]
|
||||
name = "Getting Started"
|
||||
weight = 5
|
||||
identifier = "getting-started"
|
||||
url = "/getting-started/"
|
||||
|
||||
|
||||
[[menu.docs]]
|
||||
name = "Themes"
|
||||
weight = 15
|
||||
identifier = "themes"
|
||||
post = "break"
|
||||
url = "/themes/"
|
||||
|
||||
# Core Menus
|
||||
|
||||
[[menu.docs]]
|
||||
name = "Content Management"
|
||||
weight = 20
|
||||
identifier = "content-management"
|
||||
post = "expanded"
|
||||
url = "/content-management/"
|
||||
|
||||
[[menu.docs]]
|
||||
name = "Templates"
|
||||
weight = 25
|
||||
identifier = "templates"
|
||||
|
||||
url = "/templates/"
|
||||
|
||||
[[menu.docs]]
|
||||
name = "Functions"
|
||||
weight = 30
|
||||
identifier = "functions"
|
||||
url = "/functions/"
|
||||
|
||||
[[menu.docs]]
|
||||
name = "Variables"
|
||||
weight = 35
|
||||
identifier = "variables"
|
||||
url = "/variables/"
|
||||
|
||||
[[menu.docs]]
|
||||
name = "CLI"
|
||||
weight = 40
|
||||
post = "break"
|
||||
identifier = "commands"
|
||||
url = "/commands/"
|
||||
|
||||
|
||||
|
||||
# LOW LEVEL ITEMS
|
||||
|
||||
|
||||
[[menu.docs]]
|
||||
name = "Troubleshooting"
|
||||
weight = 60
|
||||
identifier = "troubleshooting"
|
||||
url = "/troubleshooting/"
|
||||
|
||||
[[menu.docs]]
|
||||
name = "Tools"
|
||||
weight = 70
|
||||
identifier = "tools"
|
||||
url = "/tools/"
|
||||
|
||||
[[menu.docs]]
|
||||
name = "Hosting & Deployment"
|
||||
weight = 80
|
||||
identifier = "hosting-and-deployment"
|
||||
url = "/hosting-and-deployment/"
|
||||
|
||||
[[menu.docs]]
|
||||
name = "Contribute"
|
||||
weight = 100
|
||||
post = "break"
|
||||
identifier = "contribute"
|
||||
url = "/contribute/"
|
||||
|
||||
#[[menu.docs]]
|
||||
# name = "Tags"
|
||||
# weight = 120
|
||||
# identifier = "tags"
|
||||
# url = "/tags/"
|
||||
|
||||
|
||||
# [[menu.docs]]
|
||||
# name = "Categories"
|
||||
# weight = 140
|
||||
# identifier = "categories"
|
||||
# url = "/categories/"
|
||||
|
||||
######## QUICKLINKS
|
||||
|
||||
[[menu.quicklinks]]
|
||||
name = "Fundamentals"
|
||||
weight = 1
|
||||
identifier = "fundamentals"
|
||||
url = "/tags/fundamentals/"
|
||||
|
||||
|
||||
|
||||
|
||||
######## GLOBAL ITEMS TO BE SHARED WITH THE HUGO SITES
|
||||
|
||||
[[menu.global]]
|
||||
name = "News"
|
||||
weight = 1
|
||||
identifier = "news"
|
||||
url = "/news/"
|
||||
|
||||
[[menu.global]]
|
||||
name = "Docs"
|
||||
weight = 5
|
||||
identifier = "docs"
|
||||
url = "/documentation/"
|
||||
|
||||
[[menu.global]]
|
||||
name = "Themes"
|
||||
weight = 10
|
||||
identifier = "themes"
|
||||
pre = "<i class='fa fa-desktop'></i>"
|
||||
weight = -85
|
||||
[[menu.main]]
|
||||
parent = "themes"
|
||||
name = "Theme Showcase"
|
||||
url = "http://themes.gohugo.io"
|
||||
weight = -170
|
||||
[[menu.main]]
|
||||
name = "Templates"
|
||||
identifier = "layout"
|
||||
pre = "<i class='fa fa-columns'></i>"
|
||||
weight = -80
|
||||
[[menu.main]]
|
||||
name = "Taxonomies"
|
||||
identifier = "taxonomy"
|
||||
pre = "<i class='fa fa-tags'></i>"
|
||||
weight = -70
|
||||
[[menu.main]]
|
||||
name = "Extras"
|
||||
identifier = "extras"
|
||||
pre = "<i class='fa fa-gift'></i>"
|
||||
weight = -60
|
||||
[[menu.main]]
|
||||
url = "https://themes.gohugo.io/"
|
||||
|
||||
# Anything with a weight > 100 gets an external icon
|
||||
[[menu.global]]
|
||||
name = "Community"
|
||||
identifier = "community"
|
||||
pre = "<i class='fa fa-group'></i>"
|
||||
weight = -50
|
||||
[[menu.main]]
|
||||
parent = "community"
|
||||
name = "Discussion Forum"
|
||||
url = "https://discourse.gohugo.io/"
|
||||
weight = 150
|
||||
[[menu.main]]
|
||||
name = "Tutorials"
|
||||
identifier = "tutorials"
|
||||
pre = "<i class='fa fa-book'></i>"
|
||||
weight = -40
|
||||
[[menu.main]]
|
||||
name = "Troubleshooting"
|
||||
identifier = "troubleshooting"
|
||||
pre = "<i class='fa fa-wrench'></i>"
|
||||
weight = -30
|
||||
[[menu.main]]
|
||||
name = "Tools"
|
||||
url = "/tools/"
|
||||
pre = "<i class='fa fa-cogs'></i>"
|
||||
weight = -25
|
||||
[[menu.main]]
|
||||
name = "Hugo Cmd Reference"
|
||||
identifier = "commands"
|
||||
pre = "<i class='fa fa-space-shuttle'></i>"
|
||||
weight = -20
|
||||
url = "/commands/"
|
||||
icon = true
|
||||
identifier = "community"
|
||||
post = "external"
|
||||
url = "https://discourse.gohugo.io/"
|
||||
|
||||
|
||||
[[menu.global]]
|
||||
name = "GitHub"
|
||||
weight = 200
|
||||
identifier = "github"
|
||||
post = "external"
|
||||
url = "https://github.com/gohugoio/hugo"
|
||||
@@ -0,0 +1,49 @@
|
||||
---
|
||||
title: "Hugo: A Fast and Flexible Website Generator"
|
||||
date: 2017-03-02T12:00:00-05:00
|
||||
features:
|
||||
- heading: Blistering Speed
|
||||
image_path: /images/icon-fast.svg
|
||||
tagline: What's modern about waiting for your site to build?
|
||||
copy: Hugo is the fastest tool of its kind. At <1 ms per page, the average site builds in less than a second.
|
||||
|
||||
- heading: Robust Content Management
|
||||
image_path: /images/icon-content-management.svg
|
||||
tagline: Flexibility rules. Hugo is a content strategist's dream.
|
||||
copy: Hugo supports unlimited content types, taxonomies, menus, dynamic API-driven content, and more, all without plugins.
|
||||
|
||||
- heading: Shortcodes
|
||||
image_path: /images/icon-shortcodes.svg
|
||||
tagline: Hugo's shortcodes are Markdown's hidden superpower.
|
||||
copy: We love the beautiful simplicity of markdown’s syntax, but there are times when we want more flexibility. Hugo shortcodes allow for both beauty and flexibility.
|
||||
|
||||
- heading: Built-in Templates
|
||||
image_path: /images/icon-built-in-templates.svg
|
||||
tagline: Hugo has common patterns to get your work done quickly.
|
||||
copy: Hugo ships with pre-made templates to make quick work of SEO, commenting, analytics and other functions. One line of code, and you're done.
|
||||
|
||||
- heading: Multilingual and i18n
|
||||
image_path: /images/icon-multilingual2.svg
|
||||
tagline: Polyglot baked in.
|
||||
copy: Hugo provides full i18n support for multi-language sites with the same straightforward development experience Hugo users love in single-language sites.
|
||||
|
||||
- heading: Custom Outputs
|
||||
image_path: /images/icon-custom-outputs.svg
|
||||
tagline: HTML not Enough?
|
||||
copy: Hugo allows you to output your content in multiple formats, including JSON or AMP, and makes it easy to create your own.
|
||||
sections:
|
||||
- heading: "100s of Themes"
|
||||
cta: Check out the Hugo's themes.
|
||||
link: http://themes.gohugo.io/
|
||||
color_classes: bg-accent-color white
|
||||
image: /images/homepage-screenshot-hugo-themes.jpg
|
||||
copy: "Hugo provides a robust theming system that is easy to implement but capable of producing even the most complicated websites."
|
||||
- heading: "Capable Templating"
|
||||
cta: Get Started.
|
||||
link: templates/
|
||||
color_classes: bg-primary-color-light black
|
||||
image: /images/home-page-templating-example.png
|
||||
copy: "Hugo's Go-based templating provides just the right amount of logic to build anything from the simple to complex. If you prefer Jade/Pug-like syntax, you can also use Amber, Ace, or any combination of the three."
|
||||
---
|
||||
|
||||
Hugo is one of the most popular open-source static site generators. With its amazing speed and flexibility, Hugo makes building websites fun again.
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
title: About Hugo
|
||||
linktitle: Overview
|
||||
description: Hugo's features, roadmap, license, and motivation.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: []
|
||||
#tags: []
|
||||
menu:
|
||||
docs:
|
||||
parent: "about"
|
||||
weight: 1
|
||||
weight: 1
|
||||
draft: false
|
||||
aliases: [/about-hugo/,/docs/]
|
||||
toc: false
|
||||
---
|
||||
|
||||
Hugo is not your average static site generator.
|
||||
@@ -0,0 +1,43 @@
|
||||
---
|
||||
title: The Benefits of Static Site Generators
|
||||
linktitle: The Benefits of Static
|
||||
description: Improved performance, security and ease of use are just a few of the reasons static site generators are so appealing.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
#tags: [ssg,static,performance,security]
|
||||
menu:
|
||||
docs:
|
||||
parent: "about"
|
||||
weight: 30
|
||||
weight: 30
|
||||
sections_weight: 30
|
||||
draft: false
|
||||
aliases: []
|
||||
toc: false
|
||||
---
|
||||
|
||||
The purpose of website generators is to render content into HTML files. Most are "dynamic site generators." That means the HTTP server---i.e., the program that sends files to the browser to be viewed---runs the generator to create a new HTML file every time an end user requests a page.
|
||||
|
||||
Over time, dynamic site generators were programmed to cache their HTML files to prevent unnecessary delays in delivering pages to end users. A cached page is a static version of a web page.
|
||||
|
||||
Hugo takes caching a step further and all HTML files are rendered on your computer. You can review the files locally before copying them to the computer hosting the HTTP server. Since the HTML files aren't generated dynamically, we say that Hugo is a *static site generator*.
|
||||
|
||||
This has many benefits. The most noticeable is performance. HTTP servers are *very* good at sending files---so good, in fact, that you can effectively serve the same number of pages with a fraction of the memory and CPU needed for a dynamic site.
|
||||
|
||||
## More on Static Site Generators
|
||||
|
||||
* ["An Introduction to Static Site Generators", David Walsh][]
|
||||
* ["Hugo vs. Wordpress page load speed comparison: Hugo leaves WordPress in its dust", GettingThingsTech][hugovwordpress]
|
||||
* ["Static Site Generators", O-Reilly][]
|
||||
* [StaticGen: Top Open-Source Static Site Generators (GitHub Stars)][]
|
||||
* ["Top 10 Static Website Generators", Netlify blog][]
|
||||
* ["The Resurgence of Static", dotCMS][dotcms]
|
||||
|
||||
|
||||
["An Introduction to Static Site Generators", David Walsh]: https://davidwalsh.name/introduction-static-site-generators
|
||||
["Static Site Generators", O-Reilly]: /documents/oreilly-static-site-generators.pdf
|
||||
["Top 10 Static Website Generators", Netlify blog]: https://www.netlify.com/blog/2016/05/02/top-ten-static-website-generators/
|
||||
[hugovwordpress]: https://gettingthingstech.com/hugo-vs.-wordpress-page-load-speed-comparison-hugo-leaves-wordpress-in-its-dust/
|
||||
[StaticGen: Top Open-Source Static Site Generators (GitHub Stars)]: https://www.staticgen.com/
|
||||
[dotcms]: https://dotcms.com/blog/post/the-resurgence-of-static
|
||||
@@ -0,0 +1,90 @@
|
||||
---
|
||||
title: Hugo Features
|
||||
linktitle: Hugo Features
|
||||
description: Hugo boasts blistering speed, robust content management, and a powerful templating language making it a great fit for all kinds of static websites.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
menu:
|
||||
docs:
|
||||
parent: "about"
|
||||
weight: 20
|
||||
weight: 20
|
||||
sections_weight: 20
|
||||
draft: false
|
||||
aliases: [/about/features]
|
||||
toc: true
|
||||
---
|
||||
|
||||
## General
|
||||
|
||||
* [Extremely fast][] build times (< 1 ms per page)
|
||||
* Completely cross platform, with [easy installation][install] on macOS, Linux, Windows, and more
|
||||
* Renders changes on the fly with [LiveReload][] as you develop
|
||||
* [Powerful theming][]
|
||||
* [Host your site anywhere][hostanywhere]
|
||||
|
||||
## Organization
|
||||
|
||||
* Straightforward [organization for your projects][], including website sections
|
||||
* Customizable [URLs][]
|
||||
* Support for configurable [taxonomies][], including categories and tags
|
||||
* [Sort content][] as you desire through powerful template [functions][]
|
||||
* Automatic [table of contents][] generation
|
||||
* [Dynamic menu][] creation
|
||||
* [Pretty URLs][] support
|
||||
* [Permalink][] pattern support
|
||||
* Redirects via [aliases][]
|
||||
|
||||
## Content
|
||||
|
||||
* Native Markdown and Emacs Org-Mode support, as well as other languages via *external helpers* (see [supported formats][])
|
||||
* TOML, YAML, and JSON metadata support in [front matter][]
|
||||
* Customizable [homepage][]
|
||||
* Multiple [content types][]
|
||||
* Automatic and user defined [content summaries][]
|
||||
* [Shortcodes][] to enable rich content inside of Markdown
|
||||
* ["Minutes to Read"][pagevars] functionality
|
||||
* ["Wordcount"][pagevars] functionality
|
||||
|
||||
## Additional Features
|
||||
|
||||
* Integrated [Disqus][] comment support
|
||||
* Integrated [Google Analytics][] support
|
||||
* Automatic [RSS][] creation
|
||||
* Support for [Go][], [Amber], and [Ace][] HTML templates
|
||||
* [Syntax highlighting][] powered by [Pygments][]
|
||||
|
||||
See what's coming next in the [Hugo roadmap][].
|
||||
|
||||
[Ace]: /templates/alternatives/
|
||||
[aliases]: /content-management/urls/#aliases
|
||||
[Amber]: https://github.com/eknkc/amber
|
||||
[content summaries]: /content-management/summaries/
|
||||
[content types]: /content-management/types/
|
||||
[Disqus]: https://disqus.com/
|
||||
[Dynamic menu]: /templates/menus/
|
||||
[Extremely fast]: https://github.com/bep/hugo-benchmark
|
||||
[front matter]: /content-management/front-matter/
|
||||
[functions]: /functions/
|
||||
[Go]: http://golang.org/pkg/html/template/
|
||||
[Google Analytics]: https://google-analytics.com/
|
||||
[homepage]: /templates/homepage/
|
||||
[hostanywhere]: /hosting-and-deployment/
|
||||
[Hugo roadmap]: /about/roadmap
|
||||
[install]: /getting-started/installing/
|
||||
[LiveReload]: /getting-started/usage/
|
||||
[organization for your projects]: /getting-started/directory-structure/
|
||||
[pagevars]: /variables/page/
|
||||
[Permalink]: /content-management/urls/#permalinks
|
||||
[Powerful theming]: /themes/
|
||||
[Pretty URLs]: /content-management/urls/
|
||||
[Pygments]: http://pygments.org/
|
||||
[RSS]: /templates/rss/
|
||||
[Shortcodes]: /content-management/shortcodes/
|
||||
[sort content]: /templates/
|
||||
[supported formats]: /content-management/formats/
|
||||
[Syntax highlighting]: /tools/syntax-highlighting/
|
||||
[table of contents]: /content-management/toc/
|
||||
[taxonomies]: /content-management/taxonomies/
|
||||
[URLs]: /content-management/urls/
|
||||
@@ -0,0 +1,167 @@
|
||||
---
|
||||
title: Apache License
|
||||
linktitle: License
|
||||
description: Hugo v0.15 and later are released under the Apache 2.0 license.
|
||||
date: 2016-02-01
|
||||
publishdate: 2016-02-01
|
||||
lastmod: 2016-03-02
|
||||
categories: ["about hugo"]
|
||||
#tags: ["License","apache"]
|
||||
menu:
|
||||
docs:
|
||||
parent: "about"
|
||||
weight: 60
|
||||
weight: 60
|
||||
sections_weight: 60
|
||||
aliases: [/meta/license]
|
||||
toc: true
|
||||
---
|
||||
|
||||
{{% note %}}
|
||||
Hugo v0.15 and later are released under the Apache 2.0 license.
|
||||
Earlier versions of Hugo were released under the [Simple Public License](https://opensource.org/licenses/Simple-2.0).
|
||||
{{% /note %}}
|
||||
|
||||
_Version 2.0, January 2004_ <br>
|
||||
<http://www.apache.org/licenses/LICENSE-2.0>
|
||||
|
||||
*Terms and Conditions for use, reproduction, and distribution*
|
||||
|
||||
## 1. Definitions
|
||||
|
||||
“License” shall mean the terms and conditions for use, reproduction, and
|
||||
distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
“Licensor” shall mean the copyright owner or entity authorized by the copyright
|
||||
owner that is granting the License.
|
||||
|
||||
“Legal Entity” shall mean the union of the acting entity and all other entities
|
||||
that control, are controlled by, or are under common control with that entity.
|
||||
For the purposes of this definition, “control” means **(i)** the power, direct or
|
||||
indirect, to cause the direction or management of such entity, whether by
|
||||
contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or **(iii)** beneficial ownership of such entity.
|
||||
|
||||
“You” (or “Your”) shall mean an individual or Legal Entity exercising
|
||||
permissions granted by this License.
|
||||
|
||||
“Source” form shall mean the preferred form for making modifications, including
|
||||
but not limited to software source code, documentation source, and configuration
|
||||
files.
|
||||
|
||||
“Object” form shall mean any form resulting from mechanical transformation or
|
||||
translation of a Source form, including but not limited to compiled object code,
|
||||
generated documentation, and conversions to other media types.
|
||||
|
||||
“Work” shall mean the work of authorship, whether in Source or Object form, made
|
||||
available under the License, as indicated by a copyright notice that is included
|
||||
in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
“Derivative Works” shall mean any work, whether in Source or Object form, that
|
||||
is based on (or derived from) the Work and for which the editorial revisions,
|
||||
annotations, elaborations, or other modifications represent, as a whole, an
|
||||
original work of authorship. For the purposes of this License, Derivative Works
|
||||
shall not include works that remain separable from, or merely link (or bind by
|
||||
name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
“Contribution” shall mean any work of authorship, including the original version
|
||||
of the Work and any modifications or additions to that Work or Derivative Works
|
||||
thereof, that is intentionally submitted to Licensor for inclusion in the Work
|
||||
by the copyright owner or by an individual or Legal Entity authorized to submit
|
||||
on behalf of the copyright owner. For the purposes of this definition,
|
||||
“submitted” means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems, and
|
||||
issue tracking systems that are managed by, or on behalf of, the Licensor for
|
||||
the purpose of discussing and improving the Work, but excluding communication
|
||||
that is conspicuously marked or otherwise designated in writing by the copyright
|
||||
owner as “Not a Contribution.”
|
||||
|
||||
“Contributor” shall mean Licensor and any individual or Legal Entity on behalf
|
||||
of whom a Contribution has been received by Licensor and subsequently
|
||||
incorporated within the Work.
|
||||
|
||||
## 2. Grant of Copyright License
|
||||
|
||||
Subject to the terms and conditions of this License, each Contributor hereby
|
||||
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
|
||||
irrevocable copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the Work and such
|
||||
Derivative Works in Source or Object form.
|
||||
|
||||
## 3. Grant of Patent License
|
||||
|
||||
Subject to the terms and conditions of this License, each Contributor hereby
|
||||
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
|
||||
irrevocable (except as stated in this section) patent license to make, have
|
||||
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
|
||||
such license applies only to those patent claims licensable by such Contributor
|
||||
that are necessarily infringed by their Contribution(s) alone or by combination
|
||||
of their Contribution(s) with the Work to which such Contribution(s) was
|
||||
submitted. If You institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
|
||||
Contribution incorporated within the Work constitutes direct or contributory
|
||||
patent infringement, then any patent licenses granted to You under this License
|
||||
for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
## 4. Redistribution
|
||||
|
||||
You may reproduce and distribute copies of the Work or Derivative Works thereof
|
||||
in any medium, with or without modifications, and in Source or Object form,
|
||||
provided that You meet the following conditions:
|
||||
|
||||
* **(a)** You must give any other recipients of the Work or Derivative Works a copy of
|
||||
this License; and
|
||||
* **(b)** You must cause any modified files to carry prominent notices stating that You
|
||||
changed the files; and
|
||||
* **\(c)** You must retain, in the Source form of any Derivative Works that You distribute,
|
||||
all copyright, patent, trademark, and attribution notices from the Source form
|
||||
of the Work, excluding those notices that do not pertain to any part of the
|
||||
Derivative Works; and
|
||||
* **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||
|
||||
## 5. Submission of Contributions
|
||||
|
||||
Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
|
||||
## 6. Trademarks
|
||||
|
||||
This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
## 7. Disclaimer of Warranty
|
||||
|
||||
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||
|
||||
## 8. Limitation of Liability
|
||||
|
||||
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||
|
||||
## 9. Accepting Warranty or Additional Liability
|
||||
|
||||
While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
||||
|
||||
_END OF TERMS AND CONDITIONS_
|
||||
|
||||
## APPENDIX: How to apply the Apache License to your work
|
||||
|
||||
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets `[]` replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same “printed page” as the copyright notice for easier identification within third-party archives.
|
||||
|
||||
{{% code file="apache-notice.txt" download="apache-notice.txt" %}}
|
||||
```
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
```
|
||||
{{% /code %}}
|
||||
@@ -0,0 +1,51 @@
|
||||
---
|
||||
title: Roadmap
|
||||
linktitle: Roadmap
|
||||
description: Take a look at what's in the pipeline for future versions of the Hugo project.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [about hugo]
|
||||
#tags: [about,contribute,roadmap]
|
||||
menu:
|
||||
docs:
|
||||
parent: "about"
|
||||
weight: 50
|
||||
weight: 50
|
||||
sections_weight: 50
|
||||
draft: false
|
||||
aliases: [/meta/roadmap]
|
||||
toc: false
|
||||
---
|
||||
|
||||
To track Hugo's progress, see our [GitHub Milestones][milestones].
|
||||
|
||||
In no particular order, here are some other features currently being worked on:
|
||||
|
||||
* Even easier deployment to S3, SSH, GitHub, rsync. Give the [hosting and deployment][] section a shot.
|
||||
* Import from other website systems. There are already [existing migration tools][migrate], but they don’t cover all major platforms.
|
||||
* An interactive web-based editor (See the [related forum thread][])
|
||||
* Additional [themes][], which are always ongoing and [contributions are welcome][themescontrib]!
|
||||
* Dynamic image resizing via shortcodes ({{< gh 1014 >}})
|
||||
* Native support for additional content formats (AsciiDoc {{< gh 1435>}}, reST {{< gh 1436 >}})
|
||||
* And, last but not least, [***your*** best ideas!][]
|
||||
|
||||
## Contributions Welcome
|
||||
|
||||
Feel free to [contribute to Hugo's development][devcontribute], [improve Hugo's documentation][doccontribute], or [open a new issue][newissue] if you have an idea for a new feature.
|
||||
|
||||
[#98]: https://github.com/gohugoio/hugo/issues/98
|
||||
[#1014]: https://github.com/gohugoio/hugo/issues/1014
|
||||
[#1435]: https://github.com/gohugoio/hugo/issues/1435
|
||||
[#1436]: https://github.com/gohugoio/hugo/issues/1436
|
||||
[devcontribute]: /contribute/development/
|
||||
[doccontribute]: /contribute/documentation/
|
||||
[hosting and deployment]: /hosting-and-deployment/
|
||||
[migrate]: /tools/migrations/
|
||||
[milestones]: https://github.com/gohugoio/hugo/milestone/14
|
||||
[newissue]: https://github.com/gohugoio/hugo/issues/
|
||||
[related forum thread]: https://disourse.gohugo.io/t/web-based-editor/155
|
||||
[themes]: /themes/
|
||||
[themescontrib]: /contribute/themes/
|
||||
[tutorials]: /tutorials
|
||||
[***your*** best ideas!]: /contribute/
|
||||
@@ -0,0 +1,69 @@
|
||||
---
|
||||
title: What is Hugo
|
||||
linktitle: What is Hugo
|
||||
description: Hugo is a fast and modern static site generator written in Go, and designed to make website creation fun again.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
layout: single
|
||||
menu:
|
||||
main:
|
||||
parent: "about"
|
||||
weight: 10
|
||||
weight: 10
|
||||
sections_weight: 10
|
||||
draft: false
|
||||
aliases: [/overview/introduction/,/about/why-i-built-hugo/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
Hugo is a general-purpose website framework. Technically speaking, Hugo is a [static site generator][]. Unlike systems that dynamically build a page with each visitor request, Hugo builds pages when you create or update your content. Since websites are viewed far more often than they are edited, Hugo is designed to provide an optimal viewing experience for your website's end users and an ideal writing experience for website authors.
|
||||
|
||||
Websites built with Hugo are extremely fast and secure. Hugo sites can be hosted anywhere, including [Netlify][], [Heroku][], [GoDaddy][], [DreamHost][], [GitHub Pages][], [Surge][], [Aerobatic][], [Firebase][], [Google Cloud Storage][], [Amazon S3][], [Rackspace][], [Azure][], and [CloudFront][] and work well with CDNs. Hugo sites run without the need for a database or dependencies on expensive runtimes like Ruby, Python, or PHP.
|
||||
|
||||
We think of Hugo as the ideal website creation tool with nearly instant build times, able to rebuild whenever a change is made.
|
||||
|
||||
## How Fast is Hugo?
|
||||
|
||||
{{< youtube "CdiDYZ51a2o" >}}
|
||||
|
||||
## What Does Hugo Do?
|
||||
|
||||
In technical terms, Hugo takes a source directory of files and templates and uses these as input to create a complete website.
|
||||
|
||||
## Who Should Use Hugo?
|
||||
|
||||
Hugo is for people that prefer writing in a text editor over a browser.
|
||||
|
||||
Hugo is for people who want to hand code their own website without worrying about setting up complicated runtimes, dependencies and databases.
|
||||
|
||||
Hugo is for people building a blog, a company site, a portfolio site, documentation, a single landing page, or a website with thousands of pages.
|
||||
|
||||
|
||||
|
||||
[@spf13]: https://twitter.com/@spf13
|
||||
[Aerobatic]: https://www.aerobatic.com/
|
||||
[Amazon S3]: http://aws.amazon.com/s3/
|
||||
[Azure]: https://blogs.msdn.microsoft.com/acoat/2016/01/28/publish-a-static-web-site-using-azure-web-apps/
|
||||
[CloudFront]: http://aws.amazon.com/cloudfront/ "Amazon CloudFront"
|
||||
[contributing to it]: https://github.com/gohugoio/hugo
|
||||
[DreamHost]: http://www.dreamhost.com/
|
||||
[Firebase]: https://firebase.google.com/docs/hosting/ "Firebase static hosting"
|
||||
[GitHub Pages]: https://pages.github.com/
|
||||
[GitLab]: https://about.gitlab.com
|
||||
[Go language]: https://golang.org/
|
||||
[GoDaddy]: https://www.godaddy.com/ "Godaddy.com Hosting"
|
||||
[Google Cloud Storage]: http://cloud.google.com/storage/
|
||||
[Heroku]: https://www.heroku.com/
|
||||
[Jekyll]: http://jekyllrb.com/
|
||||
[Jekyll]: https://jekyllrb.com/
|
||||
[Middleman]: https://middlemanapp.com/
|
||||
[Middleman]: https://middlemanapp.com/
|
||||
[Nanoc]: http://nanoc.ws/
|
||||
[Nanoc]: https://nanoc.ws/
|
||||
[Netlify]: https://netlify.com
|
||||
[rackspace]: https://www.rackspace.com/cloud/files
|
||||
[static site generator]: /about/benefits/
|
||||
[Rackspace]: https://www.rackspace.com/cloud/files
|
||||
[static site generator]: /about/benefits/
|
||||
[Surge]: https://surge.sh
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
title: Command Line Reference
|
||||
linktitle: CLI Overview
|
||||
description: Comprehensive list of Hugo templating functions, including basic and advanced usage examples.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [commands]
|
||||
#tags: [cli,command line]
|
||||
menu:
|
||||
docs:
|
||||
parent: "commands"
|
||||
weight: 1
|
||||
weight: 01 #rem
|
||||
draft: false
|
||||
aliases: [/cli/]
|
||||
---
|
||||
|
||||
The following list contains auto-generated and up-to-date (thanks to [Cobra][]) documentation for all the CLI commands in Hugo.
|
||||
|
||||
|
||||
[Cobra]: https://github.com/spf13/cobra
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo"
|
||||
slug: hugo
|
||||
url: /commands/hugo/
|
||||
@@ -74,7 +74,7 @@ hugo [flags]
|
||||
* [hugo list](/commands/hugo_list/) - Listing out various types of content
|
||||
* [hugo new](/commands/hugo_new/) - Create new content for your site
|
||||
* [hugo server](/commands/hugo_server/) - A high performance webserver
|
||||
* [hugo undraft](/commands/hugo_undraft/) - Undraft changes the content's draft status from 'True' to 'False'
|
||||
* [hugo undraft](/commands/hugo_undraft/) - Undraft resets the content's draft status
|
||||
* [hugo version](/commands/hugo_version/) - Print the version number of Hugo
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo benchmark"
|
||||
slug: hugo_benchmark
|
||||
url: /commands/hugo_benchmark/
|
||||
@@ -69,4 +69,4 @@ hugo benchmark [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo check"
|
||||
slug: hugo_check
|
||||
url: /commands/hugo_check/
|
||||
@@ -34,4 +34,4 @@ Contains some verification checks
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
* [hugo check ulimit](/commands/hugo_check_ulimit/) - Check system ulimit settings
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo check ulimit"
|
||||
slug: hugo_check_ulimit
|
||||
url: /commands/hugo_check_ulimit/
|
||||
@@ -38,4 +38,4 @@ hugo check ulimit [flags]
|
||||
### SEE ALSO
|
||||
* [hugo check](/commands/hugo_check/) - Contains some verification checks
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo config"
|
||||
slug: hugo_config
|
||||
url: /commands/hugo_config/
|
||||
@@ -37,4 +37,4 @@ hugo config [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo convert"
|
||||
slug: hugo_convert
|
||||
url: /commands/hugo_convert/
|
||||
@@ -41,4 +41,4 @@ See convert's subcommands toJSON, toTOML and toYAML for more information.
|
||||
* [hugo convert toTOML](/commands/hugo_convert_totoml/) - Convert front matter to TOML
|
||||
* [hugo convert toYAML](/commands/hugo_convert_toyaml/) - Convert front matter to YAML
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo convert toJSON"
|
||||
slug: hugo_convert_toJSON
|
||||
url: /commands/hugo_convert_tojson/
|
||||
@@ -41,4 +41,4 @@ hugo convert toJSON [flags]
|
||||
### SEE ALSO
|
||||
* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo convert toTOML"
|
||||
slug: hugo_convert_toTOML
|
||||
url: /commands/hugo_convert_totoml/
|
||||
@@ -41,4 +41,4 @@ hugo convert toTOML [flags]
|
||||
### SEE ALSO
|
||||
* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo convert toYAML"
|
||||
slug: hugo_convert_toYAML
|
||||
url: /commands/hugo_convert_toyaml/
|
||||
@@ -41,4 +41,4 @@ hugo convert toYAML [flags]
|
||||
### SEE ALSO
|
||||
* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo env"
|
||||
slug: hugo_env
|
||||
url: /commands/hugo_env/
|
||||
@@ -37,4 +37,4 @@ hugo env [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo gen"
|
||||
slug: hugo_gen
|
||||
url: /commands/hugo_gen/
|
||||
@@ -36,4 +36,4 @@ A collection of several useful generators.
|
||||
* [hugo gen doc](/commands/hugo_gen_doc/) - Generate Markdown documentation for the Hugo CLI.
|
||||
* [hugo gen man](/commands/hugo_gen_man/) - Generate man pages for the Hugo CLI
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo gen autocomplete"
|
||||
slug: hugo_gen_autocomplete
|
||||
url: /commands/hugo_gen_autocomplete/
|
||||
@@ -55,4 +55,4 @@ hugo gen autocomplete [flags]
|
||||
### SEE ALSO
|
||||
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo gen doc"
|
||||
slug: hugo_gen_doc
|
||||
url: /commands/hugo_gen_doc/
|
||||
@@ -44,4 +44,4 @@ hugo gen doc [flags]
|
||||
### SEE ALSO
|
||||
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo gen man"
|
||||
slug: hugo_gen_man
|
||||
url: /commands/hugo_gen_man/
|
||||
@@ -40,4 +40,4 @@ hugo gen man [flags]
|
||||
### SEE ALSO
|
||||
* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo import"
|
||||
slug: hugo_import
|
||||
url: /commands/hugo_import/
|
||||
@@ -36,4 +36,4 @@ Import requires a subcommand, e.g. `hugo import jekyll jekyll_root_path target_p
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
* [hugo import jekyll](/commands/hugo_import_jekyll/) - hugo import from Jekyll
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo import jekyll"
|
||||
slug: hugo_import_jekyll
|
||||
url: /commands/hugo_import_jekyll/
|
||||
@@ -40,4 +40,4 @@ hugo import jekyll [flags]
|
||||
### SEE ALSO
|
||||
* [hugo import](/commands/hugo_import/) - Import your site from others.
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo list"
|
||||
slug: hugo_list
|
||||
url: /commands/hugo_list/
|
||||
@@ -39,4 +39,4 @@ List requires a subcommand, e.g. `hugo list drafts`.
|
||||
* [hugo list expired](/commands/hugo_list_expired/) - List all posts already expired
|
||||
* [hugo list future](/commands/hugo_list_future/) - List all posts dated in the future
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo list drafts"
|
||||
slug: hugo_list_drafts
|
||||
url: /commands/hugo_list_drafts/
|
||||
@@ -38,4 +38,4 @@ hugo list drafts [flags]
|
||||
### SEE ALSO
|
||||
* [hugo list](/commands/hugo_list/) - Listing out various types of content
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo list expired"
|
||||
slug: hugo_list_expired
|
||||
url: /commands/hugo_list_expired/
|
||||
@@ -39,4 +39,4 @@ hugo list expired [flags]
|
||||
### SEE ALSO
|
||||
* [hugo list](/commands/hugo_list/) - Listing out various types of content
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo list future"
|
||||
slug: hugo_list_future
|
||||
url: /commands/hugo_list_future/
|
||||
@@ -39,4 +39,4 @@ hugo list future [flags]
|
||||
### SEE ALSO
|
||||
* [hugo list](/commands/hugo_list/) - Listing out various types of content
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo new"
|
||||
slug: hugo_new
|
||||
url: /commands/hugo_new/
|
||||
@@ -47,4 +47,4 @@ hugo new [path] [flags]
|
||||
* [hugo new site](/commands/hugo_new_site/) - Create a new site (skeleton)
|
||||
* [hugo new theme](/commands/hugo_new_theme/) - Create a new theme
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo new site"
|
||||
slug: hugo_new_site
|
||||
url: /commands/hugo_new_site/
|
||||
@@ -42,4 +42,4 @@ hugo new site [path] [flags]
|
||||
### SEE ALSO
|
||||
* [hugo new](/commands/hugo_new/) - Create new content for your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo new theme"
|
||||
slug: hugo_new_theme
|
||||
url: /commands/hugo_new_theme/
|
||||
@@ -41,4 +41,4 @@ hugo new theme [name] [flags]
|
||||
### SEE ALSO
|
||||
* [hugo new](/commands/hugo_new/) - Create new content for your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo server"
|
||||
slug: hugo_server
|
||||
url: /commands/hugo_server/
|
||||
@@ -55,6 +55,7 @@ hugo server [flags]
|
||||
-l, --layoutDir string filesystem path to layout directory
|
||||
--meminterval string interval to poll memory usage (requires --memstats), valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". (default "100ms")
|
||||
--memstats string log memory usage to this file
|
||||
--navigateToChanged navigate to changed content file on live browser reload
|
||||
--noChmod don't sync permission mode of files
|
||||
--noTimes don't sync modification time of files
|
||||
--pluralizeListTitles pluralize titles in lists using inflect (default true)
|
||||
@@ -83,4 +84,4 @@ hugo server [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,17 +1,17 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo undraft"
|
||||
slug: hugo_undraft
|
||||
url: /commands/hugo_undraft/
|
||||
---
|
||||
## hugo undraft
|
||||
|
||||
Undraft changes the content's draft status from 'True' to 'False'
|
||||
Undraft resets the content's draft status
|
||||
|
||||
### Synopsis
|
||||
|
||||
|
||||
Undraft changes the content's draft status from 'True' to 'False'
|
||||
Undraft resets the content's draft status
|
||||
and updates the date to the current date and time.
|
||||
If the content's draft status is 'False', nothing is done.
|
||||
|
||||
@@ -39,4 +39,4 @@ hugo undraft path/to/content [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
date: 2017-06-29T08:42:09+02:00
|
||||
date: 2017-07-16T23:23:14+02:00
|
||||
title: "hugo version"
|
||||
slug: hugo_version
|
||||
url: /commands/hugo_version/
|
||||
@@ -37,4 +37,4 @@ hugo version [flags]
|
||||
### SEE ALSO
|
||||
* [hugo](/commands/hugo/) - hugo builds your site
|
||||
|
||||
###### Auto generated by spf13/cobra on 29-Jun-2017
|
||||
###### Auto generated by spf13/cobra on 16-Jul-2017
|
||||
@@ -1,111 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /doc/contributing/
|
||||
- /meta/contributing/
|
||||
lastmod: 2015-02-12
|
||||
date: 2013-07-01
|
||||
menu:
|
||||
main:
|
||||
parent: community
|
||||
next: /tutorials/automated-deployments
|
||||
prev: /community/mailing-list
|
||||
title: Contributing to Hugo
|
||||
weight: 30
|
||||
---
|
||||
|
||||
All contributions to Hugo are welcome. Whether you want to scratch an itch or simply contribute to the project, feel free to pick something from the [roadmap]({{< relref "meta/roadmap.md" >}}) or contact the dev team via the [Forums](https://discourse.gohugo.io/) or [Gitter](https://gitter.im/gohugoio/hugo) about what may make sense to do next.
|
||||
|
||||
You should fork the project and make your changes. *We encourage pull requests to discuss code changes.*
|
||||
|
||||
|
||||
When you're ready to create a pull request, be sure to:
|
||||
|
||||
* Have test cases for the new code. If you have questions about how to do it, please ask in your pull request.
|
||||
* Run `go fmt`.
|
||||
* Squash your commits into a single commit. `git rebase -i`. It's okay to force update your pull request.
|
||||
* Run `make check` and ensure it succeeds. [Travis CI](https://travis-ci.org/gohugoio/hugo) and [Appveyor](https://ci.appveyor.com/project/gohugoio/hugo) will runs these checks and fail the build if `make check` fails.
|
||||
|
||||
## Contribution Overview
|
||||
|
||||
We wrote a [detailed guide]({{< relref "tutorials/how-to-contribute-to-hugo.md" >}}) for newcomers that guides you step by step to your first contribution. If you are more experienced, follow the guide below.
|
||||
|
||||
|
||||
# Building from source
|
||||
|
||||
## Vendored Dependencies
|
||||
|
||||
Hugo uses [govendor][] to vendor dependencies, but we don't commit the vendored packages themselves to the Hugo git repository.
|
||||
Therefore, a simple `go get` is not supported since `go get` is not vendor-aware.
|
||||
You **must use govendor** to fetch Hugo's dependencies.
|
||||
|
||||
## Fetch the Sources
|
||||
|
||||
go get github.com/kardianos/govendor
|
||||
govendor get github.com/gohugoio/hugo
|
||||
|
||||
## Running Hugo
|
||||
|
||||
cd $HOME/go/src/github.com/gohugoio/hugo
|
||||
go run main.go
|
||||
|
||||
## Building Hugo
|
||||
|
||||
cd $HOME/go/src/github.com/gohugoio/hugo
|
||||
make build
|
||||
# or to install to $HOME/go/bin:
|
||||
make install
|
||||
|
||||
|
||||
# Showcase additions
|
||||
|
||||
You got your new website running and it's powered by Hugo? Great. You can add your website with a few steps to the [showcase](/showcase/).
|
||||
|
||||
First, make sure that you created a [fork](https://help.github.com/articles/fork-a-repo/) of the [`hugoDocs`](https://github.com/gohugoio/hugodocs) repository on GitHub and cloned your fork on your local computer. **Next, create a separate branch for your additions**:
|
||||
|
||||
```
|
||||
# You can choose a different descriptive branch name if you like
|
||||
git checkout -b showcase-addition
|
||||
```
|
||||
|
||||
Let's create a new document that contains some metadata of your homepage. Replace `example` in the following examples with something unique like the name of your website. Inside the terminal enter the following commands:
|
||||
|
||||
```
|
||||
cd docs
|
||||
hugo new showcase/example.md
|
||||
```
|
||||
|
||||
You should find the new file at `content/showcase/example.md`. Open it in an editor. The file should contain a frontmatter with predefined variables like below:
|
||||
|
||||
```
|
||||
---
|
||||
date: 2016-02-12T21:01:18+01:00
|
||||
description: ""
|
||||
license: ""
|
||||
licenseLink: ""
|
||||
sitelink: http://spf13.com/
|
||||
sourceLink: https://github.com/spf13/spf13.com
|
||||
tags:
|
||||
- personal
|
||||
- blog
|
||||
thumbnail: /img/spf13-tn.jpg
|
||||
title: example
|
||||
---
|
||||
```
|
||||
|
||||
Add at least values for `sitelink`, `title`, `description` and a path for `thumbnail`.
|
||||
|
||||
Furthermore, we need to create the thumbnail of your website. **It's important that the thumbnail has the required dimensions of 600px by 400px.** Give your thumbnail a name like `example-tn.png`. Save it under `static/img/`.
|
||||
|
||||
Check a last time that everything works as expected. Start Hugo's built-in server in order to inspect your local copy of the showcase in the browser:
|
||||
|
||||
hugo server
|
||||
|
||||
If everything looks fine, we are ready to commit your additions. For the sake of best practices, please make sure that your commit follows our [code contribution guideline](https://github.com/gohugoio/hugo#code-contribution-guideline).
|
||||
|
||||
git commit -m"Add example.com to the showcase"
|
||||
|
||||
Last but not least, we're ready to create a [pull request](https://github.com/gohugoio/hugoDocs/compare).
|
||||
|
||||
Don't forget to accept the contributor license agreement. Click on the yellow badge in the automatically added comment in the pull request.
|
||||
|
||||
[govendor]: https://github.com/kardianos/govendor
|
||||
@@ -1,51 +0,0 @@
|
||||
---
|
||||
lastmod: 2015-05-25
|
||||
date: 2013-07-01
|
||||
menu:
|
||||
main:
|
||||
parent: community
|
||||
next: /community/contributing
|
||||
prev: /extras/urls
|
||||
title: Mailing List
|
||||
weight: 10
|
||||
---
|
||||
|
||||
## Discussion Forum
|
||||
|
||||
Hugo has its own [discussion forum](https://discourse.gohugo.io/) powered by [Discourse](http://www.discourse.org/).
|
||||
|
||||
Please use this for all discussions, questions, etc.
|
||||
|
||||
### Twitter
|
||||
|
||||
Get the latest bite-sized news and themes from the Hugo community on Twitter by following [@gohugoio](http://twitter.com/gohugoio).
|
||||
|
||||
## Mailing List
|
||||
|
||||
Hugo has two mailing lists:
|
||||
|
||||
### Announcements
|
||||
Very low traffic. Only releases will be emailed here.
|
||||
|
||||
https://groups.google.com/forum/#!forum/hugo-announce
|
||||
|
||||
### Discussion (Archive)
|
||||
|
||||
**This has been replaced with the [Hugo discussion forum](https://discourse.gohugo.io/).**
|
||||
|
||||
It is available for archival purposes.
|
||||
|
||||
https://groups.google.com/forum/#!forum/hugo-discuss
|
||||
|
||||
|
||||
## Other Resources
|
||||
|
||||
### GoNuts
|
||||
|
||||
For general Go questions or discussion please refer to the Go mailing list.
|
||||
|
||||
https://groups.google.com/forum/#!forum/golang-nuts
|
||||
|
||||
### GitHub Issues
|
||||
|
||||
https://github.com/gohugoio/hugo/issues
|
||||
@@ -1,141 +0,0 @@
|
||||
---
|
||||
lastmod: 2017-03-02
|
||||
date: 2014-03-24T20:00:00Z
|
||||
linktitle: Press
|
||||
notoc: true
|
||||
title: Press, Blogs and Media Coverage
|
||||
weight: 20
|
||||
---
|
||||
|
||||
### Help keep this list up to date
|
||||
|
||||
Know of a post, article or tutorial on Hugo? [Add it to this list](https://github.com/gohugoio/hugo/edit/master/docs/content/community/press.md).
|
||||
|
||||
## Press and Articles
|
||||
|
||||
Hugo has been featured in the following Blog Posts, Press and Media.
|
||||
|
||||
|
||||
| Title | Author | Date |
|
||||
| ------ | ------ | -----: |
|
||||
| [Build, Test, And Deploy Statically Generated Websites With Hugo & CircleCI](https://circleci.com/blog/build-test-deploy-hugo-sites/)| Ricardo N Feliciano | 2017-05-31 |
|
||||
| [Hugo Easy Gallery - Automagical PhotoSwipe image gallery with a one-line shortcode](https://www.liwen.id.au/heg/)| Li-Wen Yip | 2017-03-25 |
|
||||
| [Hugo Tutorial: How to Build & Host a (Very Fast) Static E-Commerce Site](https://snipcart.com/blog/hugo-tutorial-static-site-ecommerce) | Snipcart | 2017-03-12 |
|
||||
| [Automagical image gallery in Hugo with PhotoSwipe and jQuery](https://www.liwen.id.au/photoswipe/)| Li-Wen Yip | 2017-03-04 |
|
||||
| [Adding Isso Comments to Hugo](https://stiobhart.net/2017-02-24-isso-comments/) | Stíobhart Matulevicz | 2017-02-24 |
|
||||
| [Zero to HTTP/2 with AWS and Hugo](https://habd.as/zero-to-http-2-aws-hugo/) | Josh Habdas | 2017-02-16 |
|
||||
| [How to Password Protect a Hugo Site](https://www.aerobatic.com/blog/password-protect-a-hugo-site/) | Aerobatic | 2017-02-19 |
|
||||
| [Switching from Wordpress to Hugo](http://schnuddelhuddel.de/switching-from-wordpress-to-hugo/) | Mario Martelli | 2017-02-19 | ]
|
||||
| [Deploy a Hugo site to Aerobatic with CircleCI ](https://www.aerobatic.com/blog/hugo-github-circleci/) | Aerobatic | 2017-02-14 |
|
||||
| [NPM scripts for building and deploying Hugo site](https://www.aerobatic.com/blog/hugo-npm-buildtool-setup/) | Aerobatic | 2017-02-12 |
|
||||
| [Getting started with Hugo and the plain-blog theme, on NearlyFreeSpeech.Net](https://www.penwatch.net/cms/get_started_plain_blog/) | Li-aung “Lewis” Yip | 2017-02-12 |
|
||||
| [Build a Hugo site using Cloud9 IDE and host on App Engine](https://loyall.ch/lab/2017/01/build-a-static-website-with-cloud9-hugo-and-app-engine/)| Pascal Aubort | 2017-02-05 |
|
||||
| [Hugo Continuous Deployment with Bitbucket Pipelines and Aerobatic](https://www.aerobatic.com/blog/hugo-bitbucket-pipelines/) | Aerobatic | 2017-02-04 |
|
||||
| [How to use Firebase to host a Hugo site](https://www.m0d3rnc0ad.com/post/static-site-firebase/) | Andrew Cuga | 2017-02-04 |
|
||||
| [A publishing workflow for teams using static site generators](https://www.keybits.net/post/publishing-workflow-for-teams-using-static-site-generators/) | Tom Atkins | 2017-01-02 |
|
||||
| [How To Dynamically Use Google Fonts In A Hugo Website](https://stoned.io/web-development/hugo/How-To-Dynamically-Use-Google-Fonts-In-A-Hugo-Website/) | Hash Borgir | 2016-10-27 |
|
||||
| [Embedding Facebook In A Hugo Template](https://stoned.io/web-development/hugo/Embedding-Facebook-In-A-Hugo-Template/) | Hash Borgir | 2016-10-22 |
|
||||
| [通过 Gitlab-cl 将 Hugo blog 自动部署至 GitHub](https://zetaoyang.github.io/post/2016/10/17/gitlab-cl.html) <small>(Chinese, Continious integration)</small> | Zetao Yang | 2016-10-17 |
|
||||
| [A Step-by-Step Guide: Hugo on Netlify](https://www.netlify.com/blog/2016/09/21/a-step-by-step-guide-hugo-on-netlify/) | Eli Williamson | 2016-09-21 |
|
||||
| [Building our site: From Django & Wordpress to a static generator (Part I)](https://tryolabs.com/blog/2016/09/20/building-our-site-django-wordpress-to-static-part-i/) | Alan Descoins | 2016-09-20 |
|
||||
| [Webseitenmaschine - Statische Websites mit Hugo erzeugen](http://www.heise.de/ct/ausgabe/2016-12-Statische-Websites-mit-Hugo-erzeugen-3211704.html) <small>(German, $)</small> | Christian Helmbold | 2016-05-27 |
|
||||
| [Cómo hacer sitios web estáticos con Hugo y Go - Platzi](https://www.youtube.com/watch?v=qaXXpdiCHXE) <small>(Video tutorial)</small> | Verónica López | 2016-04-06 |
|
||||
| [CDNOverview: A CDN comparison site made with Hugo](https://www.cloakfusion.com/cdnoverview-cdn-comparison-site-made-hugo/) | Thijs de Zoete | 2016-02-23 |
|
||||
| [Hugo: A Modern WebSite Engine That Just Works](https://github.com/shekhargulati/52-technologies-in-2016/blob/master/07-hugo/README.md) | Shekhar Gulati | 2016-02-14 |
|
||||
| [Minify Hugo Generated HTML](http://ratson.name/blog/minify-hugo-generated-html/) | Ratson | 2016-02-02 |
|
||||
| [<span lang="ja">HugoのデプロイをWerckerからCircle CIに変更した</span> - log](http://log.deprode.net/logs/2016-01-17/) | Deprode | 2016-01-17 |
|
||||
| [Static site generators: el futuro de las webs estáticas<br>(Hugo, Jekyll, Flask y otros)](http://sitelabs.es/static-site-generators-futuro-las-webs-estaticas/) | Eneko Sarasola | 2016-01-09 |
|
||||
| [Writing a Lambda Function for Hugo](https://blog.jolexa.net/post/writing-a-lambda-function-for-hugo/) | Jeremy Olexa | 2016-01-01 |
|
||||
| [Ein Blog mit Hugo erstellen - Tutorial](http://privat.albicker.org/tags/hugo.html) <small>(Deutsch/German)</small> | Bernhard Albicker | 2015-12-30 |
|
||||
| [How to host Hugo static website generator on AWS Lambda](http://bezdelev.com/post/hugo-aws-lambda-static-website/) | Ilya Bezdelev | 2015-12-15 |
|
||||
| [Migrating from Pelican to Hugo](http://www.softinio.com/post/migrating-from-pelican-to-hugo/) | Salar Rahmanian | 2015-11-29 |
|
||||
| [Static Website Generators Reviewed: Jekyll, Middleman, Roots, Hugo](http://www.smashingmagazine.com/2015/11/static-website-generators-jekyll-middleman-roots-hugo-review/) | Mathias Biilmann Christensen | 2015-11-16 |
|
||||
| [How To Deploy a Hugo Site to Production with Git Hooks on Ubuntu 14.04](https://www.digitalocean.com/community/tutorials/how-to-deploy-a-hugo-site-to-production-with-git-hooks-on-ubuntu-14-04) | Justin Ellingwood | 2015-11-12 |
|
||||
| [How To Install and Use Hugo, a Static Site Generator, on Ubuntu 14.04](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-hugo-a-static-site-generator-on-ubuntu-14-04) | Justin Ellingwood | 2015-11-09 |
|
||||
| [Switching from Wordpress to Hugo](http://justinfx.com/2015/11/08/switching-from-wordpress-to-hugo/) | Justin Israel | 2015-11-08 |
|
||||
| [Hands-on Experience with Hugo as a Static Site Generator](http://usersnap.com/blog/hands-on-experience-with-hugo-static-site-generator/) | Thomas Peham | 2015 -10-15 |
|
||||
| [Statische Webseites mit Hugo erstellen/Vortrag mit Foliensatz (deutsch)](http://sfd.koelnerlinuxtreffen.de/2015/HaraldWeidner/) | Harald Weidner | 2015-09-19 |
|
||||
| [Moving from WordPress to Hugo](http://abhipandey.com/2015/09/moving-to-hugo/) | Abhishek Pandey | 2015-09-15 |
|
||||
| [<span lang="zh-CN">通过webhook将Hugo自动部署至GitHub Pages和GitCafe Pages</span> <small>(Automated deployment)</small>](http://blog.coderzh.com/2015/09/13/use-webhook-automated-deploy-hugo/) | CoderZh | 2015-09-13 |
|
||||
| [<span lang="zh-CN">使用hugo搭建个人博客站点</span> <small>(Using Hugo to build a personal blog site)</small>](http://blog.coderzh.com/2015/08/29/hugo/) | CoderZh | 2015-08-29 |
|
||||
| [Good-Bye Wordpress, Hello Hugo!](http://blog.arminhanisch.de/2015/08/blog-migration-zu-hugo/) <small>(German)</small> | Armin Hanisch | 2015-08-18 |
|
||||
| [Générer votre site web statique avec Hugo <small>(Generate your static site with Hugo)<small>](http://www.linux-pratique.com/?p=191) | Benoît Benedetti | 2015-06-26 |
|
||||
| [<span lang="ja">Hugo向けの新しいテーマを作った</span> <small>(I created a new theme for Hugo)<small>](https://yet.unresolved.xyz/blog/2016/10/03/how-to-make-of-hugo-theme/) | Daisuke Tsuji | 2015-06-20 |
|
||||
| [Hugo - Gerando um site com conteúdo estático. (Portuguese Brazil)](http://blog.ffrizzo.com/posts/hugo/) | Fabiano Frizzo | 2015-06-02 |
|
||||
| [An Introduction to Static Site Generators](http://davidwalsh.name/introduction-static-site-generators) | Eduardo Bouças | 2015-05-20 |
|
||||
| [Hugo Still Rules](http://cheekycoder.com/2015/05/hugo-still-rules/) | Cheeky Coder | 2015-05-18 |
|
||||
| [hugo - Static Site Generator](http://gscacco.github.io/post/hugo/) | G Scaccoio | 2015-05-04 |
|
||||
| [<span lang="ja">WindowsでHugoを使う</span>](http://ureta.net/2015/05/hugo-on-windows/) | <span lang="ja">うれ太郎</span> | 2015-05-01 |
|
||||
| [<span lang="ja">Hugoのshortcodesを用いてサイトにスライドなどを埋め込む</span>](http://blog.yucchiy.com/2015/04/29/hugo-shortcode/) | Yucchiy | 2015-04-29 |
|
||||
| [<span lang="ja">HugoとCircleCIでGitHub PagesにBlogを公開してみたら超簡単だった</span>](http://hori-ryota.github.io/blog/create-blog-with-hugo-and-circleci/) | Hori Ryota | 2015-04-17 |
|
||||
| [10 Best Static Site Generators](http://beebom.com/2015/04/best-static-site-generators) | Aniruddha Mysore | 2015-04-06 |
|
||||
| [Goodbye WordPress; Hello Hugo](http://willwarren.com/2015/04/05/goodbye-wordpress-hello-hugo/) | Will Warren | 2015-04-05 |
|
||||
| [Static Websites with Hugo on Google Cloud Storage](http://www.moxie.io/post/static-websites-with-hugo-on-google-cloud-storage/) | Moxie Input/Output | 2015-04-02 |
|
||||
| [De nuevo iniciando un blog](https://alvarolizama.net/) | Alvaro Lizama | 2015-03-29 |
|
||||
| [We moved our blog from Posthaven to Hugo after only three posts. Why?](http://blog.hypriot.com/post/moved-from-posthaven-to-hugo/) | Hypriot | 2015-03-27 |
|
||||
| [Top Static Site Generators in 2015](http://superdevresources.com/static-site-generators-2015/) | Kanishk Kunal | 2015-03-12 |
|
||||
| [Moving to Hugo](http://abiosoft.com/moving-to-hugo/) | Abiola Ibrahim | 2015-03-08 |
|
||||
| [Migrating a blog (yes, this one!) from Wordpress to Hugo](http://justindunham.net/migrating-from-wordpress-to-hugo/) | Justin Dunham | 2015-02-13 |
|
||||
| [<span lang="ja">blogをoctopressからHugoに乗り換えたメモ</span>](http://blog.jigyakkuma.org/2015/02/11/hugo/) | jigyakkuma | 2015-02-11 |
|
||||
| [<span lang="ja">Hugoでブログをつくった</span>](http://porgy13.github.io/post/new-hugo-blog/) | porgy13 | 2015-02-07 |
|
||||
| [<span lang="ja">Hugoにブログを移行した</span>](http://keichi.net/post/first/) | Keichi Takahashi | 2015-02-04 |
|
||||
| [<span lang="zh-CN">Hugo静态网站生成器中文教程</span>](http://nanshu.wang/post/2015-01-31/) | Nanshu Wang | 2015-01-31 |
|
||||
| [<span lang="ja">Hugo + GitHub Pages + Wercker CI = ¥0(無料)<br>でコマンド 1 発(自動化)でサイト<br>・ブログを公開・運営・分析・収益化</span>](http://qiita.com/yoheimuta/items/8a619cac356bed89a4c9) | Yohei Yoshimuta | 2015-01-31 |
|
||||
| [Running Hugo websites on anynines](http://blog.anynines.com/running-hugo-websites-on-anynines/) | Julian Weber | 2015-01-30 |
|
||||
| [MiddlemanからHugoへ移行した](http://re-dzine.net/2015/01/hugo/) | Haruki Konishi | 2015-01-21 |
|
||||
| [WordPress から Hugo に乗り換えました](http://rakuishi.com/archives/wordpress-to-hugo/) | rakuishi | 2015-01-20 |
|
||||
| [HUGOを使ってサイトを立ち上げる方法](http://qiita.com/syui/items/869538099551f24acbbf) | Syui | 2015-01-17 |
|
||||
| [<span lang="ja">Jekyllが許されるのは小学生までだよね</span>](http://t32k.me/mol/log/hugo/) | Ishimoto Koji | 2015-01-16 |
|
||||
| [Getting started with Hugo](http://anthonyfok.org/post/getting-started-with-hugo/) | Anthony Fok | 2015-01-12 |
|
||||
| [<span lang="zh-CN">把这个博客静态化了</span> <small>(Migrate to Hugo)</small>](http://lich-eng.com/2015/01/03/migrate-to-hugo/)| Li Cheng | 2015-01-03 |
|
||||
| [Porting my blog with Hugo](http://blog.srackham.com/posts/porting-my-blog-with-hugo/) | Stuart Rackham | 2014-12-30 |
|
||||
| [Hugoを使ってみたときのメモ](http://machortz.github.io/posts/usinghugo/) | Machortz | 2014-12-29 |
|
||||
| [OctopressからHugoへ移行した](http://deeeet.com/writing/2014/12/25/hugo/) | Taichi Nakashima | 2014-12-25 |
|
||||
| [Migrating to Hugo From Octopress](http://nathanleclaire.com/blog/2014/12/22/migrating-to-hugo-from-octopress/) | Nathan LeClaire | 2014-12-22 |
|
||||
| [Dynamic Pages with GoHugo.io](http://cyrillschumacher.com/2014/12/21/dynamic-pages-with-gohugo.io/) | Cyrill Schumacher | 2014-12-21 |
|
||||
| [6 Static Blog Generators That Aren’t Jekyll](http://www.sitepoint.com/6-static-blog-generators-arent-jekyll/) | David Turnbull | 2014-12-08 |
|
||||
| [Travel Blogging Setup](http://www.stou.dk/2014/11/travel-blogging-setup/) | Rasmus Stougaard | 2014-11-23 |
|
||||
| [Hosting A Hugo Website Behind Nginx](http://www.bigbeeconsultants.co.uk/blog/hosting-hugo-website-behind-nginx) | Rick Beton | 2014-11-20 |
|
||||
| [<span lang="zh-CN">使用Hugo搭建免费个人Blog</span> <small>(How to use Hugo)</small>](http://ulricqin.com/post/how-to-use-hugo/) | Ulric Qin <span lang="zh-CN">秦晓辉</span> | 2014-11-11 |
|
||||
| [Built in Speed and Built for Speed by Hugo](http://cheekycoder.com/2014/10/built-for-speed-by-hugo/) | Cheeky Coder | 2014-10-30 |
|
||||
| [Hugo para crear sitios web estáticos](http://www.webbizarro.com/noticias/1076/hugo-para-crear-sitios-web-estaticos/) | Web Bizarro | 2014-08-19 |
|
||||
| [Going with hugo](http://www.markuseliasson.se/article/going-with-hugo/) | Markus Eliasson | 2014-08-18 |
|
||||
| [Benchmarking Jekyll, Hugo and Wintersmith](http://fredrikloch.me/post/2014-08-12-Jekyll-and-its-alternatives-from-a-site-generation-point-of-view/) | Fredrik Loch | 2014-08-12 |
|
||||
| [Goodbye Octopress, Hello Hugo!](http://andreimihu.com/blog/2014/08/11/goodbye-octopress-hello-hugo/) | Andrei Mihu | 2014-08-11 |
|
||||
| [Beautiful sites for Open Source projects](http://beautifulopen.com/2014/08/09/hugo/) | Beautiful Open | 2014-08-09 |
|
||||
| [Hugo: Beyond the Defaults](http://npf.io/2014/08/hugo-beyond-the-defaults/) | Nate Finch | 2014-08-08 |
|
||||
| [First Impressions of Hugo](https://peteraba.com/blog/first-impressions-of-hugo/) | Peter Aba | 2014-06-06 |
|
||||
| [New Site Workflow](http://vurt.co.uk/post/new_website/) | Giles Paterson | 2014-08-05 |
|
||||
| [How I Learned to Stop Worrying and Love the (Static) Web](http://cognition.ca/post/about-hugo/) | Joshua McKenty | 2014-08-04 |
|
||||
| [Hugo - Static Site Generator](http://kenwoo.io/blog/hugo---static-site-generator/) | Kenny Woo | 2014-08-03 |
|
||||
| [Hugo Is Friggin' Awesome](http://npf.io/2014/08/hugo-is-awesome/) | Nate Finch | 2014-08-01 |
|
||||
| [<span lang="zh-CN">再次搬家</span> <small>(Move from WordPress to Hugo)</small>](http://www.chingli.com/misc/move-from-wordpress-to-hugo/) | <span lang="zh-CN">青砾</span> (chingli) | 2014-07-12 |
|
||||
| [Embedding Gists in Hugo](http://danmux.com/posts/embedded_gists/) | Dan Mull | 2014-07-05 |
|
||||
| [An Introduction To Hugo](http://www.cirrushosting.com/web-hosting-blog/an-introduction-to-hugo/) | Dan Silber | 2014-07-01 |
|
||||
| [Moving to Hugo](http://danmux.com/posts/hugo_based_blog/) | Dan Mull | 2014-05-29 |
|
||||
| [<span lang="zh-CN">开源之静态站点生成器排行榜</span><br><small>(Leaderboard of open-source static website generators)</small>](http://code.csdn.net/news/2819909) | CSDN.net | 2014-05-23 |
|
||||
| [Finally, a satisfying and effective blog setup](http://michaelwhatcott.com/now-powered-by-hugo/) | Michael Whatcott | 2014-05-20 |
|
||||
| [Hugo from scratch](http://zackofalltrades.com/notes/2014/05/hugo-from-scratch/) | Zack Williams | 2014-05-18 |
|
||||
| [Why I switched away from Jekyll](http://www.jakejanuzelli.com/why-I-switched-away-from-jekyll/) | Jake Januzelli | 2014-05-10 |
|
||||
| [Welcome our new blog](http://blog.ninya.io/posts/welcome-our-new-blog/) | Ninya.io | 2014-04-11 |
|
||||
| [Mission Not Accomplished](http://johnsto.co.uk/blog/mission-not-accomplished/) | Dave Johnston | 2014-04-03 |
|
||||
| [Hugo - A Static Site Builder in Go](http://deepfriedcode.com/post/hugo/) | Deep Fried Code | 2014-03-30 |
|
||||
| [Adventures in Angular Podcast](http://devchat.tv/adventures-in-angular/003-aia-gdes) | Matias Niemela | 2014-03-28 |
|
||||
| [Hugo](http://bra.am/post/hugo/) | bra.am | 2014-03-23 |
|
||||
| [Converting Blogger To Markdown](http://trishagee.github.io/project/atom-to-hugo/) | Trisha Gee | 2014-03-20 |
|
||||
| [Moving to Hugo Static Web Pages](http://tepid.org/tech/hugo-web/) | Tobias Weingartner | 2014-03-16 |
|
||||
| [New Blog Engine: Hugo](https://blog.afoolishmanifesto.com/posts/hugo/) | fREW Schmidt | 2014-03-15 |
|
||||
| [Hugo + gulp.js = Huggle](http://ktmud.github.io/huggle/en/intro/) ([English](http://ktmud.github.io/huggle/en/intro/), [<span lang="zh-CN">中文</span>](http://ktmud.github.io/huggle/zh/intro/)) | Jesse Yang <span lang="zh-CN">杨建超</span> | 2014-03-08 |
|
||||
| [Powered by Hugo](http://kieranhealy.org/blog/archives/2014/02/24/powered-by-hugo/) | Kieran Healy | 2014-02-24 |
|
||||
| [<span lang="ja">静的サイトを素早く構築するために<br>GoLangで作られたジェネレータHugo</span>](http://hamasyou.com/blog/2014/02/21/hugo/)| <div lang="ja" style="line-height: 1.1;">Shogo Hamada<br>濱田章吾</div> | 2014-02-21 |
|
||||
| [Latest Roundup of Useful Tools For Developers](http://codegeekz.com/latest-roundup-of-useful-tools-for-developers/) | CodeGeekz | 2014-02-13 |
|
||||
| [Hugo: Static Site Generator written in Go](http://www.braveterry.com/2014/02/06/hugo-static-site-generator-written-in-go/) | Brave Terry | 2014-02-06 |
|
||||
| [10 Useful HTML5 Tools for Web Designers and Developers](http://designdizzy.com/10-useful-html5-tools-for-web-designers-and-developers/) | Design Dizzy | 2014-02-04 |
|
||||
| [Hugo – Fast, Flexible Static Site Generator](http://cube3x.com/hugo-fast-flexible-static-site-generator/) | Joby Joseph | 2014-01-18 |
|
||||
| [Hugo: A new way to build static website](http://www.w3update.com/opensource/hugo-a-new-way-to-build-static-website.html) | w3update | 2014-01-17 |
|
||||
| [Xaprb now uses Hugo](http://xaprb.com/blog/2014/01/15/using-hugo/) | Baron Schwartz | 2014-01-15 |
|
||||
| [New jQuery Plugins And Resources That Web Designers Need](http://www.designyourway.net/blog/resources/new-jquery-plugins-and-resources-that-web-designers-need/) | Design Your Way | 2014-01-01 |
|
||||
| [On Blog Construction](http://alexla.sh/post/on-blog-construction/) | Alexander Lash | 2013-12-27 |
|
||||
| [Hugo](http://onethingwell.org/post/69070926608/hugo) | One Thing Well | 2013-12-05 |
|
||||
| [In Praise Of Hugo](http://sound-guru.com/blog/post/hello-world/) | sound-guru.com | 2013-10-19 |
|
||||
| [Hosting a blog on S3 and Cloudfront](http://www.danesparza.net/2013/07/hosting-a-blog-on-s3-and-cloudfront/) | Dan Esparza | 2013-07-24 |
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
title: Content Management
|
||||
linktitle: Content Management Overview
|
||||
description: Hugo makes managing large static sites easy with support for archetypes, content types, menus, cross references, summaries, and more.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
menu:
|
||||
docs:
|
||||
parent: "content-management"
|
||||
weight: 1
|
||||
#tags: [source, organization]
|
||||
categories: [content management]
|
||||
weight: 01 #rem
|
||||
draft: false
|
||||
aliases: [/content/,/content/organization]
|
||||
toc: false
|
||||
---
|
||||
|
||||
A static site generator needs to extend beyond front matter and a couple templates to be both scalable and *manageable*. Hugo was designed with not only developers in mind, but also content managers and authors.
|
||||
@@ -0,0 +1,208 @@
|
||||
---
|
||||
title: Archetypes
|
||||
linktitle: Archetypes
|
||||
description: Archetypes allow you to create new instances of content types and set default parameters from the command line.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
#tags: [archetypes,generators,metadata,front matter]
|
||||
categories: ["content management"]
|
||||
menu:
|
||||
docs:
|
||||
parent: "content-management"
|
||||
weight: 70
|
||||
quicklinks:
|
||||
weight: 70 #rem
|
||||
draft: false
|
||||
aliases: [/content/archetypes/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
{{% note %}}
|
||||
This section is outdated, see https://github.com/gohugoio/hugoDocs/issues/11
|
||||
{{% /note %}}
|
||||
{{% todo %}}
|
||||
See above
|
||||
{{% /todo %}}
|
||||
|
||||
## What are Archetypes?
|
||||
|
||||
**Archetypes** are content files in the [archetypes directory][] of your project that contain preconfigured [front matter][] for your website's [content types][]. Archetypes facilitate consistent metadata across your website content and allow content authors to quickly generate instances of a content type via the `hugo new` command.
|
||||
|
||||
The `hugo new` generator for archetypes assumes your working directory is the content folder at the root of your project. Hugo is able to infer the appropriate archetype by assuming the content type from the content section passed to the CLI command:
|
||||
|
||||
```bash
|
||||
hugo new <content-section>/<file-name.md>
|
||||
```
|
||||
|
||||
We can use this pattern to create a new `.md` file in the `posts` section:
|
||||
|
||||
{{% code file="archetype-example.sh" %}}
|
||||
```bash
|
||||
hugo new posts/my-first-post.md
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
{{% note "Override Content Type in a New File" %}}
|
||||
To override the content type Hugo infers from `[content-section]`, add the `--kind` flag to the end of the `hugo new` command.
|
||||
{{% /note %}}
|
||||
|
||||
Running this command in a new site that does not have default or custom archetypes will create the following file:
|
||||
|
||||
{{% output file="content/posts/my-first-post.md" %}}
|
||||
```toml
|
||||
+++
|
||||
date = "2017-02-01T19:20:04-07:00"
|
||||
title = "my first post"
|
||||
draft = true
|
||||
+++
|
||||
```
|
||||
{{% /output %}}
|
||||
|
||||
{{% note %}}
|
||||
In this example, if you do not already have a `content/posts` directory, Hugo will create both `content/posts/` and `content/posts/my-first-post.md` for you.
|
||||
{{% /note %}}
|
||||
|
||||
The auto-populated fields are worth examining:
|
||||
|
||||
* `title` is generated from the new content's filename (i.e. in this case, `my-first-post` becomes `"my first post"`)
|
||||
* `date` and `title` are the variables that ship with Hugo and are therefore included in *all* content files created with the Hugo CLI. `date` is generated in [RFC 3339 format][] by way of Go's [`now()`][] function, which returns the current time.
|
||||
* The third variable, `draft = true`, is *not* inherited by your default or custom archetypes but is included in Hugo's automatically scaffolded `default.md` archetype for convenience.
|
||||
|
||||
Three variables per content file are often not enough for effective content management of larger websites. Luckily, Hugo provides a simple mechanism for extending the number of variables through custom archetypes, as well as default archetypes to keep content creation DRY.
|
||||
|
||||
## Lookup Order for Archetypes
|
||||
|
||||
Similar to the [lookup order for templates][lookup] in your `layouts` directory, Hugo looks for a section- or type-specific archetype, then a default archetype, and finally an internal archetype that ships with Hugo. For example, Hugo will look for an archetype for `content/posts/my-first-post.md` in the following order:
|
||||
|
||||
1. `archetypes/posts.md`
|
||||
2. `archetypes/default.md`
|
||||
3. `themes/<THEME>/archetypes/posts.md`
|
||||
4. `themes/<THEME>/archetypes/default.md` (Auto-generated with `hugo new site`)
|
||||
|
||||
{{% note "Using a Theme Archetype" %}}
|
||||
If you wish to use archetypes that ship with a theme, the `theme` field must be specified in your [configuration file](/getting-started/configuration/).
|
||||
{{% /note %}}
|
||||
|
||||
## Choose Your Archetype's Front Matter Format
|
||||
|
||||
By default, `hugo new` content files include front matter in the TOML format regardless of the format used in `archetypes/*.md`.
|
||||
|
||||
You can specify a different default format in your site [configuration file][] file using the `metaDataFormat` directive. Possible values are `toml`, `yaml`, and `json`.
|
||||
|
||||
## Default Archetypes
|
||||
|
||||
Default archetypes are convenient if your content's front matter stays consistent across multiple [content sections][sections].
|
||||
|
||||
### Create the Default Archetype
|
||||
|
||||
When you create a new Hugo project using `hugo new site`, you'll notice that Hugo has already scaffolded a file at `archetypes/default.md`.
|
||||
|
||||
The following examples are from a site that's using `tags` and `categories` as [taxonomies][]. If we assume that all content files will require these two key-values, we can create a `default.md` archetype that *extends* Hugo's base archetype. In this example, we are including "golang" and "hugo" as tags and "web development" as a category.
|
||||
|
||||
{{% code file="archetypes/default.md" %}}
|
||||
```toml
|
||||
+++
|
||||
tags = ["golang", "hugo"]
|
||||
categories = ["web development"]
|
||||
+++
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
{{% warning "EOL Characters in Text Editors"%}}
|
||||
If you get an `EOF error` when using `hugo new`, add a carriage return after the closing `+++` or `---` for your TOML or YAML front matter, respectively. (See the [troubleshooting article on EOF errors](/troubleshooting/eof-error/) for more information.)
|
||||
{{% /warning %}}
|
||||
|
||||
### Use the Default Archetype
|
||||
|
||||
With an `archetypes/default.md` in place, we can use the CLI to create a new post in the `posts` content section:
|
||||
|
||||
{{% code file="new-post-from-default.sh" %}}
|
||||
```bash
|
||||
$ hugo new posts/my-new-post.md
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
Hugo then creates a new markdown file with the following front matter:
|
||||
|
||||
{{% output file="content/posts/my-new-post.md" %}}
|
||||
```toml
|
||||
+++
|
||||
categories = ["web development"]
|
||||
date = "2017-02-01T19:20:04-07:00"
|
||||
tags = ["golang", "hugo"]
|
||||
title = "my new post"
|
||||
+++
|
||||
```
|
||||
{{% /output %}}
|
||||
|
||||
We see that the `title` and `date` key-values have been added in addition to the `tags` and `categories` key-values from `archetypes/default.md`.
|
||||
|
||||
{{% note "Ordering of Front Matter" %}}
|
||||
You may notice that content files created with `hugo new` do not respect the order of the key-values specified in your archetype files. This is a [known issue](https://github.com/gohugoio/hugo/issues/452).
|
||||
{{% /note %}}
|
||||
|
||||
## Custom Archetypes
|
||||
|
||||
Suppose your site's `posts` section requires more sophisticated front matter than what has been specified in `archetypes/default.md`. You can create a custom archetype for your posts at `archetypes/posts.md` that includes the full set of front matter to be added to the two default archetypes fields.
|
||||
|
||||
### Create a Custom Archetype
|
||||
|
||||
{{% code file="archetypes/posts.md"%}}
|
||||
```toml
|
||||
+++
|
||||
description = ""
|
||||
tags = ""
|
||||
categories = ""
|
||||
+++
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
### Use a Custom Archetype
|
||||
|
||||
With an `archetypes/posts.md` in place, you can use the Hugo CLI to create a new post with your preconfigured front matter in the `posts` content section:
|
||||
|
||||
{{% code file="new-post-from-custom.sh" %}}
|
||||
```bash
|
||||
$ hugo new posts/post-from-custom.md
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
This time, Hugo recognizes our custom `archetypes/posts.md` archetype and uses it instead of `archetypes/default.md`. The generated file will now include the full list of front matter parameters, as well as the base archetype's `title` and `date`:
|
||||
|
||||
{{% output file="content/posts/post-from-custom-archetype.md" %}}
|
||||
```toml
|
||||
+++
|
||||
categories = ""
|
||||
date = 2017-02-13T17:24:43-08:00
|
||||
description = ""
|
||||
tags = ""
|
||||
title = "post from custom archetype"
|
||||
+++
|
||||
```
|
||||
{{% /output %}}
|
||||
|
||||
### Hugo Docs Custom Archetype
|
||||
|
||||
As an example of archetypes in practice, the following is the `functions` archetype from the Hugo docs:
|
||||
|
||||
{{% code file="archetypes/functions.md" %}}
|
||||
```yaml
|
||||
{{< readfile file="/themes/gohugoioTheme/archetypes/functions.md" >}}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
{{% note %}}
|
||||
The preceding archetype is kept up to date with every Hugo build by using Hugo's [`readFile` function](/functions/readfile/). For similar examples, see [Local File Templates](/templates/files/).
|
||||
{{% /note %}}
|
||||
|
||||
[archetypes directory]: /getting-started/directory-structure/
|
||||
[`now()`]: http://golang.org/pkg/time/#Now
|
||||
[configuration file]: /getting-started/configuration/
|
||||
[sections]: /content-management/sections/
|
||||
[content types]: /content-management/types/
|
||||
[front matter]: /content-management/front-matter/
|
||||
[RFC 3339 format]: https://www.ietf.org/rfc/rfc3339.txt
|
||||
[taxonomies]: /content-management/taxonomies/
|
||||
[lookup]: /templates/lookup/
|
||||
[templates]: /templates/
|
||||
@@ -0,0 +1,193 @@
|
||||
---
|
||||
title: Authors
|
||||
linktitle: Authors
|
||||
description:
|
||||
date: 2016-08-22
|
||||
publishdate: 2017-03-12
|
||||
lastmod: 2017-03-12
|
||||
#tags: [authors]
|
||||
categories: ["content management"]
|
||||
menu:
|
||||
docs:
|
||||
parent: "content-management"
|
||||
weight: 55
|
||||
weight: 55 #rem
|
||||
draft: true
|
||||
aliases: [/content/archetypes/]
|
||||
toc: true
|
||||
comments: Before this page is published, need to also update both site- and page-level variables documentation.
|
||||
---
|
||||
|
||||
|
||||
|
||||
Larger sites often have multiple content authors. Hugo provides standardized author profiles to organize relationships between content and content creators for sites operating under a distributed authorship model.
|
||||
|
||||
## Author Profiles
|
||||
|
||||
You can create a profile containing metadata for each author on your website. These profiles have to be saved under `data/_authors/`. The filename of the profile will later be used as an identifier. This way Hugo can associate content with one or multiple authors. An author's profile can be defined in the JSON, YAML, or TOML format.
|
||||
|
||||
### Example: Author Profile
|
||||
|
||||
Let's suppose Alice Allison is a blogger. A simple unique identifier would be `alice`. Now, we have to create a file called `alice.toml` in the `data/_authors/` directory. The following example is the standardized template written in TOML:
|
||||
|
||||
{{% code file="data/_authors/alice.toml" %}}
|
||||
```toml
|
||||
givenName = "Alice" # or firstName as alias
|
||||
familyName = "Allison" # or lastName as alias
|
||||
displayName = "Alice Allison"
|
||||
thumbnail = "static/authors/alice-thumb.jpg"
|
||||
image = "static/authors/alice-full.jpg"
|
||||
shortBio = "My name is Alice and I'm a blogger."
|
||||
bio = "My name is Alice and I'm a blogger... some other stuff"
|
||||
email = "alice.allison@email.com"
|
||||
weight = 10
|
||||
|
||||
[social]
|
||||
facebook = "alice.allison"
|
||||
twitter = "alice"
|
||||
googleplus = "aliceallison1"
|
||||
website = "www.example.com"
|
||||
|
||||
[params]
|
||||
random = "whatever you want"
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
All variables are optional but it's advised to fill all important ones (e.g. names and biography) because themes can vary in their usage.
|
||||
|
||||
You can store files for the `thumbnail` and `image` attributes in the `static` folder. Then add the path to the photos relative to `static`; e.g., `/static/path/to/thumbnail.jpg`.
|
||||
|
||||
`weight` allows you to define the order of an author in an `.Authors` list and can be accessed on list or via the `.Site.Authors` variable.
|
||||
|
||||
The `social` section contains all the links to the social network accounts of an author. Hugo is able to generate the account links for the most popular social networks automatically. This way, you only have to enter your username. You can find a list of all supported social networks [here](#linking-social-network-accounts-automatically). All other variables, like `website` in the example above remain untouched.
|
||||
|
||||
The `params` section can contain arbitrary data much like the same-named section in the config file. What it contains is up to you.
|
||||
|
||||
## Associate Content Through Identifiers
|
||||
|
||||
Earlier it was mentioned that content can be associated with an author through their corresponding identifier. In our case, blogger Alice has the identifier `alice`. In the front matter of a content file, you can create a list of identifiers and assign it to the `authors` variable. Here are examples for `alice` using YAML and TOML, respectively.
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: Why Hugo is so Awesome
|
||||
date: 2016-08-22T14:27:502:00
|
||||
authors: ["alice"]
|
||||
---
|
||||
|
||||
Nothing to read here. Move along...
|
||||
```
|
||||
|
||||
```toml
|
||||
+++
|
||||
title = Why Hugo is so Awesome
|
||||
date = "2016-08-22T14:27:502:00"
|
||||
authors: ["alice"]
|
||||
+++
|
||||
|
||||
Nothing to read here. Move along...
|
||||
```
|
||||
|
||||
Future authors who might work on this blog post can append their identifiers to the `authors` array in the front matter as well.
|
||||
|
||||
## Work with Templates
|
||||
|
||||
After a successful setup it's time to give some credit to the authors by showing them on the website. Within the templates Hugo provides a list of the author's profiles if they are listed in the `authors` variable within the front matter.
|
||||
|
||||
The list is accessible via the `.Authors` template variable. Printing all authors of a the blog post is straight forward:
|
||||
|
||||
```
|
||||
{{ range .Authors }}
|
||||
{{ .DisplayName }}
|
||||
{{ end }}
|
||||
=> Alice Allison
|
||||
```
|
||||
|
||||
Even if there are co-authors you may only want to show the main author. For this case you can use the `.Author` template variable **(note the singular form)**. The template variable contains the profile of the author that is first listed with his identifier in the front matter.
|
||||
|
||||
{{% note %}}
|
||||
You can find a list of all template variables to access the profile information in [Author Variables](/variables/authors/).
|
||||
{{% /note %}}
|
||||
|
||||
### Link Social Network Accounts
|
||||
|
||||
As aforementioned, Hugo is able to generate links to profiles of the most popular social networks. The following social networks with their corrersponding identifiers are supported: `github`, `facebook`, `twitter`, `googleplus`, `pinterest`, `instagram`, `youtube` and `linkedin`.
|
||||
|
||||
This is can be done with the `.Social.URL` function. Its only parameter is the name of the social network as they are defined in the profile (e.g. `facebook`, `googleplus`). Custom variables like `website` remain as they are.
|
||||
|
||||
Most articles feature a small section with information about the author at the end. Let's create one containing the author's name, a thumbnail, a (summarized) biography and links to all social networks:
|
||||
|
||||
{{% code file="layouts/partials/author-info.html" download="author-info.html" %}}
|
||||
```html
|
||||
{{ with .Author }}
|
||||
<h3>{{ .DisplayName }}</h3>
|
||||
<img src="{{ .Thumbnail | absURL }}" alt="{{ .DisplayName }}">
|
||||
<p>{{ .ShortBio }}</p>
|
||||
<ul>
|
||||
{{ range $network, $username := .Social }}
|
||||
<li><a href="{{ $.Author.Social.URL $network }}">{{ $network }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
## Who Published What?
|
||||
|
||||
That question can be answered with a list of all authors and another list containing all articles that they each have written. Now we have to translate this idea into templates. The [taxonomy][] feature allows us to logically group content based on information that they have in common; e.g. a tag or a category. Well, many articles share the same author, so this should sound familiar, right?
|
||||
|
||||
In order to let Hugo know that we want to group content based on their author, we have to create a new taxonomy called `author` (the name corresponds to the variable in the front matter). Here is the snippet in a `config.yaml` and `config.toml`, respectively:
|
||||
|
||||
```yaml
|
||||
taxonomies:
|
||||
author: authors
|
||||
```
|
||||
|
||||
```toml
|
||||
[taxonomies]
|
||||
author = "authors"
|
||||
```
|
||||
|
||||
|
||||
### List All Authors
|
||||
|
||||
In the next step we can create a template to list all authors of your website. Later, the list can be accessed at `www.example.com/authors/`. Create a new template in the `layouts/taxonomy/` directory called `authors.term.html`. This template will be exclusively used for this taxonomy.
|
||||
|
||||
{{% code file="layouts/taxonomy/author.term.html" download="author.term.html" %}}
|
||||
```html
|
||||
<ul>
|
||||
{{ range $author, $v := .Data.Terms }}
|
||||
{{ $profile := $.Authors.Get $author }}
|
||||
<li>
|
||||
<a href="{{ printf "%s/%s/" $.Data.Plural $author | absURL }}">
|
||||
{{ $profile.DisplayName }} - {{ $profile.ShortBio }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
`.Data.Terms` contains the identifiers of all authors and we can range over it to create a list with all author names. The `$profile` variable gives us access to the profile of the current author. This allows you to generate a nice info box with a thumbnail, a biography and social media links, like at the [end of a blog post](#linking-social-network-accounts-automatically).
|
||||
|
||||
### List Each Author's Publications
|
||||
|
||||
Last but not least, we have to create the second list that contains all publications of an author. Each list will be shown in its own page and can be accessed at `www.example.com/authors/<IDENTIFIER>`. Replace `<IDENTIFIER>` with a valid author identifier like `alice`.
|
||||
|
||||
The layout for this page can be defined in the template `layouts/taxonomy/author.html`.
|
||||
|
||||
{{% code file="layouts/taxonomy/author.html" download="author.html" %}}
|
||||
```html
|
||||
{{ range .Data.Pages }}
|
||||
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
|
||||
<span>written by {{ .Author.DisplayName }}</span>
|
||||
{{ .Summary }}
|
||||
{{ end }}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
The example above generates a simple list of all posts written by a single author. Inside the loop you've access to the complete set of [page variables][pagevars]. Therefore, you can add additional information about the current posts like the publishing date or the tags.
|
||||
|
||||
With a lot of content this list can quickly become very long. Consider to use the [pagination][] feature. It splits the list into smaller chunks and spreads them over multiple pages.
|
||||
|
||||
[pagevars]: /variables/page/
|
||||
[pagination]: /templates/pagination/
|
||||
@@ -0,0 +1,84 @@
|
||||
---
|
||||
title: Comments
|
||||
linktitle: Comments
|
||||
description: Hugo ships with an internal Disqus template, but this isn't the only commenting system that will work with your new Hugo website.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-03-09
|
||||
#tags: [sections,content,organization]
|
||||
categories: [project organization, fundamentals]
|
||||
menu:
|
||||
docs:
|
||||
parent: "content-management"
|
||||
weight: 140
|
||||
weight: 140 #rem
|
||||
draft: false
|
||||
aliases: [/extras/comments/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
Hugo ships with support for [Disqus](https://disqus.com/), a third-party service that provides comment and community capabilities to websites via JavaScript.
|
||||
|
||||
Your theme may already support Disqus, but if not, it is easy to add to your templates via [Hugo's built-in Disqus partial][disquspartial].
|
||||
|
||||
## Add Disqus
|
||||
|
||||
Hugo comes with all the code you need to load Disqus into your templates. Before adding Disqus to your site, you'll need to [set up an account][disqussetup].
|
||||
|
||||
### Configure Disqus
|
||||
|
||||
Disqus comments require you set a single value in your [site's configuration file][configuration]. The following show the configuration variable in a `config.toml` and `config.yml`, respectively:
|
||||
|
||||
```toml
|
||||
disqusShortname = "yourdiscussshortname"
|
||||
```
|
||||
|
||||
```yaml
|
||||
disqusShortname: "yourdiscussshortname"
|
||||
```
|
||||
|
||||
For many websites, this is enough configuration. However, you also have the option to set the following in the [front matter][] of a single content file:
|
||||
|
||||
* `disqus_identifier`
|
||||
* `disqus_title`
|
||||
* `disqus_url`
|
||||
|
||||
### Render Hugo's Built-in Disqus Partial Template
|
||||
|
||||
See [Partial Templates][partials] to learn how to add the Disqus partial to your Hugo website's templates.
|
||||
|
||||
## Comments Alternatives
|
||||
|
||||
There are a few alternatives to commenting on static sites for those who do not want to use Disqus:
|
||||
|
||||
* [Static Man](https://staticman.net/)
|
||||
* [txtpen](https://txtpen.com)
|
||||
* [IntenseDebate](http://intensedebate.com/)
|
||||
* [Graph Comment][]
|
||||
* [Muut](http://muut.com/)
|
||||
* [isso](http://posativ.org/isso/) (Self-hosted, Python)
|
||||
* [Tutorial on Implementing Isso with Hugo][issotutorial]
|
||||
|
||||
|
||||
<!-- I don't think this is worth including in the documentation since it seems that Steve is no longer supporting or developing this project. rdwatters - 2017-02-29.-->
|
||||
<!-- * [Kaiju](https://github.com/spf13/kaiju) -->
|
||||
|
||||
<!-- ## Kaiju
|
||||
|
||||
[Kaiju](https://github.com/spf13/kaiju) is an open-source project started by [spf13](http://spf13.com/) (Hugo’s author) to bring easy and fast real time discussions to the web.
|
||||
|
||||
Written using Go, Socket.io, and [MongoDB][], Kaiju is very fast and easy to deploy.
|
||||
|
||||
It is in early development but shows promise. If you have interest, please help by contributing via pull request, [opening an issue in the Kaiju GitHub repository][kaijuissue], or [Tweeting about it][tweet]. Every bit helps. -->
|
||||
|
||||
[configuration]: /getting-started/configuration/
|
||||
[disquspartial]: /templates/partials/#disqus
|
||||
[disqussetup]: https://disqus.com/profile/signup/
|
||||
[forum]: https://discourse.gohugo.io
|
||||
[front matter]: /content-management/front-matter/
|
||||
[Graph Comment]: https://graphcomment.com/
|
||||
[kaijuissue]: https://github.com/spf13/kaiju/issues/new
|
||||
[issotutorial]: https://stiobhart.net/2017-02-24-isso-comments/
|
||||
[partials]: /templates/partials/
|
||||
[MongoDB]: https://www.mongodb.com/
|
||||
[tweet]: https://twitter.com/spf13
|
||||
@@ -0,0 +1,125 @@
|
||||
---
|
||||
title: Cross References
|
||||
description: Hugo makes it easy to link documents together.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-03-31
|
||||
categories: [content management]
|
||||
#tags: ["cross references","references", "anchors", "urls"]
|
||||
menu:
|
||||
docs:
|
||||
parent: "content-management"
|
||||
weight: 100
|
||||
weight: 100 #rem
|
||||
aliases: [/extras/crossreferences/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
|
||||
The `ref` and `relref` shortcodes link documents together, both of which are [built-in Hugo shortcodes][]. These shortcodes are also used to provide links to headings inside of your content, whether across documents or within a document. The only difference between `ref` and `relref` is whether the resulting URL is absolute (`http://1.com/about/`) or relative (`/about/`), respectively.
|
||||
|
||||
## Use `ref` and `relref`
|
||||
|
||||
```md
|
||||
{{</* ref "document" */>}}
|
||||
{{</* ref "#anchor" */>}}
|
||||
{{</* ref "document#anchor" */>}}
|
||||
{{</* relref "document" */>}}
|
||||
{{</* relref "#anchor" */>}}
|
||||
{{</* relref "document#anchor" */>}}
|
||||
```
|
||||
|
||||
The single parameter to `ref` is a string with a content `documentname` (e.g., `about.md`) with or without an appended in-document `anchor` (`#who`) without spaces.
|
||||
|
||||
### Document Names
|
||||
|
||||
The `documentname` is the name of a document, including the format extension; this may be just the filename, or the relative path from the `content/` directory. With a document `content/blog/post.md`, either format will produce the same result:
|
||||
|
||||
```md
|
||||
{{</* relref "blog/post.md" */>}} => `/blog/post/`
|
||||
{{</* relref "post.md" */>}} => `/blog/post/`
|
||||
```
|
||||
|
||||
If you have the same filename used across multiple sections, you should only use the relative path format; otherwise, the behavior will be `undefined`. This is best illustrated with an example `content` directory:
|
||||
|
||||
```bash
|
||||
.
|
||||
└── content
|
||||
├── events
|
||||
│ └── my-birthday.md
|
||||
├── galleries
|
||||
│ └── my-birthday.md
|
||||
├── meta
|
||||
│ └── my-article.md
|
||||
└── posts
|
||||
└── my-birthday.md
|
||||
```
|
||||
|
||||
To be sure to get the correct reference in this case, use the full path:
|
||||
|
||||
{{% code file="content/meta/my-article.md" copy="false" %}}
|
||||
```md
|
||||
{{</* relref "events/my-birthday.md" */>}} => /events/my-birthday/
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
{{< todo >}}Remove this warning when https://github.com/gohugoio/hugo/issues/3703 is released.{{< /todo >}}
|
||||
|
||||
A relative document name must *not* begin with a slash (`/`).
|
||||
```md
|
||||
{{</* relref "/events/my-birthday.md" */>}} => ""
|
||||
```
|
||||
|
||||
### With Multiple Output Formats
|
||||
|
||||
If the page exists in multiple [output formats][], `ref` or `relref` can be used with a output format name:
|
||||
|
||||
```
|
||||
[Neat]({{</* ref "blog/neat.md" "amp" */>}})
|
||||
```
|
||||
|
||||
### Anchors
|
||||
|
||||
When an `anchor` is provided by itself, the current page’s unique identifier will be appended; when an `anchor` is provided appended to `documentname`, the found page's unique identifier will be appended:
|
||||
|
||||
```md
|
||||
{{</* relref "#anchors" */>}} => #anchors:9decaf7
|
||||
{{</* relref "about-hugo/hugo-features.md#content" */>}} => /blog/post/#who:badcafe
|
||||
```
|
||||
|
||||
The above examples render as follows for this very page as well as a reference to the "Content" heading in the Hugo docs features pageyoursite
|
||||
|
||||
```md
|
||||
{{</* relref "#who" */>}} => #who:9decaf7
|
||||
{{</* relref "blog/post.md#who" */>}} => /blog/post/#who:badcafe
|
||||
```
|
||||
|
||||
More information about document unique identifiers and headings can be found [below]({{< ref "#hugo-heading-anchors" >}}).
|
||||
|
||||
### Examples
|
||||
|
||||
* `{{</* ref "blog/post.md" */>}}` => `http://yoursite.com/blog/post/`
|
||||
* `{{</* ref "post.md#tldr" */>}}` => `http://yoursite.com/blog/post/#tldr:caffebad`
|
||||
* `{{</* relref "post.md" */>}}` => `/blog/post/`
|
||||
* `{{</* relref "blog/post.md#tldr" */>}}` => `/blog/post/#tldr:caffebad`
|
||||
* `{{</* ref "#tldr" */>}}` => `#tldr:badcaffe`
|
||||
* `{{</* relref "#tldr" */>}}` => `#tldr:badcaffe`
|
||||
|
||||
## Hugo Heading Anchors
|
||||
|
||||
When using Markdown document types, Hugo generates heading anchors automatically. The generated anchor for this section is `hugo-heading-anchors`. Because the heading anchors are generated automatically, Hugo takes some effort to ensure that heading anchors are unique both inside a document and across the entire site.
|
||||
|
||||
Ensuring heading uniqueness across the site is accomplished with a unique identifier for each document based on its path. Unless a document is renamed or moved between sections *in the filesystem*, the unique identifier for the document will not change: `blog/post.md` will always have a unique identifier of `81df004c333b392d34a49fd3a91ba720`.
|
||||
|
||||
`ref` and `relref` were added so you can make these reference links without having to know the document’s unique identifier. (The links in document tables of contents are automatically up-to-date with this value.)
|
||||
|
||||
```md
|
||||
{{</* relref "content-management/cross-references.md#hugo-heading-anchors" */>}}
|
||||
/content-management/cross-references/#hugo-heading-anchors:77cd9ea530577debf4ce0f28c8dca242
|
||||
```
|
||||
|
||||
|
||||
[built-in Hugo shortcodes]: /content-management/shortcodes/#using-the-built-in-shortcodes
|
||||
[lists]: /templates/lists/
|
||||
[output formats]: /templates/output-formats/
|
||||
[shortcode]: /content-management/shortcodes/
|
||||
@@ -0,0 +1,249 @@
|
||||
---
|
||||
title: Supported Content Formats
|
||||
linktitle: Supported Content Formats
|
||||
description: Markdown and Emacs Org-Mode have native support, and additional formats (e.g. Asciidoc) come via external helpers.
|
||||
date: 2017-01-10
|
||||
publishdate: 2017-01-10
|
||||
lastmod: 2017-04-06
|
||||
categories: [content management]
|
||||
#tags: [markdown,asciidoc,mmark,content format]
|
||||
menu:
|
||||
docs:
|
||||
parent: "content-management"
|
||||
weight: 20
|
||||
weight: 20 #rem
|
||||
draft: false
|
||||
aliases: [/content/markdown-extras/,/content/supported-formats/,/doc/supported-formats/,/tutorials/mathjax/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
**Markdown is the main content format** and comes in two flavours: The excellent [Blackfriday project][blackfriday] (name your files `*.md` or set `markup = "markdown"` in front matter) or its fork [Mmark][mmark] (name your files `*.mmark` or set `markup = "mmark"` in front matter), both very fast markdown engines written in Go.
|
||||
|
||||
For Emacs users, [goorgeous](https://github.com/chaseadamsio/goorgeous) provides built-in native support for Org-mode (name your files `*.org` or set `markup = "org"` in front matter)
|
||||
|
||||
{{% note "Deeply Nested Lists" %}}
|
||||
Before you begin writing your content in markdown, Blackfriday has a known issue [(#329)](https://github.com/russross/blackfriday/issues/329) with handling deeply nested lists. Luckily, there is an easy workaround. Use 4-spaces (i.e., <kbd>tab</kbd>) rather than 2-space indentations.
|
||||
{{% /note %}}
|
||||
|
||||
## Configure BlackFriday Markdown Rendering
|
||||
|
||||
You can configure multiple aspects of Blackfriday as show in the following list. See the docs on [Configuration][config] for the full list of explicit directions you can give to Hugo when rendering your site.
|
||||
|
||||
{{< readfile file="/content/readfiles/bfconfig.md" markdown="true" >}}
|
||||
|
||||
## Extend Markdown
|
||||
|
||||
Hugo provides some convenient methods for extending markdown.
|
||||
|
||||
### Task Lists
|
||||
|
||||
Hugo supports [GitHub-styled task lists (i.e., TODO lists)][gfmtasks] for the Blackfriday markdown renderer. If you do not want to use this feature, you can disable it in your configuration.
|
||||
|
||||
#### Example Task List Input
|
||||
|
||||
{{% code file="content/my-to-do-list.md" %}}
|
||||
```markdown
|
||||
- [ ] a task list item
|
||||
- [ ] list syntax required
|
||||
- [ ] incomplete
|
||||
- [x] completed
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
#### Example Task List Output
|
||||
|
||||
The preceding markdown produces the following HTML in your rendered website:
|
||||
|
||||
```html
|
||||
<ul class="task-list">
|
||||
<li><input type="checkbox" disabled="" class="task-list-item"> a task list item</li>
|
||||
<li><input type="checkbox" disabled="" class="task-list-item"> list syntax required</li>
|
||||
<li><input type="checkbox" disabled="" class="task-list-item"> incomplete</li>
|
||||
<li><input type="checkbox" checked="" disabled="" class="task-list-item"> completed</li>
|
||||
</ul>
|
||||
```
|
||||
|
||||
#### Example Task List Display
|
||||
|
||||
The following shows how the example task list will look to the end users of your website. Note that visual styling of lists is up to you. This list has been styled according to [the Hugo Docs stylesheet][hugocss].
|
||||
|
||||
- [ ] a task list item
|
||||
- [ ] list syntax required
|
||||
- [ ] incomplete
|
||||
- [x] completed
|
||||
|
||||
### Emojis
|
||||
|
||||
To add emojis directly to content, set `enableEmoji` to `true` in your [site configuration][config]. To use emojis in templates or shortcodes, see [`emojify` function][].
|
||||
|
||||
For a full list of emojis, see the [Emoji cheat sheet][emojis].
|
||||
|
||||
### Shortcodes
|
||||
|
||||
If you write in Markdown and find yourself frequently embedding your content with raw HTML, Hugo provides built-in shortcodes functionality. This is one of the most powerful features in Hugo and allows you to create your own Markdown extensions very quickly.
|
||||
|
||||
See [Shortcodes][sc] for usage, particularly for the built-in shortcodes that ship with Hugo, and [Shortcode Templating][sct] to learn how to build your own.
|
||||
|
||||
### Code Blocks
|
||||
|
||||
Hugo supports GitHub-flavored markdown's use of triple back ticks, as well as provides a special [`highlight` nested shortcode][hlsc] to render syntax highlighting via [Pygments][]. For usage examples and a complete explanation, see the [syntax highlighting documentation][hl] in [developer tools][].
|
||||
|
||||
## Mmark
|
||||
|
||||
Mmark is a [fork of BlackFriday][mmark] and markdown superset that is well suited for writing [IETF documentation][ietf]. You can see examples of the syntax in the [Mmark GitHub repository][mmarkgh] or the full syntax on [Miek Gieben's website][].
|
||||
|
||||
### Use Mmark
|
||||
|
||||
As Hugo ships with Mmark, using the syntax is as easy as changing the extension of your content files from `.md` to `.mmark`.
|
||||
|
||||
In the event that you want to only use Mmark in specific files, you can also define the Mmark syntax in your content's front matter:
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: My Post
|
||||
date: 2017-04-01
|
||||
markdown: mmark
|
||||
---
|
||||
```
|
||||
|
||||
{{% warning %}}
|
||||
Thare are some features not available in Mmark; one example being that shortcodes are not translated when used in an included `.mmark` file ([#3131](https://github.com/gohugoio/hugo/issues/3137)), and `EXTENSION_ABBREVIATION` ([#1970](https://github.com/gohugoio/hugo/issues/1970)) and the aforementioned GFM todo lists ([#2270](https://github.com/gohugoio/hugo/issues/2270)) are not fully supported. Contributions are welcome.
|
||||
{{% /warning %}}
|
||||
|
||||
## MathJax with Hugo
|
||||
|
||||
[MathJax](http://www.mathjax.org/) is a JavaScript library that allows the display of mathematical expressions described via a LaTeX-style syntax in the HTML (or Markdown) source of a web page. As it is a pure a JavaScript library, getting it to work within Hugo is fairly straightforward, but does have some oddities that will be discussed here.
|
||||
|
||||
This is not an introduction into actually using MathJax to render typeset mathematics on your website. Instead, this page is a collection of tips and hints for one way to get MathJax working on a website built with Hugo.
|
||||
|
||||
### Enable MathJax
|
||||
|
||||
The first step is to enable MathJax on pages that you would like to have typeset math. There are multiple ways to do this (adventurous readers can consult the [Loading and Configuring](http://docs.mathjax.org/en/latest/configuration.html) section of the MathJax documentation for additional methods of including MathJax), but the easiest way is to use the secure MathJax CDN by include a `<script>` tag for the officially recommended secure CDN ([cdn.js.com](https://cdnjs.com)):
|
||||
|
||||
{{% code file="add-mathjax-to-page.html" %}}
|
||||
```html
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
One way to ensure that this code is included in all pages is to put it in one of the templates that live in the `layouts/partials/` directory. For example, I have included this in the bottom of my template `footer.html` because I know that the footer will be included in every page of my website.
|
||||
|
||||
### Options and Features
|
||||
|
||||
MathJax is a stable open-source library with many features. I encourage the interested reader to view the [MathJax Documentation](http://docs.mathjax.org/en/latest/index.html), specifically the sections on [Basic Usage](http://docs.mathjax.org/en/latest/index.html#basic-usage) and [MathJax Configuration Options](http://docs.mathjax.org/en/latest/index.html#mathjax-configuration-options).
|
||||
|
||||
### Issues with Markdown
|
||||
|
||||
{{% note %}}
|
||||
The following issues with Markdown assume you are using `.md` for content and BlackFriday for parsing. Using [Mmark](#mmark) as your content format will obviate the need for the following workarounds.
|
||||
|
||||
When using Mmark with MathJax, use `displayMath: [['$$','$$'], ['\\[','\\]']]`. See the [Mmark `README.md`](https://github.com/miekg/mmark/wiki/Syntax#math-blocks) for more information. In addition to MathJax, Mmark has been shown to work well with [KaTeX](https://github.com/Khan/KaTeX). See this [related blog post from a Hugo user](http://nosubstance.me/post/a-great-toolset-for-static-blogging/).
|
||||
{{% /note %}}
|
||||
|
||||
After enabling MathJax, any math entered between proper markers (see the [MathJax documentation][mathjaxdocs]) will be processed and typeset in the web page. One issue that comes up, however, with Markdown is that the underscore character (`_`) is interpreted by Markdown as a way to wrap text in `emph` blocks while LaTeX (MathJax) interprets the underscore as a way to create a subscript. This "double speak" of the underscore can result in some unexpected and unwanted behavior.
|
||||
|
||||
### Solution
|
||||
|
||||
There are multiple ways to remedy this problem. One solution is to simply escape each underscore in your math code by entering `\_` instead of `_`. This can become quite tedious if the equations you are entering are full of subscripts.
|
||||
|
||||
Another option is to tell Markdown to treat the MathJax code as verbatim code and not process it. One way to do this is to wrap the math expression inside a `<div>` `</div>` block. Markdown would ignore these sections and they would get passed directly on to MathJax and processed correctly. This works great for display style mathematics, but for inline math expressions the line break induced by the `<div>` is not acceptable. The syntax for instructing Markdown to treat inline text as verbatim is by wrapping it in backticks (`` ` ``). You might have noticed, however, that the text included in between backticks is rendered differently than standard text (on this site these are items highlighted in red). To get around this problem, we could create a new CSS entry that would apply standard styling to all inline verbatim text that includes MathJax code. Below I will show the HTML and CSS source that would accomplish this (note this solution was adapted from [this blog post](http://doswa.com/2011/07/20/mathjax-in-markdown.html)---all credit goes to the original author).
|
||||
|
||||
{{% code file="mathjax-markdown-solution.html" %}}
|
||||
```js
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
tex2jax: {
|
||||
inlineMath: [['$','$'], ['\\(','\\)']],
|
||||
displayMath: [['$$','$$'], ['\[','\]']],
|
||||
processEscapes: true,
|
||||
processEnvironments: true,
|
||||
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
|
||||
TeX: { equationNumbers: { autoNumber: "AMS" },
|
||||
extensions: ["AMSmath.js", "AMSsymbols.js"] }
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Queue(function() {
|
||||
// Fix <code> tags after MathJax finishes running. This is a
|
||||
// hack to overcome a shortcoming of Markdown. Discussion at
|
||||
// https://github.com/mojombo/jekyll/issues/199
|
||||
var all = MathJax.Hub.getAllJax(), i;
|
||||
for(i = 0; i < all.length; i += 1) {
|
||||
all[i].SourceElement().parentNode.className += ' has-jax';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
|
||||
|
||||
As before, this content should be included in the HTML source of each page that will be using MathJax. The next code snippet contains the CSS that is used to have verbatim MathJax blocks render with the same font style as the body of the page.
|
||||
|
||||
{{% code file="mathjax-style.css" %}}
|
||||
```css
|
||||
code.has-jax {
|
||||
font: inherit;
|
||||
font-size: 100%;
|
||||
background: inherit;
|
||||
border: inherit;
|
||||
color: #515151;
|
||||
}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
In the CSS snippet, notice the line `color: #515151;`. `#515151` is the value assigned to the `color` attribute of the `body` class in my CSS. In order for the equations to fit in with the body of a web page, this value should be the same as the color of the body.
|
||||
|
||||
### Usage
|
||||
|
||||
With this setup, everything is in place for a natural usage of MathJax on pages generated using Hugo. In order to include inline mathematics, just put LaTeX code in between `` `$ TeX Code $` `` or `` `\( TeX Code \)` ``. To include display style mathematics, just put LaTeX code in between `<div>$$TeX Code$$</div>`. All the math will be properly typeset and displayed within your Hugo generated web page!
|
||||
|
||||
## Additional Formats Through External Helpers
|
||||
|
||||
Hugo has new concept called _external helpers_. It means that you can write your content using [Asciidoc][ascii], [reStructuredText][rest]. If you have files with associated extensions, Hugo will call external commands to generate the content. ([See the Hugo source code for external helpers][helperssource].)
|
||||
|
||||
For example, for Asciidoc files, Hugo will try to call the `asciidoctor` or `asciidoc` command. This means that you will have to install the associated tool on your machine to be able to use these formats. ([See the Asciidoctor docs for installation instructions](http://asciidoctor.org/docs/install-toolchain/)).
|
||||
|
||||
To use these formats, just use the standard extension and the front matter exactly as you would do with natively supported `.md` files.
|
||||
|
||||
{{% warning "Performance of External Helpers" %}}
|
||||
Because additional formats are external commands generation performance will rely heavily on the performance of the external tool you are using. As this feature is still in its infancy, feedback is welcome.
|
||||
{{% /warning %}}
|
||||
|
||||
## Learn Markdown
|
||||
|
||||
Markdown syntax is simple enough to learn in a single sitting. The following are excellent resources to get you up and running:
|
||||
|
||||
* [Daring Fireball: Markdown, John Gruber (Creator of Markdown)][fireball]
|
||||
* [Markdown Cheatsheet, Adam Pritchard][mdcheatsheet]
|
||||
* [Markdown Tutorial (Interactive), Garen Torikian][mdtutorial]
|
||||
|
||||
[`emojify` function]: /functions/emojify/
|
||||
[ascii]: http://asciidoc.org/
|
||||
[bfconfig]: /getting-started/configuration/#configuring-blackfriday-rendering
|
||||
[blackfriday]: https://github.com/russross/blackfriday
|
||||
[mmark]: https://github.com/miekg/mmark
|
||||
[config]: /getting-started/configuration/
|
||||
[developer tools]: /tools/
|
||||
[emojis]: https://www.webpagefx.com/tools/emoji-cheat-sheet/
|
||||
[fireball]: https://daringfireball.net/projects/markdown/
|
||||
[gfmtasks]: https://guides.github.com/features/mastering-markdown/#syntax
|
||||
[helperssource]: https://github.com/gohugoio/hugo/blob/77c60a3440806067109347d04eb5368b65ea0fe8/helpers/general.go#L65
|
||||
[hl]: /tools/syntax-highlighting/
|
||||
[hlsc]: /content-management/shortcodes/#highlight
|
||||
[hugocss]: /css/style.css
|
||||
[ietf]: https://tools.ietf.org/html/
|
||||
[mathjaxdocs]: https://docs.mathjax.org/en/latest/
|
||||
[mdcheatsheet]: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet
|
||||
[mdtutorial]: http://www.markdowntutorial.com/
|
||||
[Miek Gieben's website]: https://miek.nl/2016/March/05/mmark-syntax-document/
|
||||
[mmark]: https://github.com/miekg/mmark
|
||||
[mmarkgh]: https://github.com/miekg/mmark/wiki/Syntax
|
||||
[org]: http://orgmode.org/
|
||||
[Pygments]: http://pygments.org/
|
||||
[rest]: http://docutils.sourceforge.net/rst.html
|
||||
[sc]: /content-management/shortcodes/
|
||||
[sct]: /templates/shortcode-templates/
|
||||
@@ -0,0 +1,198 @@
|
||||
---
|
||||
title: Front Matter
|
||||
linktitle:
|
||||
description: Hugo allows you to add front matter in yaml, toml, or json to your content files.
|
||||
date: 2017-01-09
|
||||
publishdate: 2017-01-09
|
||||
lastmod: 2017-02-24
|
||||
categories: [content management]
|
||||
#tags: ["front matter", "yaml", "toml", "json", "metadata", "archetypes"]
|
||||
menu:
|
||||
docs:
|
||||
parent: "content-management"
|
||||
weight: 30
|
||||
weight: 30 #rem
|
||||
draft: false
|
||||
aliases: [/content/front-matter/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
**Front matter** allows you to keep metadata attached to an instance of a [content type][]---i.e., embedded inside a content file---and is one of the many features that gives Hugo its strength.
|
||||
|
||||
## Front Matter Formats
|
||||
|
||||
Hugo supports three formats for front matter, each with their own identifying tokens.
|
||||
|
||||
TOML
|
||||
: identified by opening and closing `+++`.
|
||||
|
||||
YAML
|
||||
: identified by opening and closing `---`.
|
||||
|
||||
JSON
|
||||
: a single JSON object surrounded by '`{`' and '`}`', followed by a new line.
|
||||
|
||||
### TOML Example
|
||||
|
||||
```toml
|
||||
+++
|
||||
title = "spf13-vim 3.0 release and new website"
|
||||
description = "spf13-vim is a cross platform distribution of vim plugins and resources for Vim."
|
||||
tags = [ ".vimrc", "plugins", "spf13-vim", "vim" ]
|
||||
date = "2012-04-06"
|
||||
categories = [
|
||||
"Development",
|
||||
"VIM"
|
||||
]
|
||||
slug = "spf13-vim-3-0-release-and-new-website"
|
||||
+++
|
||||
```
|
||||
|
||||
### YAML Example
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: "spf13-vim 3.0 release and new website"
|
||||
description: "spf13-vim is a cross platform distribution of vim plugins and resources for Vim."
|
||||
#tags: [ ".vimrc", "plugins", "spf13-vim", "vim" ]
|
||||
lastmod: 2015-12-23
|
||||
date: "2012-04-06"
|
||||
categories:
|
||||
- "Development"
|
||||
- "VIM"
|
||||
slug: "spf13-vim-3-0-release-and-new-website"
|
||||
---
|
||||
```
|
||||
|
||||
### JSON Example
|
||||
|
||||
```json
|
||||
{
|
||||
"title": "spf13-vim 3.0 release and new website",
|
||||
"description": "spf13-vim is a cross platform distribution of vim plugins and resources for Vim.",
|
||||
"tags": [ ".vimrc", "plugins", "spf13-vim", "vim" ],
|
||||
"date": "2012-04-06",
|
||||
"categories": [
|
||||
"Development",
|
||||
"VIM"
|
||||
],
|
||||
"slug": "spf13-vim-3-0-release-and-new-website"
|
||||
}
|
||||
```
|
||||
|
||||
## Front Matter Variables
|
||||
|
||||
### Predefined
|
||||
|
||||
There are a few predefined variables that Hugo is aware of. See [Page Variables][pagevars] for how to call many of these predefined variables in your templates.
|
||||
|
||||
`aliases`
|
||||
: an array of one or more aliases (e.g., old published paths of renamed content) that will be created in the output directory structure . See [Aliases][aliases] for details.
|
||||
|
||||
`date`
|
||||
: the datetime at which the content was created; note this value is auto-populated according to Hugo's built-in [archetype][].
|
||||
|
||||
`description`
|
||||
: the description for the content.
|
||||
|
||||
`draft`
|
||||
: if `true`, the content will not be rendered unless the `--buildDrafts` flag is passed to the `hugo` command.
|
||||
|
||||
`expiryDate`
|
||||
: the datetime at which the content should no longer be published by Hugo; expired content will not be rendered unless the `--buildExpired` flag is passed to the `hugo` command.
|
||||
|
||||
`isCJKLanguage`
|
||||
: if `true`, Hugo will explicitly treat the content as a CJK language; both `.Summary` and `.WordCount` work properly in CJK languages.
|
||||
|
||||
`keywords`
|
||||
: the meta keywords for the content.
|
||||
|
||||
`layout`
|
||||
: the layout Hugo should select from the [lookup order][lookup] when rendering the content. If a `type` is not specified in the front matter, Hugo will look for the layout of the same name in the layout directory that corresponds with a content's section. See ["Defining a Content Type"][definetype]
|
||||
|
||||
`lastmod`
|
||||
: the datetime at which the content was last modified.
|
||||
|
||||
`linkTitle`
|
||||
: used for creating links to content; if set, Hugo defaults to using the `linktitle` before the `title`. Hugo can also [order lists of content by `linktitle`][bylinktitle].
|
||||
|
||||
`markup`
|
||||
: **experimental**; specify `"rst"` for reStructuredText (requires`rst2html`) or `"md"` (default) for Markdown.
|
||||
|
||||
`outputs`
|
||||
: allows you to specify output formats specific to the content. See [output formats][outputs].
|
||||
|
||||
`publishDate`
|
||||
: if in the future, content will not be rendered unless the `--buildFuture` flag is passed to `hugo`.
|
||||
|
||||
`slug`
|
||||
: appears as the tail of the output URL. A value specified in front matter will override the segment of the URL based on the filename.
|
||||
|
||||
`taxonomies`
|
||||
: these will use the field name of the plural form of the index; see the `tags` and `categories` in the above front matter examples.
|
||||
|
||||
`title`
|
||||
: the title for the content.
|
||||
|
||||
`type`
|
||||
: the type of the content; this value will be automatically derived from the directory (i.e., the [section][]) if not specified in front matter.
|
||||
|
||||
`url`
|
||||
: the full path to the content from the web root. It makes no assumptions about the path of the content file. It also ignores any language prefixes of
|
||||
the multilingual feature.
|
||||
|
||||
`weight`
|
||||
: used for [ordering your content in lists][ordering].
|
||||
|
||||
{{% note "Hugo's Default URL Destinations" %}}
|
||||
If neither `slug` nor `url` is present and [permalinks are not configured otherwise in your site `config` file](/content-management/urls/#permalinks), Hugo will use the filename of your content to create the output URL. See [Content Organization](/content-management/organization) for an explanation of paths in Hugo and [URL Management](/content-management/urls/) for ways to customize Hugo's default behaviors.
|
||||
{{% /note %}}
|
||||
|
||||
### User-Defined
|
||||
|
||||
You can add fields to your front matter arbitrarily to meet your needs. These user-defined key-values are placed into a single `.Params` variable for use in your templates.
|
||||
|
||||
The following fields can be accessed via `.Params.include_toc` and `.Params.show_comments`, respectively. The [Variables][] section provides more information on using Hugo's page- and site-level variables in your templates.
|
||||
|
||||
```yaml
|
||||
include_toc: true
|
||||
show_comments: false
|
||||
```
|
||||
|
||||
These two user-defined fields can then be accessed via `.Params.include_toc` and `.Params.show_comments`, respectively. The [Variables][variables] section provides more information on using Hugo's page- and site-level variables in your templates.
|
||||
|
||||
|
||||
## Order Content Through Front Matter
|
||||
|
||||
You can assign content-specific `weight` in the front matter of your content. These values are especially useful for [ordering][ordering] in list views. You can use `weight` for ordering of content and the convention of [`<TAXONOMY>_weight`][taxweight] for ordering content within a taxonomy. See [Ordering and Grouping Hugo Lists][lists] to see how `weight` can be used to organize your content in list views.
|
||||
|
||||
## Override Global Markdown Configuration
|
||||
|
||||
It's possible to set some options for Markdown rendering in a content's front matter as an override to the [BlackFriday rendering options set in your project configuration][config].
|
||||
|
||||
## Front Matter Format Specs
|
||||
|
||||
* [TOML Spec][toml]
|
||||
* [YAML Spec][yaml]
|
||||
* [JSON Spec][json]
|
||||
|
||||
[variables]: /variables/
|
||||
[aliases]: /content-management/urls/#aliases/
|
||||
[archetype]: /content-management/archetypes/
|
||||
[bylinktitle]: /templates/lists/#by-link-title
|
||||
[config]: /getting-started/configuration/ "Hugo documentation for site configuration"
|
||||
[content type]: /content-management/types/
|
||||
[contentorg]: /content-management/organization/
|
||||
[definetype]: /content-management/types/#defining-a-content-type "Learn how to specify a type and a layout in a content's front matter"
|
||||
[json]: /documents/ecma-404-json-spec.pdf "Specification for JSON, JavaScript Object Notation"
|
||||
[lists]: /templates/lists/#ordering-content "See how to order content in list pages; for example, templates that look to specific _index.md for content and front matter."
|
||||
[lookup]: /templates/lookup-order/ "Hugo traverses your templates in a specific order when rendering content to allow for DRYer templating."
|
||||
[ordering]: /templates/lists/ "Hugo provides multiple ways to sort and order your content in list templates"
|
||||
[outputs]: /templates/output-formats/ "With the release of v22, you can output your content to any text format using Hugo's familiar templating"
|
||||
[pagevars]: /variables/page/
|
||||
[section]: /content-management/sections/
|
||||
[taxweight]: /content-management/taxonomies/
|
||||
[toml]: https://github.com/toml-lang/toml "Specification for TOML, Tom's Obvious Minimal Language"
|
||||
[urls]: /content-management/urls/
|
||||
[variables]: /variables/
|
||||
[yaml]: http://yaml.org/spec/ "Specification for YAML, YAML Ain't Markup Language"
|
||||
@@ -0,0 +1,183 @@
|
||||
---
|
||||
title: Menus
|
||||
linktitle: Menus
|
||||
description: Hugo has a simple yet powerful menu system.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-03-31
|
||||
categories: [content management]
|
||||
#tags: [menus]
|
||||
draft: false
|
||||
menu:
|
||||
docs:
|
||||
parent: "content-management"
|
||||
weight: 120
|
||||
weight: 120 #rem
|
||||
aliases: [/extras/menus/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
{{% note "Lazy Blogger"%}}
|
||||
If all you want is a simple menu for your sections, see the ["Section Menu for Lazy Bloggers" in Menu Templates](/templates/menu-templates/#section-menu-for-lazy-blogger).
|
||||
{{% /note %}}
|
||||
|
||||
You can do this:
|
||||
|
||||
* Place content in one or many menus
|
||||
* Handle nested menus with unlimited depth
|
||||
* Create menu entries without being attached to any content
|
||||
* Distinguish active element (and active branch)
|
||||
|
||||
## What is a Menu in Hugo?
|
||||
|
||||
A **menu** is a named array of menu entries accessible by name via the [`.Site.Menus` site variable][sitevars]. For example, you can access your site's `main` menu via `.Site.Menus.main`.
|
||||
|
||||
{{% note "Menus on Multilingual Sites" %}}
|
||||
If you make use of the [multilingual feature](/content-management/multilingual/), you can define language-independent menus.
|
||||
{{% /note %}}
|
||||
|
||||
A menu entry has the following properties (i.e., variables) available to it:
|
||||
|
||||
`.URL`
|
||||
: string
|
||||
|
||||
`.Name`
|
||||
: string
|
||||
|
||||
`.Menu`
|
||||
: string
|
||||
|
||||
`.Identifier`
|
||||
: string
|
||||
|
||||
`.Pre`
|
||||
: template.HTML
|
||||
|
||||
`.Post`
|
||||
: template.HTML
|
||||
|
||||
`.Weight`
|
||||
: int
|
||||
|
||||
`.Parent`
|
||||
: string
|
||||
|
||||
`.Children`
|
||||
: Menu
|
||||
|
||||
Note that menus also have the following functions available as well:
|
||||
|
||||
`.HasChildren`
|
||||
: boolean
|
||||
|
||||
Additionally, there are some relevant functions available to menus on a page:
|
||||
|
||||
`.IsMenuCurrent`
|
||||
: (menu string, menuEntry *MenuEntry ) boolean
|
||||
|
||||
`.HasMenuCurrent`
|
||||
: (menu string, menuEntry *MenuEntry) boolean
|
||||
|
||||
## Add content to menus
|
||||
|
||||
Hugo allows you to add content to a menu via the content's [front matter](/content-management/front-matter/).
|
||||
|
||||
### Simple
|
||||
|
||||
If all you need to do is add an entry to a menu, the simple form works well.
|
||||
|
||||
#### A Single Menu
|
||||
|
||||
```yaml
|
||||
---
|
||||
menu: "main"
|
||||
---
|
||||
```
|
||||
|
||||
#### Multiple Menus
|
||||
|
||||
```yaml
|
||||
---
|
||||
menu: ["main", "footer"]
|
||||
---
|
||||
```
|
||||
|
||||
#### Advanced
|
||||
|
||||
|
||||
```yaml
|
||||
---
|
||||
menu:
|
||||
docs:
|
||||
parent: 'extras'
|
||||
weight: 20
|
||||
---
|
||||
```
|
||||
|
||||
## Add Non-content Entries to a Menu
|
||||
|
||||
You can also add entries to menus that aren’t attached to a piece of content. This takes place in your Hugo project's [`config` file][config].
|
||||
|
||||
Here’s an example snippet pulled from a `config.toml`:
|
||||
|
||||
{{% code file="config.toml" %}}
|
||||
```toml
|
||||
[[menu.main]]
|
||||
name = "about hugo"
|
||||
pre = "<i class='fa fa-heart'></i>"
|
||||
weight = -110
|
||||
identifier = "about"
|
||||
url = "/about/"
|
||||
[[menu.main]]
|
||||
name = "getting started"
|
||||
pre = "<i class='fa fa-road'></i>"
|
||||
weight = -100
|
||||
url = "/getting-started/"
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
Here's the equivalent snippet in a `config.yaml`:
|
||||
|
||||
{{% code file="config.yml" %}}
|
||||
```yaml
|
||||
---
|
||||
menu:
|
||||
docs:
|
||||
- Name: "about hugo"
|
||||
Pre: "<i class='fa fa-heart'></i>"
|
||||
Weight: -110
|
||||
Identifier: "about"
|
||||
URL: "/about/"
|
||||
- Name: "getting started"
|
||||
Pre: "<i class='fa fa-road'></i>"
|
||||
Weight: -100
|
||||
URL: "/getting-started/"
|
||||
---
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
{{% note %}}
|
||||
The URLs must be relative to the context root. If the `baseURL` is `http://example.com/mysite/`, then the URLs in the menu must not include the context root `mysite`. Using an absolute URL will overide the baseURL. If the value used for `URL` in the above example is `http://subdomain.example.com/`, the output will be `http://subdomain.example.com`.
|
||||
{{% /note %}}
|
||||
|
||||
## Nesting
|
||||
|
||||
All nesting of content is done via the `parent` field.
|
||||
|
||||
The parent of an entry should be the identifier of another entry. The identifier should be unique (within a menu).
|
||||
|
||||
The following order is used to determine an Identifier:
|
||||
|
||||
`.Name > .LinkTitle > .Title`
|
||||
|
||||
This means that `.Title` will be used unless `.LinkTitle` is present, etc. In practice, `.Name` and `.Identifier` are only used to structure relationships and therefore never displayed.
|
||||
|
||||
In this example, the top level of the menu is defined in your [site `config` file][config]). All content entries are attached to one of these entries via the `.Parent` field.
|
||||
|
||||
## Render Menus
|
||||
|
||||
See [Menu Templates](/templates/menu-templates/) for information on how to render your site menus within your templates.
|
||||
|
||||
[config]: /getting-started/configuration/
|
||||
[multilingual]: /content-management/multilingual/
|
||||
[sitevars]: /variables/
|
||||
@@ -0,0 +1,300 @@
|
||||
---
|
||||
title: Multilingual Mode
|
||||
linktitle: Multilingual and i18n
|
||||
description: Hugo supports the creation of websites with multiple languages side by side.
|
||||
date: 2017-01-10
|
||||
publishdate: 2017-01-10
|
||||
lastmod: 2017-01-10
|
||||
categories: [content management]
|
||||
#tags: [multilingual,i18n, internationalization]
|
||||
menu:
|
||||
docs:
|
||||
parent: "content-management"
|
||||
weight: 150
|
||||
weight: 150 #rem
|
||||
draft: false
|
||||
aliases: [/content/multilingual/,/content-management/multilingual/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
You should define the available languages in a `Languages` section in your site configuration.
|
||||
|
||||
## Configure Languages
|
||||
|
||||
The following is an example of a TOML site configuration for a multilingual Hugo project:
|
||||
|
||||
{{% code file="config.toml" download="config.toml" %}}
|
||||
```toml
|
||||
DefaultContentLanguage = "en"
|
||||
copyright = "Everything is mine"
|
||||
|
||||
[params.navigation]
|
||||
help = "Help"
|
||||
|
||||
[Languages]
|
||||
[Languages.en]
|
||||
title = "My blog"
|
||||
weight = 1
|
||||
[Languages.en.params]
|
||||
linkedin = "english-link"
|
||||
|
||||
[Languages.fr]
|
||||
copyright = "Tout est à moi"
|
||||
title = "Mon blog"
|
||||
weight = 2
|
||||
[Languages.fr.params]
|
||||
linkedin = "lien-francais"
|
||||
[Languages.fr.navigation]
|
||||
help = "Aide"
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
Anything not defined in a `[Languages]` block will fall back to the global
|
||||
value for that key (e.g., `copyright` for the English [`en`] language).
|
||||
|
||||
With the configuration above, all content, sitemap, RSS feeds, paginations,
|
||||
and taxonomy pages will be rendered below `/` in English (your default content language) and then below `/fr` in French.
|
||||
|
||||
When working with front matter `Params` in [single page templates][singles], omit the `params` in the key for the translation.
|
||||
|
||||
If you want all of the languages to be put below their respective language code, enable `defaultContentLanguageInSubdir: true`.
|
||||
|
||||
Only the obvious non-global options can be overridden per language. Examples of global options are `baseURL`, `buildDrafts`, etc.
|
||||
|
||||
## Taxonomies and Blackfriday
|
||||
|
||||
Taxonomies and [Blackfriday configuration][config] can also be set per language:
|
||||
|
||||
|
||||
{{% code file="bf-config.toml" %}}
|
||||
```toml
|
||||
[Taxonomies]
|
||||
tag = "tags"
|
||||
|
||||
[blackfriday]
|
||||
angledQuotes = true
|
||||
hrefTargetBlank = true
|
||||
|
||||
[Languages]
|
||||
[Languages.en]
|
||||
weight = 1
|
||||
title = "English"
|
||||
[Languages.en.blackfriday]
|
||||
angledQuotes = false
|
||||
|
||||
[Languages.fr]
|
||||
weight = 2
|
||||
title = "Français"
|
||||
[Languages.fr.Taxonomies]
|
||||
plaque = "plaques"
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
## Translate Your Content
|
||||
|
||||
Translated articles are identified by the name of the content file.
|
||||
|
||||
### Examples of Translated Articles
|
||||
|
||||
1. `/content/about.en.md`
|
||||
2. `/content/about.fr.md`
|
||||
|
||||
In this eample, the `about.md` will be assigned the configured `defaultContentLanguage`.
|
||||
|
||||
1. `/content/about.md`
|
||||
2. `/content/about.fr.md`
|
||||
|
||||
This way, you can slowly start to translate your current content without having to rename everything. If left unspecified, the default value for `defaultContentLanguage` is `en`.
|
||||
|
||||
By having the same *base filename*, the content pieces are linked together as translated pieces.
|
||||
|
||||
If you need distinct URLs per language, you can set the slug in the non-default language file. For example, you can define a custom slug for a French translation in the front matter of `content/about.fr.md` as follows:
|
||||
|
||||
```yaml
|
||||
slug: "a-propos"
|
||||
|
||||
```
|
||||
|
||||
At render, Hugo will build both `/about/` and `/a-propos/` as properly linked translated pages.
|
||||
|
||||
{{%note %}}
|
||||
Hugo currently uses the base filename as the translation key, which can be an issue with identical filenames in different sections.
|
||||
We will fix this in https://github.com/gohugoio/hugo/issues/2699
|
||||
{{% /note %}}
|
||||
{{< todo >}}Rewrite/remove the above one issue is fixed.{{< /todo >}}
|
||||
|
||||
## Link to Translated Content
|
||||
|
||||
To create a list of links to translated content, use a template similar to the following:
|
||||
|
||||
{{% code file="layouts/partials/i18nlist.html" %}}
|
||||
```html
|
||||
{{ if .IsTranslated }}
|
||||
<h4>{{ i18n "translations" }}</h4>
|
||||
<ul>
|
||||
{{ range .Translations }}
|
||||
<li>
|
||||
<a href="{{ .Permalink }}">{{ .Lang }}: {{ .Title }}{{ if .IsPage }} ({{ i18n "wordCount" . }}){{ end }}</a>
|
||||
</li>
|
||||
{{ end}}
|
||||
</ul>
|
||||
{{ end }}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
The above can be put in a `partial` (i.e., inside `layouts/partials/`) and included in any template, be it for a [single content page][contenttemplate] or the [homepage][]. It will not print anything if there are no translations for a given page, or if there are translations---in the case of the homepage, section listing, etc.---a site with only render one language.
|
||||
|
||||
The above also uses the [`i18n` function][i18func] described in the next section.
|
||||
|
||||
## Translation of Strings
|
||||
|
||||
Hugo uses [go-i18n][] to support string translations. [See the project's source repository][go-i18n-source] to find tools that will help you manage your translation workflows.
|
||||
|
||||
Translations are collected from the `themes/<THEME>/i18n/` folder (built into the theme), as well as translations present in `i18n/` at the root of your project. In the `i18n`, the translations will be merged and take precedence over what is in the theme folder. Language files should be named according to [RFC 5646][] with names such as `en-US.toml`, `fr.toml`, etc.
|
||||
|
||||
From within your templates, use the `i18n` function like this:
|
||||
|
||||
```
|
||||
{{ i18n "home" }}
|
||||
```
|
||||
|
||||
This uses a definition like this one in `i18n/en-US.toml`:
|
||||
|
||||
```
|
||||
[home]
|
||||
other = "Home"
|
||||
```
|
||||
|
||||
Often you will want to use to the page variables in the translations strings. To do that, pass on the "." context when calling `i18n`:
|
||||
|
||||
```
|
||||
{{ i18n "wordCount" . }}
|
||||
```
|
||||
|
||||
This uses a definition like this one in `i18n/en-US.toml`:
|
||||
|
||||
```
|
||||
[wordCount]
|
||||
other = "This article has {{ .WordCount }} words."
|
||||
```
|
||||
An example of singular and plural form:
|
||||
|
||||
```
|
||||
[readingTime]
|
||||
one = "One minute read"
|
||||
other = "{{.Count}} minutes read"
|
||||
```
|
||||
And then in the template:
|
||||
|
||||
```
|
||||
{{ i18n "readingTime" .ReadingTime }}
|
||||
```
|
||||
To track down missing translation strings, run Hugo with the `--i18n-warnings` flag:
|
||||
|
||||
```bash
|
||||
hugo --i18n-warnings | grep i18n
|
||||
i18n|MISSING_TRANSLATION|en|wordCount
|
||||
```
|
||||
|
||||
## Customize Dates
|
||||
|
||||
At the time of this writing, Golang does not yet have support for internationalized locales, but if you do some work, you can simulate it. For example, if you want to use French month names, you can add a data file like ``data/mois.yaml`` with this content:
|
||||
|
||||
~~~yaml
|
||||
1: "janvier"
|
||||
2: "février"
|
||||
3: "mars"
|
||||
4: "avril"
|
||||
5: "mai"
|
||||
6: "juin"
|
||||
7: "juillet"
|
||||
8: "août"
|
||||
9: "septembre"
|
||||
10: "octobre"
|
||||
11: "novembre"
|
||||
12: "décembre"
|
||||
~~~
|
||||
|
||||
... then index the non-English date names in your templates like so:
|
||||
|
||||
~~~html
|
||||
<time class="post-date" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}">
|
||||
Article publié le {{ .Date.Day }} {{ index $.Site.Data.mois (printf "%d" .Date.Month) }} {{ .Date.Year }} (dernière modification le {{ .Lastmod.Day }} {{ index $.Site.Data.mois (printf "%d" .Lastmod.Month) }} {{ .Lastmod.Year }})
|
||||
</time>
|
||||
~~~
|
||||
|
||||
This technique extracts the day, month and year by specifying ``.Date.Day``, ``.Date.Month``, and ``.Date.Year``, and uses the month number as a key, when indexing the month name data file.
|
||||
|
||||
## Menus
|
||||
|
||||
You can define your menus for each language independently. The [creation of a menu][menus] works analogous to earlier versions of Hugo, except that they have to be defined in their language-specific block in the configuration file:
|
||||
|
||||
```toml
|
||||
defaultContentLanguage = "en"
|
||||
|
||||
[languages.en]
|
||||
weight = 0
|
||||
languageName = "English"
|
||||
|
||||
[[languages.en.menu.main]]
|
||||
url = "/"
|
||||
name = "Home"
|
||||
weight = 0
|
||||
|
||||
|
||||
[languages.de]
|
||||
weight = 10
|
||||
languageName = "Deutsch"
|
||||
|
||||
[[languages.de.menu.main]]
|
||||
url = "/"
|
||||
name = "Startseite"
|
||||
weight = 0
|
||||
```
|
||||
|
||||
The rendering of the main navigation works as usual. `.Site.Menus` will just contain the menu of the current language. Pay attention to the generation of the menu links. `absLangURL` takes care that you link to the correct locale of your website. Otherwise, both menu entries would link to the English version as the default content language that resides in the root directory.
|
||||
|
||||
```html
|
||||
<ul>
|
||||
{{- $currentPage := . -}}
|
||||
{{ range .Site.Menus.main -}}
|
||||
<li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}">
|
||||
<a href="{{ .URL | absLangURL }}">{{ .Name }}</a>
|
||||
</li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
|
||||
```
|
||||
|
||||
## Missing translations
|
||||
|
||||
If a string does not have a translation for the current language, Hugo will use the value from the default language. If no default value is set, an empty string will be shown.
|
||||
|
||||
While translating a Hugo website, it can be handy to have a visual indicator of missing translations. The [`enableMissingTranslationPlaceholders` configuration option][config] will flag all untranslated strings with the placeholder `[i18n] identifier`, where `identifier` is the id of the missing translation.
|
||||
|
||||
{{% note %}}
|
||||
Hugo will generate your website with these missing translation placeholders. It might not be suited for production environments.
|
||||
{{% /note %}}
|
||||
|
||||
## Multilingual Themes support
|
||||
|
||||
To support Multilingual mode in your themes, some considerations must be taken for the URLs in the templates. If there is more than one language, URLs must meet the following criteria:
|
||||
|
||||
* Come from the built-in `.Permalink` or `.URL`
|
||||
* Be constructed with
|
||||
* The [`relLangURL` template function][rellangurl] or the [`absLangURL` template function][abslangurl] **OR**
|
||||
* Prefixed with `{{ .LanguagePrefix }}`
|
||||
|
||||
If there is more than one language defined, the `LanguagePrefix` variable will equal `/en` (or whatever your `CurrentLanguage` is). If not enabled, it will be an empty string and is therefore harmless for single-language Hugo websites.
|
||||
|
||||
[abslangurl]: /functions/abslangurl
|
||||
[config]: /getting-started/configuration/
|
||||
[contenttemplate]: /templates/single-page-templates/
|
||||
[go-i18n-source]: https://github.com/nicksnyder/go-i18n
|
||||
[go-i18n]: https://github.com/nicksnyder/go-i18n
|
||||
[homepage]: /templates/homepage/
|
||||
[i18func]: /functions/i18n/
|
||||
[menus]: /content-management/menus/
|
||||
[rellangurl]: /functions/rellangurl
|
||||
[RFC 5646]: https://tools.ietf.org/html/rfc5646
|
||||
[singles]: /templates/single-page-templates/
|
||||
@@ -0,0 +1,247 @@
|
||||
---
|
||||
title: Content Organization
|
||||
linktitle: Organization
|
||||
description: Hugo assumes that the same structure that works to organize your source content is used to organize the rendered site.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [content management,fundamentals]
|
||||
#tags: [sections,content,organization]
|
||||
menu:
|
||||
docs:
|
||||
parent: "content-management"
|
||||
weight: 10
|
||||
weight: 10 #rem
|
||||
draft: false
|
||||
aliases: [/content/sections/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
{{% note %}}
|
||||
This section is not updated with the new nested sections support in Hugo 0.24, see https://github.com/gohugoio/hugoDocs/issues/36
|
||||
{{% /note %}}
|
||||
{{% todo %}}
|
||||
See above
|
||||
{{% /todo %}}
|
||||
|
||||
## Organization of Content Source
|
||||
|
||||
In Hugo, your content should be organized in a manner that reflects the rendered website.
|
||||
|
||||
While Hugo supports content nested at any level, the top levels (i.e. `content/<DIRECTORIES>`) are special in Hugo and are considered the content [sections][]. Without any additional configuration, the following will just work:
|
||||
|
||||
```
|
||||
.
|
||||
└── content
|
||||
└── about
|
||||
| └── _index.md // <- http://yoursite.com/about/
|
||||
├── post
|
||||
| ├── firstpost.md // <- http://yoursite.com/post/firstpost/
|
||||
| ├── happy
|
||||
| | └── ness.md // <- http://yoursite.com/post/happy/ness/
|
||||
| └── secondpost.md // <- http://yoursite.com/post/secondpost/
|
||||
└── quote
|
||||
├── first.md // <- http://yoursite.com/quote/first/
|
||||
└── second.md // <- http://yoursite.com/quote/second/
|
||||
```
|
||||
|
||||
## Path Breakdown in Hugo
|
||||
|
||||
The following demonstrates the relationships between your content organization and the output URL structure for your Hugo website when it renders. These examples assume you are [using pretty URLs][pretty], which is the default behavior for Hugo. The examples also assume a key-value of `baseurl = "http://yoursite.com"` in your [site's configuration file][config].
|
||||
|
||||
### Index Pages: `_index.md`
|
||||
|
||||
`_index.md` has a special role in Hugo. It allows you to add front matter and content to your [list templates][lists] as of v0.18. These templates include those for [section templates][], [taxonomy templates][], [taxonomy terms templates][], and your [homepage template][]. In your templates, you can grab information from `_index.md` using the [`.Site.GetPage` function][getpage].
|
||||
|
||||
You can keep one `_index.md` for your homepage and one in each of your content sections, taxonomies, and taxonomy terms. The following shows typical placement of an `_index.md` that would contain content and front matter for a `posts` section list page on a Hugo website:
|
||||
|
||||
|
||||
```bash
|
||||
. url
|
||||
. ⊢--^-⊣
|
||||
. path slug
|
||||
. ⊢--^-⊣⊢---^---⊣
|
||||
. filepath
|
||||
. ⊢------^------⊣
|
||||
content/posts/_index.md
|
||||
```
|
||||
|
||||
At build, this will output to the following destination with the associated values:
|
||||
|
||||
```bash
|
||||
|
||||
url ("/posts/")
|
||||
⊢-^-⊣
|
||||
baseurl section ("posts")
|
||||
⊢--------^---------⊣⊢-^-⊣
|
||||
permalink
|
||||
⊢----------^-------------⊣
|
||||
http://yoursite.com/posts/index.html
|
||||
```
|
||||
|
||||
### Single Pages in Sections
|
||||
|
||||
Single content files in each of your sections are going to be rendered as [single page templates][singles]. Here is an example of a single `post` within `posts`:
|
||||
|
||||
|
||||
```bash
|
||||
path ("posts/my-first-hugo-post.md")
|
||||
. ⊢-----------^------------⊣
|
||||
. section slug
|
||||
. ⊢-^-⊣⊢--------^----------⊣
|
||||
content/posts/my-first-hugo-post.md
|
||||
```
|
||||
|
||||
At the time Hugo builds your site, the content will be output to the following destination:
|
||||
|
||||
```bash
|
||||
|
||||
url ("/posts/my-first-hugo-post/")
|
||||
⊢------------^----------⊣
|
||||
baseurl section slug
|
||||
⊢--------^--------⊣⊢-^--⊣⊢-------^---------⊣
|
||||
permalink
|
||||
⊢--------------------^---------------------⊣
|
||||
http://yoursite.com/posts/my-first-hugo-post/index.html
|
||||
```
|
||||
|
||||
### Section with Nested Directories
|
||||
|
||||
To continue the example, the following demonstrates destination paths for a file located at `content/events/chicago/lollapalooza.md` in the same site:
|
||||
|
||||
|
||||
```bash
|
||||
section
|
||||
⊢--^--⊣
|
||||
url
|
||||
⊢-------------^------------⊣
|
||||
|
||||
baseURL path slug
|
||||
⊢--------^--------⊣ ⊢------^-----⊣⊢----^------⊣
|
||||
permalink
|
||||
⊢----------------------^-----------------------⊣
|
||||
http://yoursite.com/events/chicago/lollapalooza/
|
||||
```
|
||||
|
||||
{{% note %}}
|
||||
As of v0.20, Hugo does not recognize nested sections. While you can nest as many content *directories* as you'd like, any child directory of a section will still be considered the same section as that of its parents. Therefore, in the above example, `{{.Section}}` for `lollapalooza.md` is `events` and *not* `chicago`. See the [related issue on GitHub](https://github.com/gohugoio/hugo/issues/465).
|
||||
{{% /note %}}
|
||||
|
||||
## Paths Explained
|
||||
|
||||
The following concepts will provide more insight into the relationship between your project's organization and the default behaviors of Hugo when building the output website.
|
||||
|
||||
### `section`
|
||||
|
||||
A default content type is determined by a piece of content's section. `section` is determined by the location within the project's `content` directory. `section` *cannot* be specified or overridden in front matter.
|
||||
|
||||
### `slug`
|
||||
|
||||
A content's `slug` is either `name.extension` or `name/`. The value for `slug` is determined by
|
||||
|
||||
* the name of the content file (e.g., `lollapalooza.md`) OR
|
||||
* front matter overrides
|
||||
|
||||
### `path`
|
||||
|
||||
A content's `path` is determined by the section's path to the file. The file `path`
|
||||
|
||||
* is based on the path to the content's location AND
|
||||
* does not include the slug
|
||||
|
||||
### `url`
|
||||
|
||||
The `url` is the relative URL for the piece of content. The `url`
|
||||
|
||||
* is based on the content's location within the directory structure OR
|
||||
* is defined in front matter and *overrides all the above*
|
||||
|
||||
## Override Destination Paths via Front Matter
|
||||
|
||||
Hugo believes that you organize your content with a purpose. The same structure that works to organize your source content is used to organize the rendered site. As displayed above, the organization of the source content will be mirrored in the destination.
|
||||
|
||||
There are times where you may need more control over your content. In these cases, there are fields that can be specified in the front matter to determine the destination of a specific piece of content.
|
||||
|
||||
The following items are defined in this order for a specific reason: items explained further down in the list will override earlier items, and not all of these items can be defined in front matter:
|
||||
|
||||
### `filename`
|
||||
|
||||
This isn't in the front matter, but is the actual name of the file minus the extension. This will be the name of the file in the destination (e.g., `content/posts/my-post.md` becomes `yoursite.com/posts/my-post/`).
|
||||
|
||||
### `slug`
|
||||
|
||||
When defined in the front matter, the `slug` can take the place of the filename for the destination.
|
||||
|
||||
{{% code file="content/posts/old-post.md" %}}
|
||||
```yaml
|
||||
---
|
||||
title: New Post
|
||||
slug: "new-post"
|
||||
---
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
This will render to the following destination according to Hugo's default behavior:
|
||||
|
||||
```
|
||||
yoursite.com/posts/new-post/
|
||||
```
|
||||
|
||||
### `section`
|
||||
|
||||
`section` is determined by a content's location on disk and *cannot* be specified in the front matter. See [sections][] for more information.
|
||||
|
||||
### `type`
|
||||
|
||||
A content's `type` is also determined by its location on disk but, unlike `section`, it *can* be specified in the front matter. See [types][]. This can come in especially handy when you want a piece of content to render using a different layout. In the following example, you can create a layout at `layouts/new/mylayout.html` that Hugo will use to render this piece of content, even in the midst of many other posts.
|
||||
|
||||
{{% code file="content/posts/my-post.md" %}}
|
||||
```yaml
|
||||
---
|
||||
title: My Post
|
||||
type: new
|
||||
layout: mylayout
|
||||
---
|
||||
```
|
||||
{{% /code %}}
|
||||
<!-- See https://discourse.gohugo.io/t/path-not-works/6387 -->
|
||||
<!-- ### `path`
|
||||
|
||||
`path` can be provided in the front matter. This will replace the actual path to the file on disk. Destination will create the destination with the same path, including the section. -->
|
||||
|
||||
### `url`
|
||||
|
||||
A complete URL can be provided. This will override all the above as it pertains to the end destination. This must be the path from the baseURL (starting with a `/`). `url` will be used exactly as it provided in the front matter and will ignore the `--uglyURLs` setting in your site configuration:
|
||||
|
||||
{{% code file="content/posts/old-url.md" %}}
|
||||
```yaml
|
||||
---
|
||||
title: Old URL
|
||||
url: /blog/new-url/
|
||||
---
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
Assuming your `baseURL` is [configured][config] to `https://yoursite.com`, the addition of `url` to the front matter will make `old-url.md` render to the following destination:
|
||||
|
||||
```
|
||||
https://yoursite.com/blog/new-url/
|
||||
```
|
||||
|
||||
You can see more information on how to control output paths in [URL Management][urls].
|
||||
|
||||
[config]: /getting-started/configuration/
|
||||
[formats]: /content-management/formats/
|
||||
[front matter]: /content-management/front-matter/
|
||||
[getpage]: /functions/getpage/
|
||||
[homepage template]: /templates/homepage/
|
||||
[homepage]: /templates/homepage/
|
||||
[lists]: /templates/lists/
|
||||
[pretty]: /content-management/urls/#pretty-urls
|
||||
[section templates]: /templates/section-templates/
|
||||
[sections]: /content-management/sections/
|
||||
[singles]: /templates/single-page-templates/
|
||||
[taxonomy templates]: /templates/taxonomy-templates/
|
||||
[taxonomy terms templates]: /templates/taxonomy-templates/
|
||||
[types]: /content-management/types/
|
||||
[urls]: /content-management/urls/
|
||||
@@ -0,0 +1,73 @@
|
||||
---
|
||||
title: Content Sections
|
||||
linktitle: Sections
|
||||
description: Hugo supports content sections, which according to Hugo's default behavior, will reflect the structure of the rendered website.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [content management]
|
||||
#tags: [lists,sections,content types,organization]
|
||||
menu:
|
||||
docs:
|
||||
parent: "content-management"
|
||||
weight: 50
|
||||
weight: 50 #rem
|
||||
draft: false
|
||||
aliases: [/content/sections/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
{{% note %}}
|
||||
This section is not updated with the new nested sections support in Hugo 0.24, see https://github.com/gohugoio/hugoDocs/issues/36
|
||||
{{% /note %}}
|
||||
{{% todo %}}
|
||||
See above
|
||||
{{% /todo %}}
|
||||
|
||||
Hugo believes that you organize your content with a purpose. The same structure that works to organize your source content is used to organize the rendered site (see [directory structure][]).
|
||||
|
||||
Following this pattern, Hugo uses the top level of your content organization as the content **section**.
|
||||
|
||||
The following example shows a content directory structure for a website that has three sections: "authors," "events," and "posts":
|
||||
|
||||
```bash
|
||||
.
|
||||
└── content
|
||||
├── authors
|
||||
| ├── _index.md // <- yoursite.com/authors/
|
||||
| ├── john-doe.md // <- yoursite.com/authors/john-doe/
|
||||
| └── jane-doe.md // <- yoursite.com/authors/jane-doe/
|
||||
└── events
|
||||
| ├── _index.md // <- yoursite.com/events/
|
||||
| ├── event-1.md // <- yoursite.com/events/event-1/
|
||||
| ├── event-2.md // <- yoursite.com/events/event-2/
|
||||
| └── event-3.md // <- yoursite.com/events/event-3/
|
||||
└── posts
|
||||
| ├── _index.md // <- yoursite.com/posts/
|
||||
| ├── event-1.md // <- yoursite.com/posts/event-1/
|
||||
| ├── event-2.md // <- yoursite.com/posts/event-2/
|
||||
| ├── event-3.md // <- yoursite.com/posts/event-3/
|
||||
| ├── event-4.md // <- yoursite.com/posts/event-4/
|
||||
| └── event-5.md // <- yoursite.com/posts/event-5/
|
||||
```
|
||||
|
||||
## Content Section Lists
|
||||
|
||||
Hugo will automatically create pages for each section root that list all of the content in that section. See the documentation on [section templates][] for details on customizing the way these pages are rendered.
|
||||
|
||||
As of Hugo v0.18, section pages can also have a content file and front matter. These section content files must be placed in their corresponding section folder and named `_index.md` in order for Hugo to correctly render the front matter and content.
|
||||
|
||||
{{% warning "`index.md` vs `_index.md`" %}}
|
||||
Hugo themes developed before v0.18 often used an `index.md`(i.e., without the leading underscore [`_`]) in a content section as a hack to emulate the behavior of `_index.md`. The hack may work...*sometimes*; however, the order of page rendering can be unpredictable in Hugo. What works now may fail to render appropriately as your site grows. It is **strongly advised** to use `_index.md` as content for your section index pages. **Note:** `_index.md`'s layout, as representative of a section, is a [list page template](/templates/section-templates/) and *not* a [single page template](/templates/single-page-templates/). If you want to alter the new default behavior for `_index.md`, configure `disableKinds` accordingly in your [site's configuration](/getting-started/configuration/).
|
||||
{{% /warning %}}
|
||||
|
||||
## Content *Section* vs Content *Type*
|
||||
|
||||
By default, everything created within a section will use the [content type][] that matches the section name. For example, Hugo will assume that `posts/post-1.md` has a `posts` content type. If you are using an [archetype][] for your posts section, Hugo will generate front matter according to what it finds in `archetypes/posts.md`.
|
||||
|
||||
[archetype]: /content-management/archetypes/
|
||||
[content type]: /content-management/types/
|
||||
[directory structure]: /getting-started/directory-structure/
|
||||
[section templates]: /templates/section-templates/
|
||||
|
||||
|
||||
@@ -0,0 +1,431 @@
|
||||
---
|
||||
title: Shortcodes
|
||||
linktitle:
|
||||
description: Shortcodes are simple snippets inside your content files calling built-in or custom templates.
|
||||
godocref:
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-03-31
|
||||
menu:
|
||||
docs:
|
||||
parent: "content-management"
|
||||
weight: 35
|
||||
weight: 35 #rem
|
||||
categories: [content management]
|
||||
#tags: [markdown,content,shortcodes]
|
||||
draft: false
|
||||
aliases: [/extras/shortcodes/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
## What a Shortcode is
|
||||
|
||||
Hugo loves Markdown because of its simple content format, but there are times when Markdown falls short. Often, content authors are forced to add raw HTML (e.g., video `<iframes>`) to Markdown content. We think this contradicts the beautiful simplicity of Markdown's syntax.
|
||||
|
||||
Hugo created **shortcodes** to circumvent these limitations.
|
||||
|
||||
A shortcode is a simple snippet inside a content file that Hugo will render using a predefined template. Note that shortcodes will not work in template files. If you need the type of drop-in functionality that shortcodes provide but in a template, you most likely want a [partial template][partials] instead.
|
||||
|
||||
In addition to cleaner Markdown, shortcodes can be updated any time to reflect new classes, techniques, or standards. At the point of site generation, Hugo shortcodes will easily merge in your changes. You avoid a possibly complicated search and replace operation.
|
||||
|
||||
## Use Shortcodes
|
||||
|
||||
In your content files, a shortcode can be called by calling `{{%/* shortcodename parameters */%}}`. Shortcode parameters are space delimited, and parameters with internal spaces can be quoted.
|
||||
|
||||
The first word in the shortcode declaration is always the name of the shortcode. Parameters follow the name. Depending upon how the shortcode is defined, the parameters may be named, positional, or both, although you can't mix parameter types in a single call. The format for named parameters models that of HTML with the format `name="value"`.
|
||||
|
||||
Some shortcodes use or require closing shortcodes. Again like HTML, the opening and closing shortcodes match (name only) with the closing declaration, which is prepended with a slash.
|
||||
|
||||
Here are two examples of paired shortcodes:
|
||||
|
||||
```md
|
||||
{{%/* mdshortcode */%}}Stuff to `process` in the *center*.{{%/* /mdshortcode */%}}
|
||||
```
|
||||
|
||||
```md
|
||||
{{</* highlight go */>}} A bunch of code here {{</* /highlight */>}}
|
||||
```
|
||||
|
||||
The examples above use two different delimiters, the difference being the `%` character in the first and the `<>` characters in the second.
|
||||
|
||||
### Shortcodes with Markdown
|
||||
|
||||
The `%` character indicates that the shortcode's inner content---called in the [shortcode template][sctemps] with the [`.Inner` variable][scvars]---needs further processing by the page's rendering processor (i.e. markdown via Blackfriday). In the following example, Blackfriday would convert `**World**` to `<strong>World</strong>`:
|
||||
|
||||
```md
|
||||
{{%/* myshortcode */%}}Hello **World!**{{%/* /myshortcode */%}}
|
||||
```
|
||||
|
||||
### Shortcodes Without Markdown
|
||||
|
||||
The `<` character indicates that the shortcode's inner content does *not* need further rendering. Often shortcodes without markdown include internal HTML:
|
||||
|
||||
```md
|
||||
{{</* myshortcode */>}}<p>Hello <strong>World!</strong></p>{{</* /myshortcode */>}}
|
||||
```
|
||||
|
||||
### Nested Shortcodes
|
||||
|
||||
You can call shortcodes within other shortcodes by creating your own templates that leverage the `.Parent` variable. `.Parent` allows you to check the context in which the shortcode is being called. See [Shortcode templates][sctemps].
|
||||
|
||||
## Use Hugo's Built-in Shortcodes
|
||||
|
||||
Hugo ships with a set of predefined shortcodes that represent very common usage. These shortcodes are provided for author convenience and to keep your markdown content clean.
|
||||
|
||||
### `figure`
|
||||
|
||||
`figure` is an extension of the image syntax in markdown, which does not provide a shorthand for the more semantic [HTML5 `<figure>` element][figureelement].
|
||||
|
||||
The `figure` shortcode can use the following named parameters:
|
||||
|
||||
* `src`
|
||||
* `link`
|
||||
* `title`
|
||||
* `caption`
|
||||
* `class`
|
||||
* `attr` (i.e., attribution)
|
||||
* `attrlink`
|
||||
* `alt`
|
||||
|
||||
#### Example `figure` Input
|
||||
|
||||
{{% code file="figure-input-example.md" %}}
|
||||
```markdown
|
||||
{{</* figure src="/media/spf13.jpg" title="Steve Francia" */>}}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
#### Example `figure` Output
|
||||
|
||||
{{% output file="figure-output-example.html" %}}
|
||||
```html
|
||||
<figure>
|
||||
<img src="/media/spf13.jpg" />
|
||||
<figcaption>
|
||||
<h4>Steve Francia</h4>
|
||||
</figcaption>
|
||||
</figure>
|
||||
```
|
||||
{{% /output %}}
|
||||
|
||||
### `gist`
|
||||
|
||||
Bloggers often want to include GitHub gists when writing posts. Let's suppose we want to use the [gist at the following url][examplegist]:
|
||||
|
||||
```html
|
||||
https://gist.github.com/spf13/7896402
|
||||
```
|
||||
|
||||
We can embed the gist in our content via username and gist ID pulled from the URL:
|
||||
|
||||
```md
|
||||
{{</* gist spf13 7896402 */>}}
|
||||
```
|
||||
|
||||
#### Example `gist` Input
|
||||
|
||||
If the gist contains several files and you want to quote just one of them, you can pass the filename (quoted) as an optional third argument:
|
||||
|
||||
{{% code file="gist-input.md" %}}
|
||||
```md
|
||||
{{</* gist spf13 7896402 "img.html" */>}}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
#### Example `gist` Output
|
||||
|
||||
{{% output file="gist-output.html" %}}
|
||||
```html
|
||||
{{< gist spf13 7896402 >}}
|
||||
```
|
||||
{{% /output %}}
|
||||
|
||||
#### Example `gist` Display
|
||||
|
||||
To demonstrate the remarkably efficiency of Hugo's shortcode feature, we have embedded the `spf13` `gist` example in this page. The following simulates the experience for visitors to your website. Naturally, the final display will be contingent on your stylesheets and surrounding markup.
|
||||
|
||||
{{< gist spf13 7896402 >}}
|
||||
|
||||
### `highlight`
|
||||
|
||||
This shortcode will convert the source code provided into syntax-highlighted HTML. Read more on [highlighting](/tools/syntax-highlighting/). `highlight` takes exactly one required `language` parameter and requires a closing shortcode.
|
||||
|
||||
#### Example `highlight` Input
|
||||
|
||||
{{% code file="content/tutorials/learn-html.md" %}}
|
||||
```html
|
||||
{{</* highlight html */>}}
|
||||
<section id="main">
|
||||
<div>
|
||||
<h1 id="title">{{ .Title }}</h1>
|
||||
{{ range .Data.Pages }}
|
||||
{{ .Render "summary"}}
|
||||
{{ end }}
|
||||
</div>
|
||||
</section>
|
||||
{{</* /highlight */>}}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
#### Example `highlight` Output
|
||||
|
||||
The `highlight` shortcode example above would produce the following HTML when the site is rendered:
|
||||
|
||||
{{% output file="tutorials/learn-html/index.html" %}}
|
||||
```html
|
||||
<span style="color: #f92672"><section</span> <span style="color: #a6e22e">id=</span><span style="color: #e6db74">"main"</span><span style="color: #f92672">></span>
|
||||
<span style="color: #f92672"><div></span>
|
||||
<span style="color: #f92672"><h1</span> <span style="color: #a6e22e">id=</span><span style="color: #e6db74">"title"</span><span style="color: #f92672">></span>{{ .Title }}<span style="color: #f92672"></h1></span>
|
||||
{{ range .Data.Pages }}
|
||||
{{ .Render "summary"}}
|
||||
{{ end }}
|
||||
<span style="color: #f92672"></div></span>
|
||||
<span style="color: #f92672"></section></span>
|
||||
```
|
||||
{{% /output %}}
|
||||
|
||||
{{% note "More on Syntax Highlighting" %}}
|
||||
To see even more options for adding syntax-highlighted code blocks to your website, see [Syntax Highlighting in Developer Tools](/tools/syntax-highlighting/).
|
||||
{{% /note %}}
|
||||
|
||||
### `instagram`
|
||||
|
||||
If you'd like to embed a photo from [Instagram][], you only need the photo's ID. You can discern an Instagram photo ID from the URL:
|
||||
|
||||
```html
|
||||
https://www.instagram.com/p/BWNjjyYFxVx/
|
||||
```
|
||||
|
||||
#### Example `instagram` Input
|
||||
|
||||
{{% code file="instagram-input.md" %}}
|
||||
```md
|
||||
{{</* instagram BWNjjyYFxVx */>}}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
You also have the option to hide the caption:
|
||||
|
||||
{{% code file="instagram-input-hide-caption.md" %}}
|
||||
```md
|
||||
{{</* instagram BWNjjyYFxVx hidecaption */>}}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
#### Example `instagram` Output
|
||||
|
||||
By adding the preceding `hidecaption` example, the following HTML will be added to your rendered website's markup:
|
||||
|
||||
{{% output file="instagram-hide-caption-output.html" %}}
|
||||
```html
|
||||
{{< instagram BWNjjyYFxVx hidecaption >}}
|
||||
```
|
||||
{{% /output %}}
|
||||
|
||||
#### Example `instagram` Display
|
||||
|
||||
Using the preceding `instagram` with hidecaption` example above, the following simulates the displayed experience for visitors to your website. Naturally, the final display will be contingent on your stylesheets and surrounding markup.
|
||||
|
||||
{{< instagram BWNjjyYFxVx hidecaption >}}
|
||||
|
||||
|
||||
### `ref` and `relref`
|
||||
|
||||
These shortcodes will look up the pages by their relative path (e.g., `blog/post.md`) or their logical name (`post.md`) and return the permalink (`ref`) or relative permalink (`relref`) for the found page.
|
||||
|
||||
`ref` and `relref` also make it possible to make fragmentary links that work for the header links generated by Hugo.
|
||||
|
||||
{{% note "More on Cross References" %}}
|
||||
Read a more extensive description of `ref` and `relref` in the [cross references](/content-management/cross-references/) documentation.
|
||||
{{% /note %}}
|
||||
|
||||
`ref` and `relref` take exactly one required parameter of _reference_, quoted and in position `0`.
|
||||
|
||||
#### Example `ref` and `relref` Input
|
||||
|
||||
```md
|
||||
[Neat]({{</* ref "blog/neat.md" */>}})
|
||||
[Who]({{</* relref "about.md#who" */>}})
|
||||
```
|
||||
|
||||
#### Example `ref` and `relref` Output
|
||||
|
||||
Assuming that standard Hugo pretty URLs are turned on.
|
||||
|
||||
```html
|
||||
<a href="/blog/neat">Neat</a>
|
||||
<a href="/about/#who:c28654c202e73453784cfd2c5ab356c0">Who</a>
|
||||
```
|
||||
|
||||
### `speakerdeck`
|
||||
|
||||
To embed slides from [Speaker Deck][], click on "< /> Embed" (under Share right next to the template on Speaker Deck) and copy the URL:
|
||||
|
||||
```html
|
||||
<script async class="speakerdeck-embed" data-id="4e8126e72d853c0060001f97" data-ratio="1.33333333333333" src="//speakerdeck.com/assets/embed.js"></script>
|
||||
```
|
||||
|
||||
#### `speakerdeck` Example Input
|
||||
|
||||
Extract the value from the field `data-id` and pass it to the shortcode:
|
||||
|
||||
{{% code file="speakerdeck-example-input.md" %}}
|
||||
```md
|
||||
{{</* speakerdeck 4e8126e72d853c0060001f97 */>}}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
#### `speakerdeck` Example Output
|
||||
|
||||
{{% output file="speakerdeck-example-input.md" %}}
|
||||
```html
|
||||
{{< speakerdeck 4e8126e72d853c0060001f97 >}}
|
||||
```
|
||||
{{% /output %}}
|
||||
|
||||
#### `speakerdeck` Example Display
|
||||
|
||||
For the preceding `speakerdeck` example, the following simulates the displayed experience for visitors to your website. Naturally, the final display will be contingent on your stylesheets and surrounding markup.
|
||||
|
||||
{{< speakerdeck 4e8126e72d853c0060001f97 >}}
|
||||
|
||||
### `tweet`
|
||||
|
||||
You want to include a single tweet into your blog post? Everything you need is the URL of the tweet:
|
||||
|
||||
```
|
||||
https://twitter.com/spf13/status/877500564405444608
|
||||
```
|
||||
|
||||
#### Example `tweet` Input
|
||||
|
||||
Pass the tweet's ID from the URL as a parameter to the `tweet` shortcode:
|
||||
|
||||
{{% code file="example-tweet-input.md" %}}
|
||||
```md
|
||||
{{</* tweet 877500564405444608 */>}}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
#### Example `tweet` Output
|
||||
|
||||
Using the preceding `tweet` example, the following HTML will be added to your rendered website's markup:
|
||||
|
||||
{{% output file="example-tweet-output.html" %}}
|
||||
```html
|
||||
{{< tweet 877500564405444608 >}}
|
||||
```
|
||||
{{% /output %}}
|
||||
|
||||
#### Example `tweet` Display
|
||||
|
||||
Using the preceding `tweet` example, the following simulates the displayed experience for visitors to your website. Naturally, the final display will be contingent on your stylesheets and surrounding markup.
|
||||
|
||||
{{< tweet 877500564405444608 >}}
|
||||
|
||||
### `vimeo`
|
||||
|
||||
Adding a video from [Vimeo][] is equivalent to the YouTube shortcode above.
|
||||
|
||||
```
|
||||
https://vimeo.com/channels/staffpicks/146022717
|
||||
```
|
||||
|
||||
#### Example `vimeo` Input
|
||||
|
||||
Extract the ID from the video's URL and pass it to the `vimeo` shortcode:
|
||||
|
||||
{{% code file="example-vimeo-input.md" %}}
|
||||
```md
|
||||
{{</* vimeo 146022717 */>}}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
#### Example `vimeo` Output
|
||||
|
||||
Using the preceding `vimeo` example, the following HTML will be added to your rendered website's markup:
|
||||
|
||||
{{% output file="example-vimeo-output.html" %}}
|
||||
```html
|
||||
{{< vimeo 146022717 >}}
|
||||
```
|
||||
{{% /output %}}
|
||||
|
||||
{{% tip %}}
|
||||
If you want to further customize the visual styling of the YouTube or Vimeo output, add a `class` named parameter when calling the shortcode. The new `class` will be added to the `<div>` that wraps the `<iframe>` *and* will remove the inline styles. Note that you will need to call the `id` as a named parameter as well.
|
||||
|
||||
```md
|
||||
{{</* vimeo id="146022717" class="my-vimeo-wrapper-class" */>}}
|
||||
```
|
||||
{{% /tip %}}
|
||||
|
||||
#### Example `vimeo` Display
|
||||
|
||||
Using the preceding `vimeo` example, the following simulates the displayed experience for visitors to your website. Naturally, the final display will be contingent on your stylesheets and surrounding markup.
|
||||
|
||||
{{< vimeo 146022717 >}}
|
||||
|
||||
### `youtube`
|
||||
|
||||
The `youtube` shortcode embeds a responsive video player for [YouTube videos][]. Only the ID of the video is required, e.g.:
|
||||
|
||||
```
|
||||
https://www.youtube.com/watch?v=w7Ft2ymGmfc
|
||||
```
|
||||
|
||||
|
||||
#### Example `youtube` Input
|
||||
|
||||
Copy the YouTube video ID that follows `v=` in the video's URL and pass it to the `youtube` shortcode:
|
||||
|
||||
{{% code file="example-youtube-input.md" %}}
|
||||
```md
|
||||
{{</* youtube w7Ft2ymGmfc */>}}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
Furthermore, you can automatically start playback of the embedded video by setting the `autoplay` parameter to `true`. Remember that you can't mix named an unnamed parameters, so you'll need to assign the yet unnamed video id to the parameter `id`:
|
||||
|
||||
|
||||
{{% code file="example-youtube-input-with-autoplay.md" %}}
|
||||
```md
|
||||
{{</* youtube id="w7Ft2ymGmfc" autoplay="true" */>}}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
#### Example `youtube` Output
|
||||
|
||||
Using the preceding `youtube` example, the following HTML will be added to your rendered website's markup:
|
||||
|
||||
{{% code file="example-youtube-output.html" %}}
|
||||
```html
|
||||
{{< youtube id="w7Ft2ymGmfc" autoplay="true" >}}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
#### Example `youtube` Display
|
||||
|
||||
Using the preceding `youtube` example (without `autoplay="true"`), the following simulates the displayed experience for visitors to your website. Naturally, the final display will be contingent on your stylesheets and surrounding markup. The video is also include in the [Quick Start of the Hugo documentation][quickstart].
|
||||
|
||||
{{< youtube w7Ft2ymGmfc >}}
|
||||
|
||||
## Create Custom Shortcodes
|
||||
|
||||
To learn more about creating custom shortcodes, see the [shortcode template documentation][].
|
||||
|
||||
[`figure` shortcode]: #figure
|
||||
[contentmanagementsection]: /content-management/formats/
|
||||
[examplegist]: https://gist.github.com/spf13/7896402
|
||||
[figureelement]: http://html5doctor.com/the-figure-figcaption-elements/ "An article from HTML5 doctor discussing the fig and figcaption elements."
|
||||
[Instagram]: https://www.instagram.com/
|
||||
[pagevariables]: /variables/page/
|
||||
[partials]: /templates/partials/
|
||||
[Pygments]: http://pygments.org/
|
||||
[quickstart]: /getting-started/quick-start/
|
||||
[sctemps]: /templates/shortcode-templates/
|
||||
[scvars]: /variables/shortcodes/
|
||||
[shortcode template documentation]: /templates/shortcode-templates/
|
||||
[Speaker Deck]: https://speakerdeck.com/
|
||||
[templatessection]: /templates/
|
||||
[Vimeo]: https://vimeo.com/
|
||||
[YouTube Videos]: https://www.youtube.com/
|
||||
@@ -0,0 +1,83 @@
|
||||
---
|
||||
title: Content Summaries
|
||||
linktitle: Summaries
|
||||
description: Hugo generates summaries of your content.
|
||||
date: 2017-01-10
|
||||
publishdate: 2017-01-10
|
||||
lastmod: 2017-01-10
|
||||
categories: [content management]
|
||||
#tags: [summaries,abstracts,read more]
|
||||
menu:
|
||||
docs:
|
||||
parent: "content-management"
|
||||
weight: 90
|
||||
weight: 90 #rem
|
||||
draft: false
|
||||
aliases: [/content/summaries/,/content-management/content-summaries/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
With the use of the `.Summary` [page variable][pagevariables], Hugo generates summaries of content to use as a short version in summary views.
|
||||
|
||||
## Summary Splitting Options
|
||||
|
||||
* Hugo-defined Summary Split
|
||||
* User-defined Summary Split
|
||||
|
||||
It is natural to accompany the summary with links to the original content, and a common design pattern is to see this link in the form of a "Read More ..." button. See the `.RelPermalink`, `.Permalink`, and `.Truncated` [page variables][pagevariables].
|
||||
|
||||
### Hugo-defined: Automatic Summary Splitting
|
||||
|
||||
By default, Hugo automatically takes the first 70 words of your content as its summary and stores it into the `.Summary` page variable for use in your templates. Taking the Hugo-defined approach to summaries may save time, but it has pros and cons:
|
||||
|
||||
* **Pros:** Automatic, no additional work on your part.
|
||||
* **Cons:** All HTML tags are stripped from the summary, and the first 70 words, whether they belong to a heading or to different paragraphs, are all put into one paragraph.
|
||||
|
||||
{{% note %}}
|
||||
The Hugo-defined summaries are set to use word count calculated by splitting the text by one or more consecutive white space characters. If you are creating content in a `CJK` language and want to use Hugo's automatic summary splitting, set `hasCJKLanguage` to `true` in you [site configuration](/getting-started/configuration/).
|
||||
{{% /note %}}
|
||||
|
||||
### User-defined: Manual Summary Splitting
|
||||
|
||||
Alternatively, you may add the <code><!--more--></code> summary divider where you want to split the article. For [org content][org], use `# more` where you want to split the article. Content that comes before the summary divider will be used as that content's summary and stored in the `.Summary` page variable with all HTML formatting intact.
|
||||
|
||||
{{% note "Summary Divider"%}}
|
||||
The concept of a *summary divider* is not unique to Hugo. It is also called the "more tag" or "excerpt separator" in other literature.
|
||||
{{% /note %}}
|
||||
|
||||
* Pros: Freedom, precision, and improved rendering. All HTML tags and formatting are preserved.
|
||||
* Cons: Extra work for content authors, since they need to remember to type <code><!--more--></code> (or `# more` for [org content][org]) in each content file. This can be automated by adding the summary divider below the front matter of an [archetype](/content-management/archetypes/).
|
||||
|
||||
{{% warning "Be Precise with the Summary Divider" %}}
|
||||
Be careful to enter <code><!--more--></code> exactly; i.e., all lowercase and with no whitespace.
|
||||
{{% /warning %}}
|
||||
|
||||
## Example: First 10 Articles with Summaries
|
||||
|
||||
You can show content summaries with the following code. You could use the following snippet, for example, in a [section template][].
|
||||
|
||||
{{% code file="page-list-with-summaries.html" %}}
|
||||
```html
|
||||
{{ range first 10 .Data.Pages }}
|
||||
<article>
|
||||
<!-- this <div> includes the title summary -->
|
||||
<div>
|
||||
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
|
||||
{{ .Summary }}
|
||||
</div>
|
||||
{{ if .Truncated }}
|
||||
<!-- This <div> includes a read more link, but only if the summary is truncated... -->
|
||||
<div>
|
||||
<a href="{{ .RelPermalink }}">Read More…</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
</article>
|
||||
{{ end }}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
Note how the `.Truncated` boolean valuable may be used to hide the "Read More..." link when the content is not truncated; i.e., when the summary contains the entire article.
|
||||
|
||||
[org]: /content-management/formats/
|
||||
[pagevariables]: /variables/page/
|
||||
[section template]: /templates/section-templates/
|
||||
@@ -0,0 +1,238 @@
|
||||
---
|
||||
title: Taxonomies
|
||||
linktitle:
|
||||
description: Hugo includes support for user-defined taxonomies to help you demonstrate logical relationships between content for the end users of your website.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
#tags: [taxonomies,metadata,front matter,terms]
|
||||
categories: [content management]
|
||||
menu:
|
||||
docs:
|
||||
parent: "content-management"
|
||||
weight: 80
|
||||
weight: 80 #rem
|
||||
draft: false
|
||||
aliases: [/taxonomies/overview/,/taxonomies/usage/,/indexes/overview/,/doc/indexes/,/extras/indexes]
|
||||
toc: true
|
||||
---
|
||||
|
||||
## What is a Taxonomy?
|
||||
|
||||
Hugo includes support for user-defined groupings of content called **taxonomies**. Taxonomies are classifications of logical relationships between content.
|
||||
|
||||
### Definitions
|
||||
|
||||
Taxonomy
|
||||
: a categorization that can be used to classify content
|
||||
|
||||
Term
|
||||
: a key within the taxonomy
|
||||
|
||||
Value
|
||||
: a piece of content assigned to a term
|
||||
|
||||
## Example Taxonomy: Movie Website
|
||||
|
||||
Let's assume you are making a website about movies. You may want to include the following taxonomies:
|
||||
|
||||
* Actors
|
||||
* Directors
|
||||
* Studios
|
||||
* Genre
|
||||
* Year
|
||||
* Awards
|
||||
|
||||
Then, in each of the movies, you would specify terms for each of these taxonomies (i.e., in the [front matter][] of each of your movie content files). From these terms, Hugo would automatically create pages for each Actor, Director, Studio, Genre, Year, and Award, with each listing all of the Movies that matched that specific Actor, Director, Studio, Genre, Year, and Award.
|
||||
|
||||
### Movie Taxonomy Organization
|
||||
|
||||
To continue with the example of a movie site, the following demonstrates content relationships from the perspective of the taxonomy:
|
||||
|
||||
```
|
||||
Actor <- Taxonomy
|
||||
Bruce Willis <- Term
|
||||
The Six Sense <- Content
|
||||
Unbreakable <- Content
|
||||
Moonrise Kingdom <- Content
|
||||
Samuel L. Jackson <- Term
|
||||
Unbreakable <- Content
|
||||
The Avengers <- Content
|
||||
xXx <- Content
|
||||
```
|
||||
|
||||
From the perspective of the content, the relationships would appear differently, although the data and labels used are the same:
|
||||
|
||||
```
|
||||
Unbreakable <- Content
|
||||
Actors <- Taxonomy
|
||||
Bruce Willis <- Term
|
||||
Samuel L. Jackson <- Term
|
||||
Director <- Taxonomy
|
||||
M. Night Shyamalan <- Term
|
||||
...
|
||||
Moonrise Kingdom <- Content
|
||||
Actors <- Taxonomy
|
||||
Bruce Willis <- Term
|
||||
Bill Murray <- Term
|
||||
Director <- Taxonomy
|
||||
Wes Anderson <- Term
|
||||
...
|
||||
```
|
||||
|
||||
## Hugo Taxonomy Defaults
|
||||
|
||||
Hugo natively supports taxonomies.
|
||||
|
||||
Without adding a single line to your site's configuration file, Hugo will automatically create taxonomies for `tags` and `categories`. If you do not want Hugo to create any taxonomies, set `disableKinds` in your site's configuration to the following:
|
||||
|
||||
```toml
|
||||
disableKinds = ["taxonomy","taxonomyTerm"]
|
||||
```
|
||||
|
||||
### Default Destinations
|
||||
|
||||
When taxonomies are used---and [taxonomy templates][] are provided---Hugo will automatically create both a page listing all the taxonomy's terms and individual pages with lists of content associated with each term. For example, a `categories` taxonomy declared in your your configuration and used in your content front matter will create the following pages:
|
||||
|
||||
* A single page at `yoursite.com/categories/` that lists all the [terms within the taxonomy][]
|
||||
* [Individual taxonomy list pages][taxonomy templates] (e.g., `/categories/development/`) for each of the terms that shows a listing of all pages marked as part of that taxonomy within any content file's [front matter][]
|
||||
|
||||
## Configure Taxonomies
|
||||
|
||||
Taxonomies must be defined in your [website configuration][config] before they can be used throughout the site. You need to provide both the plural and singular labels for each taxonomy. For example, `singular key = "plural value"` for TOML and `singular key: "plural value"` for YAML.
|
||||
|
||||
### Example: TOML Taxonomy Configuration
|
||||
|
||||
```toml
|
||||
[taxonomies]
|
||||
tag = "tags"
|
||||
category = "categories"
|
||||
series = "series"
|
||||
```
|
||||
|
||||
### Example: YAML Taxonomy Configuration
|
||||
|
||||
```yaml
|
||||
taxonomies:
|
||||
tag: "tags"
|
||||
category: "categories"
|
||||
series: "series"
|
||||
```
|
||||
|
||||
### Preserve Taxonomy Values
|
||||
|
||||
By default, taxonomy names are normalized.
|
||||
|
||||
Therefore, if you want to have a taxonomy term with special characters such as `Gérard Depardieu` instead of `Gerard Depardieu`, set the value for `preserveTaxonomyNames` to `true` in your [site configuration][config]. Hugo will then preserve special characters in taxonomy values but will still title-ize the values for titles and normalize them in URLs.
|
||||
|
||||
Note that if you use `preserveTaxonomyNames` and intend to manually construct URLs to the archive pages, you will need to pass the taxonomy values through the [`urlize` template function][].
|
||||
|
||||
{{% note %}}
|
||||
You can add content and front matter to your taxonomy list and taxonomy terms pages. See [Content Organization](/content-management/organization/) for more information on how to add an `_index.md` for this purpose.
|
||||
|
||||
Note also that taxonomy [permalinks](/content-management/urls/) are *not* configurable.
|
||||
{{% /note %}}
|
||||
|
||||
## Add Taxonomies to Content
|
||||
|
||||
Once a taxonomy is defined at the site level, any piece of content can be assigned to it, regardless of [content type][] or [content section][].
|
||||
|
||||
Assigning content to a taxonomy is done in the [front matter][]. Simply create a variable with the *plural* name of the taxonomy and assign all terms you want to apply to the instance of the content type.
|
||||
|
||||
{{% note %}}
|
||||
If you would like the ability to quickly generate content files with preconfigured taxonomies or terms, read the docs on [Hugo archetypes](/content-management/archetypes/).
|
||||
{{% /note %}}
|
||||
|
||||
### Example: TOML Front Matter with Taxonomies
|
||||
|
||||
```toml
|
||||
+++
|
||||
title = "Hugo: A fast and flexible static site generator"
|
||||
tags = [ "Development", "Go", "fast", "Blogging" ]
|
||||
categories = [ "Development" ]
|
||||
series = [ "Go Web Dev" ]
|
||||
slug = "hugo"
|
||||
project_url = "https://github.com/gohugoio/hugo"
|
||||
+++
|
||||
```
|
||||
|
||||
### Example: YAML Front Matter with Taxonomies
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: "Hugo: A fast and flexible static site generator"
|
||||
#tags: ["Development", "Go", "fast", "Blogging"]
|
||||
categories: ["Development"]
|
||||
categories: ["Go Web Dev"]
|
||||
slug: "hugo"
|
||||
project_url: "https://github.com/gohugoio/hugo"
|
||||
---
|
||||
```
|
||||
|
||||
### Example: JSON Front Matter with Taxonomies
|
||||
|
||||
```json
|
||||
{
|
||||
"title": "Hugo: A fast and flexible static site generator",
|
||||
"tags": [
|
||||
"Development",
|
||||
"Go",
|
||||
"fast",
|
||||
"Blogging"
|
||||
],
|
||||
"categories" : [
|
||||
"Development"
|
||||
],
|
||||
"series" : [
|
||||
"Go Web Dev"
|
||||
],
|
||||
"slug": "hugo",
|
||||
"project_url": "https://github.com/gohugoio/hugo"
|
||||
}
|
||||
```
|
||||
|
||||
## Order Taxonomies
|
||||
|
||||
A content file can assign weight for each of its associate taxonomies. Taxonomic weight can be used for sorting or ordering content in [taxonomy list templates][] and is declared in a content file's [front matter][]. The convention for declaring taxonomic weight is `taxonomyname_weight`.
|
||||
|
||||
The following TOML and YAML examples show a piece of content that has a weight of 22, which can be used for ordering purposes when rendering the pages assigned to the "a", "b" and "c" values of the `tags` taxonomy. It has also been assigned the weight of 44 when rendering the "d" category page.
|
||||
|
||||
### Example: TOML Taxonomic `weight`
|
||||
|
||||
```toml
|
||||
+++
|
||||
title = "foo"
|
||||
tags = [ "a", "b", "c" ]
|
||||
tags_weight = 22
|
||||
categories = ["d"]
|
||||
categories_weight = 44
|
||||
+++
|
||||
```
|
||||
|
||||
### Example: YAML Taxonomic `weight`
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: foo
|
||||
#tags: [ "a", "b", "c" ]
|
||||
tags_weight: 22
|
||||
categories: ["d"]
|
||||
categories_weight: 44
|
||||
---
|
||||
```
|
||||
|
||||
By using taxonomic weight, the same piece of content can appear in different positions in different taxonomies.
|
||||
|
||||
{{% note "Limits to Ordering Taxonomies" %}}
|
||||
Currently taxonomies only support the [default `weight => date` ordering of list content](/templates/lists/#default-weight-date). For more information, see the documentation on [taxonomy templates](/templates/taxonomy-templates/).
|
||||
{{% /note %}}
|
||||
|
||||
[`urlize` template function]: /functions/urlize/
|
||||
[content section]: /content-management/sections/
|
||||
[content type]: /content-management/types/
|
||||
[documentation on archetypes]: /content-management/archetypes/
|
||||
[front matter]: /content-management/front-matter/
|
||||
[taxonomy list templates]: /templates/taxonomy-templates/#taxonomy-page-templates
|
||||
[taxonomy templates]: /templates/taxonomy-templates/
|
||||
[terms within the taxonomy]: /templates/taxonomy-templates/#taxonomy-terms-templates "See how to order terms associated with a taxonomy"
|
||||
[config]: /getting-started/configuration/
|
||||
@@ -0,0 +1,95 @@
|
||||
---
|
||||
title: Table of Contents
|
||||
linktitle:
|
||||
description: Hugo can automatically parse Markdown content and create a Table of Contents you can use in your templates.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [content management]
|
||||
#tags: [table of contents, toc]
|
||||
menu:
|
||||
docs:
|
||||
parent: "content-management"
|
||||
weight: 130
|
||||
weight: 130 #rem
|
||||
draft: false
|
||||
aliases: [/extras/toc/,/content-management/toc/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
{{% note "TOC Heading Levels are Fixed" %}}
|
||||
Currently, the `{{.TableOfContents}}` [page variable](/variables/page/) does not allow you to specify which heading levels you want the TOC to render. [See the related GitHub discussion (#1778)](https://github.com/gohugoio/hugo/issues/1778). As such, the resulting `<nav id="TableOfContents"><ul></ul></nav>` is going to start at `<h1>` when pulling from `{{.Content}}`.
|
||||
{{% /note %}}
|
||||
|
||||
## Usage
|
||||
|
||||
Create your markdown the way you normally would with the appropriate headings. Here is some example content:
|
||||
|
||||
```md
|
||||
<!-- Your front matter up here -->
|
||||
|
||||
## Introduction
|
||||
|
||||
One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin.
|
||||
|
||||
## My Heading
|
||||
|
||||
He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections. The bedding was hardly able to cover it and seemed ready to slide off any moment.
|
||||
|
||||
### My Subheading
|
||||
|
||||
A collection of textile samples lay spread out on the table - Samsa was a travelling salesman - and above it there hung a picture that he had recently cut out of an illustrated magazine and housed in a nice, gilded frame. It showed a lady fitted out with a fur hat and fur boa who sat upright, raising a heavy fur muff that covered the whole of her lower arm towards the viewer. Gregor then turned to look out the window at the dull weather. Drops
|
||||
```
|
||||
|
||||
Hugo will take this Markdown and create a table of contents from `## Introduction`, `## My Heading`, and `### My Subheading` and then store it in the [page variable][pagevars]`.TableOfContents`.
|
||||
|
||||
The built-in `.TableOfContents` variables outputs a `<nav id="TableOfContents">` element with a child `<ul>`, whose child `<li>` elements begin with any `<h1>`'s (i.e., `#` in markdown) inside your content.'
|
||||
|
||||
## Template Example: Basic TOC
|
||||
|
||||
The following is an example of a very basic [single page template][]:
|
||||
|
||||
{{% code file="layout/_default/single.html" download="single.html" %}}
|
||||
```html
|
||||
{{ define "main" }}
|
||||
<main>
|
||||
<article>
|
||||
<header>
|
||||
<h1>{{ .Title }}</h1>
|
||||
</header>
|
||||
{{ .Content }}
|
||||
</article>
|
||||
<aside>
|
||||
{{ .TableOfContents }}
|
||||
</aside>
|
||||
</main>
|
||||
{{ end }}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
## Template Example: TOC Partial
|
||||
|
||||
The following is a [partial template][partials] that adds slightly more logic for page-level control over your table of contents. It assumes you are using a `toc` field in your content's [front matter][] that, unless specifically set to `false`, will add a TOC to any page with a `.WordCount` (see [Page Variables][pagevars]) greater than 400. This example also demonstrates how to use [conditionals][] in your templating:
|
||||
|
||||
{{% code file="layouts/partials/toc.html" download="toc.html" %}}
|
||||
```html
|
||||
{{ if and (gt .WordCount 400 ) (ne .Params.toc "false") }}
|
||||
<aside>
|
||||
<header>
|
||||
<h2>{{.Title}}</h2>
|
||||
</header>
|
||||
{{.TableOfContents}}
|
||||
</aside>
|
||||
{{ end }}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
{{% note %}}
|
||||
With the preceding example, even pages with > 400 words *and* `toc` not set to `false` will not render a table of contents if there are no headings in the page for the `{{.TableOfContents}}` variable to pull from.
|
||||
{{% /note %}}
|
||||
|
||||
[conditionals]: /templates/introduction/#conditionals
|
||||
[front matter]: /content-management/table-of-contents/
|
||||
[pagevars]: /variables/page/
|
||||
[partials]: /templates/partials/
|
||||
[single page template]: /templates/single-page-templates/
|
||||
@@ -0,0 +1,101 @@
|
||||
---
|
||||
title: Content Types
|
||||
linktitle: Types
|
||||
description: Hugo supports sites with multiple content types and assumes your site will be organized into sections, where each section represents the corresponding type.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [content management]
|
||||
#tags: [lists,sections,content types,types,organization]
|
||||
menu:
|
||||
docs:
|
||||
parent: "content-management"
|
||||
weight: 60
|
||||
weight: 60 #rem
|
||||
draft: false
|
||||
aliases: [/content/types]
|
||||
toc: true
|
||||
---
|
||||
|
||||
A **content type** can have a unique set of metadata (i.e., [front matter][]) or customized [template][] and can be created by the `hugo new` command via [archetypes][].
|
||||
|
||||
## What is a Content Type
|
||||
|
||||
[Tumblr][] is a good example of a website with multiple content types. A piece of "content" could be a photo, quote, or a post, each with different sets of metadata and different visual rendering.
|
||||
|
||||
## Assign a Content Type
|
||||
|
||||
Hugo assumes that your site will be organized into [sections][] and each section represents a corresponding type. This is to reduce the amount of configuration necessary for new Hugo projects.
|
||||
|
||||
If you are taking advantage of this default behavior, each new piece of content you place into a section will automatically inherit the type. Therefore a new file created at `content/posts/new-post.md` will automatically be assigned the type `posts`. Alternatively, you can set the content type in a content file's [front matter][] in the field "`type`".
|
||||
|
||||
## Create New Content of a Specific Type
|
||||
|
||||
You can manually add files to your content directories, but Hugo can create and populate a new content file with preconfigured front matter via [archetypes][].
|
||||
|
||||
## Define a Content Type
|
||||
|
||||
Creating a new content type is easy. You simply define the templates and archetype unique to your new content type, or Hugo will use defaults.
|
||||
|
||||
|
||||
{{% note "Declaring Content Types" %}}
|
||||
Remember, all of the following are *optional*. If you do not specifically declare content types in your front matter or develop specific layouts for content types, Hugo is smart enough to assume the content type from the file path and section. (See [Content Sections](/content-management/sections/) for more information.)
|
||||
{{% /note %}}
|
||||
|
||||
The following examples take you stepwise through creating a new type layout for a content file that contains the following front matter:
|
||||
|
||||
{{% code file="content/events/my-first-event.md" copy="false" %}}
|
||||
```toml
|
||||
+++
|
||||
title = My First Event
|
||||
date = "2016-06-24T19:20:04-07:00"
|
||||
description = "Today is my 36th birthday. How time flies."
|
||||
type = "event"
|
||||
layout = "birthday"
|
||||
+++
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
By default, Hugo assumes `*.md` under `events` is of the `events` content type. However, we have specified that this particular file at `content/events/ my-first-event.md` is of type `event` and should render using the `birthday` layout.
|
||||
|
||||
### Create a Type Layout Directory
|
||||
|
||||
Create a directory with the name of the type in `/layouts`. For creating these custom layouts, **type is always singular**; e.g., `events => event` and `posts => post`.
|
||||
|
||||
For this example, you need to create `layouts/event/birthday.html`.
|
||||
|
||||
{{% note %}}
|
||||
If you have multiple content files in your `events` directory that are of the `special` type and you don't want to define the `layout` specifically for each piece of content, you can create a layout at `layouts/special/single.html` to observe the [single page template lookup order](/templates/single-page-templates/).
|
||||
{{% /note %}}
|
||||
|
||||
{{% warning %}}
|
||||
With the "everything is a page" data model introduced in v0.18 (see [Content Organization](/content-management/organization/)), you can use `_index.md` in content directories to add both content and front matter to [list pages](/templates/lists/). However, `type` and `layout` declared in the front matter of `_index.md` are *not* currently respected at build time as of v0.19. This is a known issue [(#3005)](https://github.com/gohugoio/hugo/issues/3005).
|
||||
{{% /warning %}}
|
||||
|
||||
### Create Views
|
||||
|
||||
Many sites support rendering content in a few different ways; e.g., a single page view and a summary view to be used when displaying a [list of section contents][sectiontemplates].
|
||||
|
||||
Hugo limits assumptions about how you want to display your content to an intuitive set of sane defaults and will support as many different views of a content type as your site requires. All that is required for these additional views is that a template exists in each `/layouts/<TYPE>` directory with the same name.
|
||||
|
||||
### Custom Content Type Template Lookup Order
|
||||
|
||||
The lookup order for the `content/events/my-first-event.md` templates would be as follows:
|
||||
|
||||
* `layouts/event/birthday.html`
|
||||
* `layouts/event/single.html`
|
||||
* `layouts/events/single.html`
|
||||
* `layouts/_default/single.html`
|
||||
|
||||
### Create a Corresponding Archetype
|
||||
|
||||
We can then create a custom archetype with preconfigured front matter at `event.md` in the `/archetypes` directory; i.e. `archetypes/event.md`.
|
||||
|
||||
Read [Archetypes][archetypes] for more information on archetype usage with `hugo new`.
|
||||
|
||||
[archetypes]: /content-management/archetypes/
|
||||
[front matter]: /content-management/front-matter/
|
||||
[sectiontemplates]: /templates/section-templates/
|
||||
[sections]: /content-management/sections/
|
||||
[template]: /templates/
|
||||
[Tumblr]: https://www.tumblr.com/
|
||||
@@ -0,0 +1,285 @@
|
||||
---
|
||||
title: URL Management
|
||||
linktitle: URL Management
|
||||
description: Hugo supports permalinks, aliases, link canonicalization, and multiple options for handling relative vs absolute URLs.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-03-09
|
||||
#tags: [aliases,redirects,permalinks,urls]
|
||||
categories: [content management]
|
||||
menu:
|
||||
docs:
|
||||
parent: "content-management"
|
||||
weight: 110
|
||||
weight: 110 #rem
|
||||
draft: false
|
||||
aliases: [/extras/permalinks/,/extras/aliases/,/extras/urls/,/doc/redirects/,/doc/alias/,/doc/aliases/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
## Permalinks
|
||||
|
||||
The default Hugo target directory for your built website is `public/`. However, you can change this value by specifying a different `publishDir` in your [site configuration][config]. The directories created at build time for a section reflect the position of the content's directory within the `content` folder and namespace matching its layout within the `contentdir` hierarchy.
|
||||
|
||||
The `permalinks` option in your [site configuration][config] allows you to adjust the directory paths (i.e., the URLs) on a per-section basis. This will change where the files are written to and will change the page's internal "canonical" location, such that template references to `.RelPermalink` will honor the adjustments made as a result of the mappings in this option.
|
||||
|
||||
{{% note "Default Publish and Content Folders" %}}
|
||||
These examples use the default values for `publishDir` and `contentDir`; i.e., `publish` and `content`, respectively. You can override the default values in your [site's `config` file](/getting-started/configuration/).
|
||||
{{% /note %}}
|
||||
|
||||
For example, if one of your [sections][] is called `post` and you want to adjust the canonical path to be hierarchical based on the year, month, and post title, you could set up the following configurations in YAML and TOML, respectively.
|
||||
|
||||
### YAML Permalinks Configuration Example
|
||||
|
||||
{{% code file="config.yml" copy="false" %}}
|
||||
```yaml
|
||||
permalinks:
|
||||
post: /:year/:month/:title/
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
### TOML Permalinks Configuration Example
|
||||
|
||||
{{% code file="config.toml" copy="false" %}}
|
||||
```toml
|
||||
[permalinks]
|
||||
post = "/:year/:month/:title/"
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
Only the content under `post/` will have the new URL structure. For example, the file `content/post/sample-entry.md` with `date: 2017-02-27T19:20:00-05:00` in its front matter will render to `public/2017/02/sample-entry/index.html` at build time and therefore be reachable at `http://yoursite.com/2013/11/sample-entry/`.
|
||||
|
||||
### Permalink Configuration Values
|
||||
|
||||
The following is a list of values that can be used in a `permalink` definition in your site `config` file. All references to time are dependent on the content's date.
|
||||
|
||||
`:year`
|
||||
: the 4-digit year
|
||||
|
||||
`:month`
|
||||
: the 2-digit month
|
||||
|
||||
`:monthname`
|
||||
: the name of the month
|
||||
|
||||
`:day`
|
||||
: the 2-digit day
|
||||
|
||||
`:weekday`
|
||||
: the 1-digit day of the week (Sunday = 0)
|
||||
|
||||
`:weekdayname`
|
||||
: the name of the day of the week
|
||||
|
||||
`:yearday`
|
||||
: the 1- to 3-digit day of the year
|
||||
|
||||
`:section`
|
||||
: the content's section
|
||||
|
||||
`:title`
|
||||
: the content's title
|
||||
|
||||
`:slug`
|
||||
: the content's slug (or title if no slug is provided in the front matter)
|
||||
|
||||
`:filename`
|
||||
: the content's filename (without extension)
|
||||
|
||||
## Aliases
|
||||
|
||||
For people migrating existing published content to Hugo, there's a good chance you need a mechanism to handle redirecting old URLs.
|
||||
|
||||
Luckily, redirects can be handled easily with **aliases** in Hugo.
|
||||
|
||||
### Example: Aliases
|
||||
|
||||
Let's assume you create a new piece of content at `content/posts/my-awesome-blog-post.md`. The content is a revision of your previous post at `content/posts/my-original-url.md`. You can create an `aliases` field in the front matter of your new `my-awesome-blog-post.md` where you can add previous paths. The following examples show how to create this filed in TOML and YAML front matter, respectively.
|
||||
|
||||
#### TOML Front Matter
|
||||
|
||||
{{% code file="content/posts/my-awesome-post.md" copy="false" %}}
|
||||
```toml
|
||||
+++
|
||||
aliases = [
|
||||
"/posts/my-original-url/",
|
||||
"/2010/01/01/even-earlier-url.html"
|
||||
]
|
||||
+++
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
#### YAML Front Matter
|
||||
|
||||
{{% code file="content/posts/my-awesome-post.md" copy="false" %}}
|
||||
```yaml
|
||||
---
|
||||
aliases:
|
||||
- /posts/my-original-url/
|
||||
- /2010/01/01/even-earlier-url.html
|
||||
---
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
Now when you visit any of the locations specified in aliases---i.e., *assuming the same site domain*---you'll be redirected to the page they are specified on. For example, a visitor to `yoursite.com/posts/my-original-url/` will be immediately redirected to `yoursite.com/posts/my-awesome-blog-post/`.
|
||||
|
||||
### Example: Aliases in Multilingual
|
||||
|
||||
On [multilingual sites][multilingual], each translation of a post can have unique aliases. To use the same alias across multiple languages, prefix it with the language code.
|
||||
|
||||
In `/posts/my-new-post.es.md`:
|
||||
|
||||
```yaml
|
||||
---
|
||||
aliases:
|
||||
- /es/posts/my-original-post/
|
||||
---
|
||||
```
|
||||
|
||||
### How Hugo Aliases Work
|
||||
|
||||
When aliases are specified, Hugo creates a directory to match the alias entry. Inside the directory, Hugo creates an `.html` file specifying the canonical URL for the page and the new redirect target.
|
||||
|
||||
For example, a content file at `posts/my-intended-url.md` with the following in the front matter:
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: My New post
|
||||
aliases: [/posts/my-old-url/]
|
||||
---
|
||||
```
|
||||
|
||||
Assuming a `baseURL` of `yoursite.com`, the contents of the auto-generated alias `.html` found at `https://yoursite.com/posts/my-old-url/ will contain the following:`
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>http://yoursite.com/posts/my-intended-url</title>
|
||||
<link rel="canonical" href="http://yoursite.com/posts/my-intended-url"/>
|
||||
<meta name=\"robots\" content=\"noindex\">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
|
||||
<meta http-equiv="refresh" content="0; url=http://yoursite.com/posts/my-intended-url"/>
|
||||
</head>
|
||||
</html>
|
||||
```
|
||||
|
||||
The `http-equiv="refresh"` line is what performs the redirect, in 0 seconds in this case. If an end user of your website goes to `https://yoursite.com/posts/my-old-url`, they will now be automatically redirected to the newer, correct URL. The addition of `<meta name=\"robots\" content=\"noindex\">` lets search engine bots know they they should not crawl and index your new alias page.
|
||||
|
||||
### Customize
|
||||
You may customize this alias page by creating an `alias.html` template in the
|
||||
layouts folder of your site (i.e., `layouts/alias.html`). In this case, the data passed to the template is
|
||||
|
||||
`Permalink`
|
||||
: the link to the page being aliased
|
||||
|
||||
`Page`
|
||||
: the Page data for the page being aliased
|
||||
|
||||
### Important Behaviors of Aliases
|
||||
|
||||
1. Hugo makes no assumptions about aliases. They also do not change based
|
||||
on your UglyURLs setting. You need to provide absolute paths to your web root
|
||||
and the complete filename or directory.
|
||||
2. Aliases are rendered *before* any content are rendered and therefore will be overwritten by any content with the same location.
|
||||
|
||||
## Pretty URLs
|
||||
|
||||
Hugo's default behavior is to render your content with "pretty" URLs. No non-standard server-side configuration is required for these pretty URLs to work.
|
||||
|
||||
The following demonstrates the concept:
|
||||
|
||||
```bash
|
||||
content/posts/_index.md
|
||||
=> yoursite.com/posts/index.html
|
||||
content/posts/post-1.md
|
||||
=> yoursite.com/posts/post-1/
|
||||
```
|
||||
|
||||
## Ugly URLs
|
||||
|
||||
If you would like to have are often referred to as "ugly URLs" (e.g., yoursite.com/urls.html), set `uglyurls = true` or `uglyurls: true` in your site's `config.toml` or `config.yaml`, respectively. You can also use the `--uglyURLs=true` [flag from the command line][usage] with `hugo` or `hugo server`..
|
||||
|
||||
If you want a specific piece of content to have an exact URL, you can specify this in the [front matter][] under the `url` key. The following are examples of the same content directory and what the eventual URL structure will be when Hugo runs with its default behavior.
|
||||
|
||||
See [Content Organization][contentorg] for more details on paths.
|
||||
|
||||
```bash
|
||||
.
|
||||
└── content
|
||||
└── about
|
||||
| └── _index.md // <- http://yoursite.com/about/
|
||||
├── post
|
||||
| ├── firstpost.md // <- http://yoursite.com/post/firstpost/
|
||||
| ├── happy
|
||||
| | └── ness.md // <- http://yoursite.com/post/happy/ness/
|
||||
| └── secondpost.md // <- http://yoursite.com/post/secondpost/
|
||||
└── quote
|
||||
├── first.md // <- http://yoursite.com/quote/first/
|
||||
└── second.md // <- http://yoursite.com/quote/second/
|
||||
```
|
||||
|
||||
Here's the same organization run with `hugo --uglyURLs`:
|
||||
|
||||
```bash
|
||||
.
|
||||
└── content
|
||||
└── about
|
||||
| └── _index.md // <- http://yoursite.com/about/index.html
|
||||
├── post
|
||||
| ├── firstpost.md // <- http://yoursite.com/post/firstpost.html
|
||||
| ├── happy
|
||||
| | └── ness.md // <- http://yoursite.com/post/happy/ness.html
|
||||
| └── secondpost.md // <- http://yoursite.com/post/secondpost.html
|
||||
└── quote
|
||||
├── first.md // <- http://yoursite.com/quote/first.html
|
||||
└── second.md // <- http://yoursite.com/quote/second.html
|
||||
```
|
||||
|
||||
|
||||
## Canonicalization
|
||||
|
||||
By default, all relative URLs encountered in the input are left unmodified, e.g. `/css/foo.css` would stay as `/css/foo.css`. The `canonifyURLs` field in your site `config` has a default value of `false`.
|
||||
|
||||
By setting `canonifyURLs` to `true`, all relative URLs would instead be *canonicalized* using `baseURL`. For example, assuming you have `baseURL = https://yoursite.com/`, the relative URL `/css/foo.css` would be turned into the absolute URL `http://yoursite.com/css/foo.css`.
|
||||
|
||||
Benefits of canonicalization include fixing all URLs to be absolute, which may aid with some parsing tasks. Note, however, that all modern browsers handle this on the client without issue.
|
||||
|
||||
Benefits of non-canonicalization include being able to have scheme-relative resource inclusion; e.g., so that `http` vs `https` can be decided according to how the page was retrieved.
|
||||
|
||||
{{% note "`canonifyURLs` default change" %}}
|
||||
In the May 2014 release of Hugo v0.11, the default value of `canonifyURLs` was switched from `true` to `false`, which we think is the better default and should continue to be the case going forward. Please verify and adjust your website accordingly if you are upgrading from v0.10 or older versions.
|
||||
{{% /note %}}
|
||||
|
||||
To find out the current value of `canonifyURLs` for your website, you may use the handy `hugo config` command added in v0.13.
|
||||
|
||||
```bash
|
||||
hugo config | grep -i canon
|
||||
```
|
||||
|
||||
Or, if you are on Windows and do not have `grep` installed:
|
||||
|
||||
```
|
||||
hugo config | FINDSTR /I canon
|
||||
```
|
||||
|
||||
## Override URLS with Front Matter
|
||||
|
||||
In addition to specifying permalink values in your site configuration for different content sections, Hugo provides even more granular control for individual pieces of content.
|
||||
|
||||
Both `slug` and `url` can be defined in individual front matter. For more information on content destinations at build time, see [Content Organization][contentorg].
|
||||
|
||||
## Relative URLs
|
||||
|
||||
By default, all relative URLs are left unchanged by Hugo, which can be problematic when you want to make your site browsable from a local file system.
|
||||
|
||||
Setting `relativeURLs` to `true` in your [site configuration][config] will cause Hugo to rewrite all relative URLs to be relative to the current content.
|
||||
|
||||
For example, if your `/post/first/` page contains a link to `/about/`, Hugo will rewrite the URL to `../../about/`.
|
||||
|
||||
[config]: /getting-started/configuration/
|
||||
[contentorg]: /content-management/organization/
|
||||
[front matter]: /content-management/front-matter/
|
||||
[multilingual]: /content-management/multilingual/
|
||||
[sections]: /content-management/sections/
|
||||
[usage]: /getting-started/usage/
|
||||
@@ -1,330 +0,0 @@
|
||||
---
|
||||
lastmod: 2016-10-01
|
||||
date: 2014-05-14T02:13:50Z
|
||||
menu:
|
||||
main:
|
||||
parent: content
|
||||
next: /content/ordering
|
||||
prev: /content/types
|
||||
title: Archetypes
|
||||
weight: 50
|
||||
toc: true
|
||||
---
|
||||
|
||||
Typically, each piece of content you create within a Hugo project will have [front matter](/content/front-matter/) that follows a consistent structure. If you write blog posts, for instance, you might use the following front matter for the vast majority of those posts:
|
||||
|
||||
```toml
|
||||
+++
|
||||
title = ""
|
||||
date = ""
|
||||
slug = ""
|
||||
tags = [
|
||||
""
|
||||
]
|
||||
categories = [
|
||||
""
|
||||
]
|
||||
draft = true
|
||||
+++
|
||||
```
|
||||
|
||||
You can always add non-typical front matter to any piece of content, but since it takes extra work to develop a theme that handles unique metadata, consistency is simpler.
|
||||
|
||||
With this in mind, Hugo has a convenient feature known as *archetypes* that allows users to define default front matter for new pieces of content.
|
||||
|
||||
By using archetypes, we can:
|
||||
|
||||
1. **Save time**. Stop writing the same front matter over and over again.
|
||||
2. **Avoid errors**. Reduce the odds of typos, improperly formatted syntax, and other simple mistakes.
|
||||
3. **Focus on more important things**. Avoid having to remember all of the fields that need to be associated with each piece of content. (This is particularly important for larger projects with complex front matter and a variety of content types.)
|
||||
|
||||
Let's explore how they work.
|
||||
|
||||
## Built-in Archetypes
|
||||
|
||||
If you've been using Hugo for a while, there's a decent chance you've come across archetypes without even realizing it. This is because Hugo includes a basic, built-in archetype that is used by default whenever it generates a content file.
|
||||
|
||||
To see this in action, open the command line, navigate into your project's directory, and run the following command:
|
||||
|
||||
```bash
|
||||
hugo new hello-world.md
|
||||
```
|
||||
|
||||
This `hugo new` command creates a new content file inside the project's `content` directory — in this case, a file named `hello-world.md` — and if you open this file, you'll notice it contains the following front matter:
|
||||
|
||||
```toml
|
||||
+++
|
||||
date = "2017-05-31T15:18:11+10:00"
|
||||
draft = true
|
||||
title = "hello world"
|
||||
+++
|
||||
```
|
||||
|
||||
Here, we can see that three fields have been added to the document: a `title` field that is based on the file name we defined, a `draft` field that ensures this content won't be published by default, and a `date` field that is auto-populated with the current date and time in the [RFC 3339](https://stackoverflow.com/questions/522251/whats-the-difference-between-iso-8601-and-rfc-3339-date-formats) format.
|
||||
|
||||
This, in its most basic form, is an example of an archetype. To understand how useful they can be though, it's best if we create our own.
|
||||
|
||||
## Creating Archetypes
|
||||
|
||||
In this section, we're going to create an archetype that will override the built-in archetype, allowing us to define custom front matter that will be included in any content files that we generate with the `hugo new` command.
|
||||
|
||||
To achieve this, create a file named `default.md` inside the `archetypes` folder of a Hugo project. (If the folder doesn't exist, create it.)
|
||||
|
||||
Then, inside this file, define the following front matter:
|
||||
|
||||
```toml
|
||||
+++
|
||||
slug = ""
|
||||
tags = []
|
||||
categories = []
|
||||
draft = true
|
||||
+++
|
||||
```
|
||||
|
||||
You'll notice that we haven't defined a `title` or `date` field. This is because Hugo will automatically add these fields to the beginning of the front matter. We do, however, need to define the `draft` field if we want it to exist in our front matter.
|
||||
|
||||
You'll also notice that we're writing the front matter in the TOML format. It's possible to define archetype front matter in other formats, but a setting needs to be changed in the configuration file for this to be possible. See the "[Archetype Formats](#archetype-formats)" section of this article for more details.
|
||||
|
||||
Next, run the following command:
|
||||
|
||||
```bash
|
||||
hugo new my-archetype-example.md
|
||||
```
|
||||
|
||||
This command will generate a file named `my-archetype-example.md` inside the `content` directory, and this file will contain the following output:
|
||||
|
||||
```toml
|
||||
+++
|
||||
categories = []
|
||||
date = "2017-05-31T15:21:13+10:00"
|
||||
draft = true
|
||||
slug = ""
|
||||
tags = []
|
||||
title = "my archetype example"
|
||||
+++
|
||||
```
|
||||
|
||||
As we can see, the file contains the `title` and `date` property that Hugo created for us, along with the front matter that we defined in the `archetypes/default.md` file.
|
||||
|
||||
You'll also notice that the fields have been sorted into alphabetical order. This is an unintentional side-effect that stems from the underlying code libraries that Hugo relies upon. It is, however, [a known issue that is actively being discussed](https://github.com/gohugoio/hugo/issues/452).
|
||||
|
||||
## Section Archetypes
|
||||
|
||||
By creating the `archetypes/default.md` file, we've created a default archetype that is more useful than the built-in archetype, but since Hugo encourages us to [organize our content into sections](/content/sections/), each of which will likely have different front matter requirements, a "one-size-fits-all" archetype isn't necessarily the best approach.
|
||||
|
||||
To accommodate for this, Hugo allows us to create archetypes for each section of our project. This means, whenever we generate content for a certain section, the appropriate front matter for that section will be automatically included in the generated file.
|
||||
|
||||
To see this in action, create a "photo" section by creating a directory named "photo" inside the `content` directory.
|
||||
|
||||
Then create a file named `photo.md` inside the `archetypes` directory and include the following front matter inside this file:
|
||||
|
||||
```toml
|
||||
+++
|
||||
image_url = ""
|
||||
camera = ""
|
||||
lens = ""
|
||||
aperture = ""
|
||||
iso = ""
|
||||
draft = true
|
||||
+++
|
||||
```
|
||||
|
||||
Here, the critical detail is that the `photo.md` file in the `archetypes` directory is named after the `photo` section that we just created. By sharing a name, Hugo can understand that there's a relationship between them.
|
||||
|
||||
Next, run the following command:
|
||||
|
||||
```bash
|
||||
hugo new photo/my-pretty-cat.md
|
||||
```
|
||||
|
||||
This command will generate a file named `my-pretty-cat.md` inside the `content/photo` directory, and this file will contain the following output:
|
||||
|
||||
```toml
|
||||
+++
|
||||
aperture = ""
|
||||
camera = ""
|
||||
date = "2017-05-31T15:25:18+10:00"
|
||||
draft = true
|
||||
image_url = ""
|
||||
iso = ""
|
||||
lens = ""
|
||||
title = "my pretty cat"
|
||||
+++
|
||||
```
|
||||
|
||||
As we can see, the `title` and `date` fields are still included by Hugo, but the rest of the front matter is being generated from the `photo.md` archetype instead of the `default.md` archetype.
|
||||
|
||||
### Tip: Default Values
|
||||
|
||||
To make archetypes more useful, define default values for any fields that will always be set to a range of limited options. In the case of the `photo.md` archetype, for instance, you could include lists of the various cameras and lenses that you own:
|
||||
|
||||
```toml
|
||||
+++
|
||||
image_url = ""
|
||||
camera = [
|
||||
"Sony RX100 Mark IV",
|
||||
"Canon 5D Mark III",
|
||||
"iPhone 6S"
|
||||
]
|
||||
lens = [
|
||||
"Canon EF 50mm f/1.8",
|
||||
"Rokinon 14mm f/2.8"
|
||||
]
|
||||
aperture = ""
|
||||
iso = ""
|
||||
draft = true
|
||||
+++
|
||||
```
|
||||
|
||||
Then, after generating a content file, simply remove the values that aren't relevant. This saves you from typing out the same options over and over again while ensuring consistency in how they're written.
|
||||
|
||||
## Scaffolding Content
|
||||
|
||||
Archetypes aren't limited to defining default front matter. They can also be used to define a default structure for the body of Markdown documents.
|
||||
|
||||
For example, imagine creating a `review.md` archetype for the purpose of writing camera reviews. This is what the front matter for such an archetype might look like:
|
||||
|
||||
```toml
|
||||
+++
|
||||
manufacturer = ""
|
||||
model = ""
|
||||
price = ""
|
||||
releaseDate = ""
|
||||
rating = ""
|
||||
+++
|
||||
```
|
||||
|
||||
But reviews tend to follow strict formats and need to answer specific questions, and it's with these expectations of precise structure that archetypes can prove to be even more useful.
|
||||
|
||||
For the sake of writing reviews, for instance, we could define the structure of a review beneath the front matter of the `review.md` file:
|
||||
|
||||
```markdown
|
||||
+++
|
||||
manufacturer = ""
|
||||
model = ""
|
||||
price = ""
|
||||
releaseDate = ""
|
||||
rating = ""
|
||||
+++
|
||||
|
||||
## Introduction
|
||||
|
||||
## Sample Photos
|
||||
|
||||
## Conclusion
|
||||
```
|
||||
|
||||
Then, whenever we use the `hugo new` command to create a new review, not only will the default front matter be copied into the newly created Markdown document, but the body of the `review.md` archetype will also be copied.
|
||||
|
||||
To take this further though — and to ensure authors on multi-author websites are on the same page about how content should be written — we could include notes and reminders within the archetype:
|
||||
|
||||
```markdown
|
||||
+++
|
||||
manufacturer = ""
|
||||
model = ""
|
||||
price = ""
|
||||
releaseDate = ""
|
||||
rating = ""
|
||||
+++
|
||||
|
||||
## Introduction
|
||||
|
||||
<!--
|
||||
What is the selling point of the camera?
|
||||
What has changed since last year's model?
|
||||
Include a bullet-point list of key features.
|
||||
-->
|
||||
|
||||
## Sample Photos
|
||||
|
||||
<!-- TODO: Take at least 12 photos in a variety of situations. -->
|
||||
|
||||
## Conclusion
|
||||
|
||||
<!--
|
||||
Is this camera worth the money?
|
||||
Does it accomplish what it set out to achieve?
|
||||
Are there any specific groups of people who should/shouldn't buy it?
|
||||
Would you recommend it to a friend?
|
||||
Are there alternatives on the horizon?
|
||||
-->
|
||||
|
||||
```
|
||||
|
||||
That way, each time we generate a new content file, we have a series of handy notes to push us closer to a piece of writing that's suitable for publishing.
|
||||
|
||||
(If you're wondering why the notes are wrapped in the HTML comment syntax, it's to ensure they won't appear inside the preview window of whatever Markdown editor the author happens to be using. They're not strictly necessary though.)
|
||||
|
||||
This is still a fairly simple example, but if your content usually contains a variety of components — headings, bullet-points, images, [short-codes](/extras/shortcodes/), etc — it's not hard to see the time-saving benefits of placing these components in the body of an archetype file.
|
||||
|
||||
## Theme Archetypes
|
||||
|
||||
Whenever you generate a content file with the `hugo new` command, Hugo will start by searching for archetypes in the `archetypes` directory, initially looking for an archetype that matches the content's section and falling-back on the `default.md` archetype (if one is present). If no archetypes are found in this directory, Hugo will continue its search in the `archetypes` directory of the currently active theme. In other words, it's possible for themes to come packaged with their own archetypes, ensuring that users of that theme format their content files with correctly structured front matter.
|
||||
|
||||
To allow Hugo to use archetypes from a theme, [that theme must be activated via the project's configuration file](/themes/usage/):
|
||||
|
||||
```toml
|
||||
theme = "ThemeNameGoesHere"
|
||||
```
|
||||
|
||||
If an archetype doesn't exist in the `archetypes` directory at the top-level of a project or inside the `archetypes` directory of an active theme, the built-in archetype will be used.
|
||||
|
||||
{{< figure src="/img/content/archetypes/archetype-hierarchy.png" alt="How Hugo Decides Which Archetype To Use" >}}
|
||||
|
||||
## Archetype Formats
|
||||
|
||||
By default, the `hugo new` command will generate front matter in the TOML format. This means, even if we define the front matter in our archetype files as YAML or JSON, it will be converted to the TOML format before it ends up in our content files.
|
||||
|
||||
Fortunately, this functionality can be overwritten.
|
||||
|
||||
Inside the project's configuration file, simply define a `metaDataFormat` property:
|
||||
|
||||
```toml
|
||||
metaDataFormat = ""
|
||||
```
|
||||
|
||||
Then set this property to any of the following values:
|
||||
|
||||
* toml
|
||||
* yaml
|
||||
* json
|
||||
|
||||
By defining this option, any front matter will be generated in your preferred format.
|
||||
|
||||
It's worth noting, however, that when generating front matter in the TOML format, you might encounter the following error:
|
||||
|
||||
```bash
|
||||
Error: cannot convert type <nil> to TomlTree
|
||||
```
|
||||
|
||||
This is because, to generate TOML, all of the fields in the front matter need to have a default value, even if that default value is just an empty string.
|
||||
|
||||
For example, this YAML would *not* successfully compile into the TOML format:
|
||||
|
||||
```yaml
|
||||
---
|
||||
slug:
|
||||
tags:
|
||||
categories:
|
||||
draft:
|
||||
---
|
||||
```
|
||||
|
||||
But this YAML *would* successfully compile:
|
||||
|
||||
```yaml
|
||||
---
|
||||
slug: ""
|
||||
tags:
|
||||
-
|
||||
categories:
|
||||
-
|
||||
draft: true
|
||||
---
|
||||
```
|
||||
|
||||
It's a subtle yet important detail to remember.
|
||||
|
||||
## Notes
|
||||
|
||||
* Prior to Hugo v0.13, some users received [an "EOF" error when using archetypes](https://github.com/gohugoio/hugo/issues/776), related to what text editor they used to create the archetype. As of Hugo v0.13, this error has been [resolved](https://github.com/gohugoio/hugo/pull/785).
|
||||
@@ -1,91 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /doc/example/
|
||||
lastmod: 2015-12-23
|
||||
date: 2013-07-01
|
||||
linktitle: Example
|
||||
menu:
|
||||
main:
|
||||
parent: content
|
||||
prev: /content/multilingual
|
||||
next: /content/using-index-md
|
||||
notoc: true
|
||||
title: Example Content File
|
||||
weight: 70
|
||||
---
|
||||
|
||||
Some things are better shown than explained. The following is a very basic example of a content file written in [Markdown](https://help.github.com/articles/github-flavored-markdown/):
|
||||
|
||||
**mysite/content/project/nitro.md → http://mysite.com/project/nitro.html**
|
||||
|
||||
With TOML front matter:
|
||||
|
||||
<pre><code class="language-toml">+++
|
||||
date = "2013-06-21T11:27:27-04:00"
|
||||
title = "Nitro: A quick and simple profiler for Go"
|
||||
description = "Nitro is a simple profiler for your Golang applications"
|
||||
tags = [ "Development", "Go", "profiling" ]
|
||||
topics = [ "Development", "Go" ]
|
||||
slug = "nitro"
|
||||
project_url = "https://github.com/spf13/nitro"
|
||||
+++
|
||||
</code><code class="language-markdown"># Nitro
|
||||
|
||||
Quick and easy performance analyzer library for [Go](http://golang.org/).
|
||||
|
||||
## Overview
|
||||
|
||||
Nitro is a quick and easy performance analyzer library for Go.
|
||||
It is useful for comparing A/B against different drafts of functions
|
||||
or different functions.
|
||||
|
||||
## Implementing Nitro
|
||||
|
||||
Using Nitro is simple. First, use `go get` to install the latest version
|
||||
of the library.
|
||||
|
||||
$ go get github.com/spf13/nitro
|
||||
|
||||
Next, include nitro in your application.
|
||||
</code></pre>
|
||||
|
||||
You may also use the equivalent YAML front matter:
|
||||
|
||||
```yaml
|
||||
---
|
||||
lastmod: 2015-12-23
|
||||
date: "2013-06-21T11:27:27-04:00"
|
||||
title: "Nitro: A quick and simple profiler for Go"
|
||||
description: "Nitro is a simple profiler for your Go lang applications"
|
||||
tags: [ "Development", "Go", "profiling" ]
|
||||
topics: [ "Development", "Go" ]
|
||||
slug: "nitro"
|
||||
project_url: "https://github.com/spf13/nitro"
|
||||
---
|
||||
```
|
||||
|
||||
`nitro.md` would be rendered as follows:
|
||||
|
||||
> # Nitro
|
||||
>
|
||||
> Quick and easy performance analyzer library for [Go](http://golang.org/).
|
||||
>
|
||||
> ## Overview
|
||||
>
|
||||
> Nitro is a quick and easy performance analyzer library for Go.
|
||||
> It is useful for comparing A/B against different drafts of functions
|
||||
> or different functions.
|
||||
>
|
||||
> ## Implementing Nitro
|
||||
>
|
||||
> Using Nitro is simple. First, use `go get` to install the latest version
|
||||
> of the library.
|
||||
>
|
||||
> $ go get github.com/spf13/nitro
|
||||
>
|
||||
> Next, include nitro in your application.
|
||||
|
||||
The source `nitro.md` file is converted to HTML by the excellent
|
||||
[Blackfriday](https://github.com/russross/blackfriday) Markdown processor,
|
||||
which supports extended features found in the popular
|
||||
[GitHub Flavored Markdown](https://help.github.com/articles/github-flavored-markdown/).
|
||||
@@ -1,119 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /doc/front-matter/
|
||||
lastmod: 2015-12-23
|
||||
date: 2013-07-01
|
||||
menu:
|
||||
main:
|
||||
parent: content
|
||||
next: /content/sections
|
||||
prev: /content/organization
|
||||
title: Front Matter
|
||||
weight: 20
|
||||
toc: true
|
||||
---
|
||||
|
||||
The **front matter** is one of the features that gives Hugo its strength. It enables
|
||||
you to include the meta data of the content right with it. Hugo supports a few
|
||||
different formats, each with their own identifying tokens.
|
||||
|
||||
Supported formats:
|
||||
|
||||
* **[TOML][]**, identified by '`+++`'.
|
||||
* **[YAML][]**, identified by '`---`'.
|
||||
* **[JSON][]**, a single JSON object which is surrounded by '`{`' and '`}`', followed by a newline.
|
||||
|
||||
[TOML]: https://github.com/toml-lang/toml "Tom's Obvious, Minimal Language"
|
||||
[YAML]: http://www.yaml.org/ "YAML Ain't Markup Language"
|
||||
[JSON]: http://www.json.org/ "JavaScript Object Notation"
|
||||
|
||||
## TOML Example
|
||||
|
||||
<pre><code class="language-toml">+++
|
||||
title = "spf13-vim 3.0 release and new website"
|
||||
description = "spf13-vim is a cross platform distribution of vim plugins and resources for Vim."
|
||||
tags = [ ".vimrc", "plugins", "spf13-vim", "vim" ]
|
||||
date = "2012-04-06"
|
||||
categories = [
|
||||
"Development",
|
||||
"VIM"
|
||||
]
|
||||
slug = "spf13-vim-3-0-release-and-new-website"
|
||||
+++
|
||||
</code><code class="language-markdown">Content of the file goes Here
|
||||
</code></pre>
|
||||
|
||||
## YAML Example
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: "spf13-vim 3.0 release and new website"
|
||||
description: "spf13-vim is a cross platform distribution of vim plugins and resources for Vim."
|
||||
tags: [ ".vimrc", "plugins", "spf13-vim", "vim" ]
|
||||
lastmod: 2015-12-23
|
||||
date: "2012-04-06"
|
||||
categories:
|
||||
- "Development"
|
||||
- "VIM"
|
||||
slug: "spf13-vim-3-0-release-and-new-website"
|
||||
---
|
||||
|
||||
Content of the file goes Here
|
||||
```
|
||||
|
||||
## JSON Example
|
||||
|
||||
```json
|
||||
{
|
||||
"title": "spf13-vim 3.0 release and new website",
|
||||
"description": "spf13-vim is a cross platform distribution of vim plugins and resources for Vim.",
|
||||
"tags": [ ".vimrc", "plugins", "spf13-vim", "vim" ],
|
||||
"date": "2012-04-06",
|
||||
"categories": [
|
||||
"Development",
|
||||
"VIM"
|
||||
],
|
||||
"slug": "spf13-vim-3-0-release-and-new-website"
|
||||
}
|
||||
|
||||
Content of the file goes Here
|
||||
```
|
||||
|
||||
## Variables
|
||||
|
||||
There are a few predefined variables that Hugo is aware of and utilizes. The user can also create
|
||||
any variable they want. These will be placed into the `.Params` variable available to the templates.
|
||||
Field names are always normalized to lowercase (e.g. `camelCase: true` is available as `.Params.camelcase`).
|
||||
|
||||
### Required variables
|
||||
|
||||
* **title** The title for the content
|
||||
* **description** The description for the content
|
||||
* **date** The date the content will be sorted by
|
||||
* **taxonomies** These will use the field name of the plural form of the index (see tags and categories above)
|
||||
|
||||
### Optional variables
|
||||
|
||||
* **aliases** An array of one or more aliases
|
||||
(e.g. old published path of a renamed content)
|
||||
that would be created to redirect to this content.
|
||||
See [Aliases]({{< relref "extras/aliases.md" >}}) for details.
|
||||
* **draft** If true, the content will not be rendered unless `hugo` is called with `--buildDrafts`
|
||||
* **publishdate** If in the future, content will not be rendered unless `hugo` is called with `--buildFuture`
|
||||
* **expirydate** Content already expired will not be rendered unless `hugo` is called with `--buildExpired`
|
||||
* **type** The type of the content (will be derived from the directory automatically if unset)
|
||||
* **isCJKLanguage** If true, explicitly treat the content as CJKLanguage (`.Summary` and `.WordCount` can work properly in CJKLanguage)
|
||||
* **weight** Used for sorting
|
||||
* **markup** *(Experimental)* Specify `"rst"` for reStructuredText (requires
|
||||
`rst2html`) or `"md"` (default) for Markdown
|
||||
* **slug** appears as tail of the url. It can be used to change the part of the url that is based on the filename.
|
||||
* **url** The full path to the content from the web root. It makes no assumptions about the path of the content file. It also ignores any language prefixes of the multilingual feature.
|
||||
|
||||
*If neither `slug` or `url` is present, the filename will be used.*
|
||||
|
||||
## Configure Blackfriday rendering
|
||||
|
||||
It's possible to set some options for Markdown rendering in the page's front matter as an override to the site wide configuration.
|
||||
|
||||
See [Configuration]({{< ref "overview/configuration.md#configure-blackfriday-rendering" >}}) for more.
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /doc/supported-formats/
|
||||
lastmod: 2016-07-22
|
||||
date: 2016-07-22
|
||||
menu:
|
||||
main:
|
||||
parent: content
|
||||
prev: /content/summaries
|
||||
next: /content/multilingual
|
||||
title: Markdown Extras
|
||||
weight: 66
|
||||
toc: false
|
||||
---
|
||||
|
||||
Hugo provides some convenient markdown extensions.
|
||||
|
||||
## Task lists
|
||||
|
||||
Hugo supports GitHub styled task lists (TODO lists) for the Blackfriday renderer (md-files). See [Blackfriday config](/overview/configuration/#configure-blackfriday-rendering) for how to turn it off.
|
||||
|
||||
Example:
|
||||
|
||||
```markdown
|
||||
- [ ] a task list item
|
||||
- [ ] list syntax required
|
||||
- [ ] incomplete
|
||||
- [x] completed
|
||||
```
|
||||
|
||||
Renders as:
|
||||
|
||||
- [ ] a task list item
|
||||
- [ ] list syntax required
|
||||
- [ ] incomplete
|
||||
- [x] completed
|
||||
|
||||
|
||||
And produces this HTML:
|
||||
|
||||
```html
|
||||
|
||||
<ul class="task-list">
|
||||
<li><input type="checkbox" disabled="" class="task-list-item"> a task list item</li>
|
||||
<li><input type="checkbox" disabled="" class="task-list-item"> list syntax required</li>
|
||||
<li><input type="checkbox" disabled="" class="task-list-item"> incomplete</li>
|
||||
<li><input type="checkbox" checked="" disabled="" class="task-list-item"> completed</li>
|
||||
</ul>
|
||||
```
|
||||
@@ -1,232 +0,0 @@
|
||||
---
|
||||
date: 2016-01-02T21:21:00Z
|
||||
menu:
|
||||
main:
|
||||
parent: content
|
||||
prev: /content/markdown-extras
|
||||
next: /content/example
|
||||
title: Multilingual Mode
|
||||
weight: 68
|
||||
toc: true
|
||||
---
|
||||
Hugo supports multiple languages side-by-side (added in `Hugo 0.17`). Define the available languages in a `Languages` section in your top-level `config.toml` (or equivalent).
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
DefaultContentLanguage = "en"
|
||||
copyright = "Everything is mine"
|
||||
|
||||
[params.navigation]
|
||||
help = "Help"
|
||||
|
||||
[Languages]
|
||||
[Languages.en]
|
||||
title = "My blog"
|
||||
weight = 1
|
||||
[Languages.en.params]
|
||||
linkedin = "english-link"
|
||||
|
||||
[Languages.fr]
|
||||
copyright = "Tout est à moi"
|
||||
title = "Mon blog"
|
||||
weight = 2
|
||||
[Languages.fr.params]
|
||||
linkedin = "lien-francais"
|
||||
[Languages.fr.navigation]
|
||||
help = "Aide"
|
||||
|
||||
```
|
||||
|
||||
Anything not defined in a `[Languages]` block will fall back to the global
|
||||
value for that key (like `copyright` for the English (`en`) language in this example).
|
||||
|
||||
With the config above, all content, sitemap, RSS feeds, paginations
|
||||
and taxonomy pages will be rendered below `/` in English (your default content language), and below `/fr` in French.
|
||||
|
||||
When working with params in frontmatter pages, omit the `params` in the key for the translation.
|
||||
|
||||
If you want all of the languages to be put below their respective language code, enable `defaultContentLanguageInSubdir: true` in your configuration.
|
||||
|
||||
Only the obvious non-global options can be overridden per language. Examples of global options are `BaseURL`, `BuildDrafts`, etc.
|
||||
|
||||
Taxonomies and Blackfriday configuration can also be set per language, example:
|
||||
|
||||
```
|
||||
[Taxonomies]
|
||||
tag = "tags"
|
||||
|
||||
[blackfriday]
|
||||
angledQuotes = true
|
||||
hrefTargetBlank = true
|
||||
|
||||
[Languages]
|
||||
[Languages.en]
|
||||
weight = 1
|
||||
title = "English"
|
||||
[Languages.en.blackfriday]
|
||||
angledQuotes = false
|
||||
|
||||
[Languages.fr]
|
||||
weight = 2
|
||||
title = "Français"
|
||||
[Languages.fr.Taxonomies]
|
||||
plaque = "plaques"
|
||||
```
|
||||
|
||||
|
||||
### Translating your content
|
||||
|
||||
Translated articles are identified by the name of the content file.
|
||||
|
||||
Example of translated articles:
|
||||
|
||||
1. `/content/about.en.md`
|
||||
2. `/content/about.fr.md`
|
||||
|
||||
You can also have:
|
||||
|
||||
1. `/content/about.md`
|
||||
2. `/content/about.fr.md`
|
||||
|
||||
In which case the config variable `defaultContentLanguage` will be used to affect the default language `about.md`. This way, you can
|
||||
slowly start to translate your current content without having to rename everything.
|
||||
|
||||
If left unspecified, the value for `defaultContentLanguage` defaults to `en`.
|
||||
|
||||
By having the same _base file name_, the content pieces are linked together as translated pieces.
|
||||
|
||||
If you need distinct URLs per language you can set the slug in the non-default language file. Just define the custom slug for the french translation in your `/content/about.fr.md` file:
|
||||
|
||||
```
|
||||
---
|
||||
slug: "a-propos"
|
||||
---
|
||||
```
|
||||
|
||||
You will get both `/about/` and `/a-propos/` URLs in your build, properly linked as translated pieces.
|
||||
|
||||
### Link to translated content
|
||||
|
||||
To create a list of links to translated content, use a template similar to this:
|
||||
|
||||
```
|
||||
{{ if .IsTranslated }}
|
||||
<h4>{{ i18n "translations" }}</h4>
|
||||
<ul>
|
||||
{{ range .Translations }}
|
||||
<li>
|
||||
<a href="{{ .Permalink }}">{{ .Lang }}: {{ .Title }}{{ if .IsPage }} ({{ i18n "wordCount" . }}){{ end }}</a>
|
||||
</li>
|
||||
{{ end}}
|
||||
</ul>
|
||||
{{ end }}
|
||||
```
|
||||
The above can be put in a `partial` and included in any template, be it for a content page or the home page. It will not print anything if there are no translations for a given page, or if it is -- in the case of the home page, section listing etc. -- a site with only one language.
|
||||
|
||||
The above also uses the `i18n` func, see [Translation of strings](#translation-of-strings).
|
||||
|
||||
### Translation of strings
|
||||
|
||||
Hugo uses [go-i18n](https://github.com/nicksnyder/go-i18n) to support string translations. Follow the link to find tools to manage your translation workflows.
|
||||
|
||||
Translations are collected from the `themes/[name]/i18n/` folder (built into the theme), as well as translations present in `i18n/` at the root of your project. In the `i18n`, the translations will be merged and take precedence over what is in the theme folder. Language files should be named according to RFC 5646 with names such as `en-US.toml`, `fr.toml`, etc.
|
||||
|
||||
From within your templates, use the `i18n` function like this:
|
||||
|
||||
```
|
||||
{{ i18n "home" }}
|
||||
```
|
||||
|
||||
This uses a definition like this one in `i18n/en-US.toml`:
|
||||
|
||||
```
|
||||
[home]
|
||||
other = "Home"
|
||||
```
|
||||
|
||||
Often you will want to use to the page variables in the translations strings. To do that, pass on the "." context when calling `i18n`:
|
||||
|
||||
```
|
||||
{{ i18n "wordCount" . }}
|
||||
```
|
||||
|
||||
This uses a definition like this one in `i18n/en-US.toml`:
|
||||
|
||||
```
|
||||
[wordCount]
|
||||
other = "This article has {{ .WordCount }} words."
|
||||
```
|
||||
An example of singular and plural form:
|
||||
|
||||
```
|
||||
[readingTime]
|
||||
one = "One minute read"
|
||||
other = "{{.Count}} minutes read"
|
||||
```
|
||||
And then in the template:
|
||||
|
||||
```
|
||||
{{ i18n "readingTime" .ReadingTime }}
|
||||
```
|
||||
To track down missing translation strings, run Hugo with the `--i18n-warnings` flag:
|
||||
|
||||
```bash
|
||||
hugo --i18n-warnings | grep i18n
|
||||
i18n|MISSING_TRANSLATION|en|wordCount
|
||||
```
|
||||
|
||||
### Menus
|
||||
|
||||
You can define your menus for each language independently. The [creation of a menu]({{< relref "extras/menus.md" >}}) works analogous to earlier versions of Hugo, except that they have to be defined in their language-specific block in the configuration file:
|
||||
|
||||
```toml
|
||||
defaultContentLanguage = "en"
|
||||
|
||||
[languages.en]
|
||||
weight = 0
|
||||
languageName = "English"
|
||||
|
||||
[[languages.en.menu.main]]
|
||||
url = "/"
|
||||
name = "Home"
|
||||
weight = 0
|
||||
|
||||
|
||||
[languages.de]
|
||||
weight = 10
|
||||
languageName = "Deutsch"
|
||||
|
||||
[[languages.de.menu.main]]
|
||||
url = "/"
|
||||
name = "Startseite"
|
||||
weight = 0
|
||||
```
|
||||
|
||||
The rendering of the main navigation works as usual. `.Site.Menus` will just contain the menu of the current language. Pay attention to the generation of the menu links. `absLangURL` takes care that you link to the correct locale of your website. Otherwise, both menu entries would link to the English version because it's the default content language that resides in the root directory.
|
||||
|
||||
```html
|
||||
<ul>
|
||||
{{- $currentPage := . -}}
|
||||
{{ range .Site.Menus.main -}}
|
||||
<li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}">
|
||||
<a href="{{ .URL | absLangURL }}">{{ .Name }}</a>
|
||||
</li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
|
||||
```
|
||||
|
||||
### Missing translations
|
||||
|
||||
If a string does not have a translation for the current language, Hugo will use the value from the default language. If no default value is set, an empty string will be shown.
|
||||
|
||||
While translating a Hugo site, it can be handy to have a visual indicator of missing translations. The `EnableMissingTranslationPlaceholders` config option will flag all untranslated strings with the placeholder `[i18n] identifier`, where `identifier` is the id of the missing translation.
|
||||
|
||||
**Remember: Hugo will generate your website with these placeholders. It might not be suited for production environments.**
|
||||
|
||||
### Multilingual Themes support
|
||||
|
||||
To support Multilingual mode in your themes, some considerations must be taken for the URLs in the templates. If there are more than one language, URLs must either come from the built-in `.Permalink` or `.URL`, be constructed with `relLangURL` or `absLangURL` template funcs -- or prefixed with `{{.LanguagePrefix }}`.
|
||||
|
||||
If there are more than one language defined, the`LanguagePrefix` variable will equal `"/en"` (or whatever your `CurrentLanguage` is). If not enabled, it will be an empty string, so it is harmless for single-language sites.
|
||||
@@ -1,41 +0,0 @@
|
||||
---
|
||||
lastmod: 2015-12-23
|
||||
date: 2014-03-06
|
||||
linktitle: Ordering
|
||||
menu:
|
||||
main:
|
||||
parent: content
|
||||
next: /content/summaries
|
||||
prev: /content/archetypes
|
||||
title: Ordering Content
|
||||
weight: 60
|
||||
---
|
||||
|
||||
Hugo provides you with all the flexibility you need to organize how your content is ordered.
|
||||
|
||||
By default, content is ordered by weight, then by date with the most
|
||||
recent date first, but alternative sorting (by `title` and `linktitle`) is
|
||||
also available. The order the content would appear is specified in
|
||||
the [list template](/templates/list/).
|
||||
|
||||
_Both the `date` and `weight` fields are optional._
|
||||
|
||||
Unweighted pages appear at the end of the list. If no weights are provided (or
|
||||
if weights are the same), `date` will be used to sort. If neither is provided,
|
||||
content will be ordered based on how it's read off the disk, and no order is
|
||||
guaranteed.
|
||||
|
||||
## Assigning weight to content
|
||||
|
||||
```toml
|
||||
+++
|
||||
weight = 4
|
||||
title = "Three"
|
||||
date = "2012-04-06"
|
||||
+++
|
||||
Front Matter with Ordered Pages 3
|
||||
```
|
||||
|
||||
## Ordering Content Within Taxonomies
|
||||
|
||||
Please see the [Taxonomy Ordering Documentation](/taxonomies/ordering/).
|
||||
@@ -1,175 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /doc/organization/
|
||||
lastmod: 2015-09-27
|
||||
date: 2013-07-01
|
||||
linktitle: Organization
|
||||
menu:
|
||||
main:
|
||||
parent: content
|
||||
next: /content/supported-formats
|
||||
prev: /overview/source-directory
|
||||
title: Content Organization
|
||||
weight: 10
|
||||
toc: true
|
||||
---
|
||||
|
||||
Hugo uses files (see [supported formats](/content/supported-formats/)) with headers commonly called the *front matter*. Hugo
|
||||
respects the organization that you provide for your content to minimize any
|
||||
extra configuration, though this can be overridden by additional configuration
|
||||
in the front matter.
|
||||
|
||||
## Organization
|
||||
|
||||
In Hugo, the content should be arranged in the same way they are intended for
|
||||
the rendered website. Without any additional configuration, the following will
|
||||
just work. Hugo supports content nested at any level. The top level is special
|
||||
in Hugo and is used as the [section](/content/sections/).
|
||||
|
||||
.
|
||||
└── content
|
||||
└── about
|
||||
| └── _index.md // <- http://1.com/about/
|
||||
├── post
|
||||
| ├── firstpost.md // <- http://1.com/post/firstpost/
|
||||
| ├── happy
|
||||
| | └── ness.md // <- http://1.com/post/happy/ness/
|
||||
| └── secondpost.md // <- http://1.com/post/secondpost/
|
||||
└── quote
|
||||
├── first.md // <- http://1.com/quote/first/
|
||||
└── second.md // <- http://1.com/quote/second/
|
||||
|
||||
**Here's the same organization run with `hugo --uglyURLs`**
|
||||
|
||||
.
|
||||
└── content
|
||||
└── about
|
||||
| └── _index.md // <- http://1.com/about/
|
||||
├── post
|
||||
| ├── firstpost.md // <- http://1.com/post/firstpost.html
|
||||
| ├── happy
|
||||
| | └── ness.md // <- http://1.com/post/happy/ness.html
|
||||
| └── secondpost.md // <- http://1.com/post/secondpost.html
|
||||
└── quote
|
||||
├── first.md // <- http://1.com/quote/first.html
|
||||
└── second.md // <- http://1.com/quote/second.html
|
||||
|
||||
## Destinations
|
||||
|
||||
Hugo believes that you organize your content with a purpose. The same structure
|
||||
that works to organize your source content is used to organize the rendered
|
||||
site. As displayed above, the organization of the source content will be
|
||||
mirrored in the destination.
|
||||
|
||||
Notice that the first level `about/` page URL was created using a directory
|
||||
named "about" with a single `_index.md` file inside. Find out more about `_index.md` specifically in [content for the homepage and other list pages](https://gohugo.io/overview/source-directory#content-for-home-page-and-other-list-pages).
|
||||
|
||||
There are times when one would need more control over their content. In these
|
||||
cases, there are a variety of things that can be specified in the front matter
|
||||
to determine the destination of a specific piece of content.
|
||||
|
||||
The following items are defined in order; latter items in the list will override
|
||||
earlier settings.
|
||||
|
||||
### filename
|
||||
This isn't in the front matter, but is the actual name of the file minus the
|
||||
extension. This will be the name of the file in the destination.
|
||||
|
||||
### slug
|
||||
Defined in the front matter, the `slug` can take the place of the filename for the
|
||||
destination.
|
||||
|
||||
### filepath
|
||||
The actual path to the file on disk. Destination will create the destination
|
||||
with the same path. Includes [section](/content/sections/).
|
||||
|
||||
### section
|
||||
`section` is determined by its location on disk and *cannot* be specified in the front matter. See [section](/content/sections/).
|
||||
|
||||
### type
|
||||
`type` is also determined by its location on disk but, unlike `section`, it *can* be specified in the front matter. See [type](/content/types/).
|
||||
|
||||
### path
|
||||
`path` can be provided in the front matter. This will replace the actual
|
||||
path to the file on disk. Destination will create the destination with the same
|
||||
path. Includes [section](/content/sections/).
|
||||
|
||||
### url
|
||||
A complete URL can be provided. This will override all the above as it pertains
|
||||
to the end destination. This must be the path from the baseURL (starting with a "/").
|
||||
When a `url` is provided, it will be used exactly. Using `url` will ignore the
|
||||
`--uglyURLs` setting.
|
||||
|
||||
|
||||
## Path breakdown in Hugo
|
||||
|
||||
### Content
|
||||
|
||||
. path slug
|
||||
. ⊢-------^----⊣ ⊢------^-------⊣
|
||||
content/extras/indexes/category-example/index.html
|
||||
|
||||
|
||||
. section slug
|
||||
. ⊢--^--⊣ ⊢------^-------⊣
|
||||
content/extras/indexes/category-example/index.html
|
||||
|
||||
|
||||
. section slug
|
||||
. ⊢--^--⊣⊢--^--⊣
|
||||
content/extras/indexes/index.html
|
||||
|
||||
### Destination
|
||||
|
||||
|
||||
permalink
|
||||
⊢--------------^-------------⊣
|
||||
http://spf13.com/projects/hugo
|
||||
|
||||
|
||||
baseURL section slug
|
||||
⊢-----^--------⊣ ⊢--^---⊣ ⊢-^⊣
|
||||
http://spf13.com/projects/hugo
|
||||
|
||||
|
||||
baseURL section slug
|
||||
⊢-----^--------⊣ ⊢--^--⊣ ⊢--^--⊣
|
||||
http://spf13.com/extras/indexes/example
|
||||
|
||||
|
||||
baseURL path slug
|
||||
⊢-----^--------⊣ ⊢------^-----⊣ ⊢--^--⊣
|
||||
http://spf13.com/extras/indexes/example
|
||||
|
||||
|
||||
baseURL url
|
||||
⊢-----^--------⊣ ⊢-----^-----⊣
|
||||
http://spf13.com/projects/hugo
|
||||
|
||||
|
||||
baseURL url
|
||||
⊢-----^--------⊣ ⊢--------^-----------⊣
|
||||
http://spf13.com/extras/indexes/example
|
||||
|
||||
|
||||
|
||||
**section** = which type the content is by default
|
||||
|
||||
* based on content location
|
||||
* front matter overrides
|
||||
|
||||
**slug** = name.ext or name/
|
||||
|
||||
* based on content-name.md
|
||||
* front matter overrides
|
||||
|
||||
**path** = section + path to file excluding slug
|
||||
|
||||
* based on path to content location
|
||||
|
||||
|
||||
**url** = relative URL
|
||||
|
||||
* defined in front matter
|
||||
* overrides all the above
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
---
|
||||
lastmod: 2015-12-23
|
||||
date: 2013-07-01
|
||||
menu:
|
||||
main:
|
||||
parent: content
|
||||
next: /content/types
|
||||
notoc: true
|
||||
prev: /content/front-matter
|
||||
title: Sections
|
||||
weight: 30
|
||||
---
|
||||
|
||||
Hugo believes that you organize your content with a purpose. The same structure
|
||||
that works to organize your source content is used to organize the rendered
|
||||
site (see [Organization](/content/organization/)). Following this pattern Hugo
|
||||
uses the top level of your content organization as **the Section**.
|
||||
|
||||
The following example site uses two sections, "post" and "quote".
|
||||
|
||||
{{< nohighlight >}}.
|
||||
└── content
|
||||
├── post
|
||||
| ├── firstpost.md // <- http://1.com/post/firstpost/
|
||||
| ├── happy
|
||||
| | └── ness.md // <- http://1.com/post/happy/ness/
|
||||
| └── secondpost.md // <- http://1.com/post/secondpost/
|
||||
└── quote
|
||||
├── first.md // <- http://1.com/quote/first/
|
||||
└── second.md // <- http://1.com/quote/second/
|
||||
{{< /nohighlight >}}
|
||||
|
||||
## Section Lists
|
||||
|
||||
Hugo will automatically create pages for each section root that list all
|
||||
of the content in that section. See [List Templates](/templates/list/)
|
||||
for details on customizing the way they appear.
|
||||
|
||||
Section pages can also have a content file and frontmatter, see [Source Organization]({{< relref "overview/source-directory.md#content-for-home-page-and-other-list-pages" >}}).
|
||||
|
||||
## Sections and Types
|
||||
|
||||
By default everything created within a section will use the content type
|
||||
that matches the section name.
|
||||
|
||||
Section defined in the front matter have the same impact.
|
||||
|
||||
To change the type of a given piece of content, simply define the type
|
||||
in the front matter.
|
||||
|
||||
If a layout for a given type hasn't been provided, a default type template will
|
||||
be used instead provided it exists.
|
||||
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
---
|
||||
lastmod: 2015-01-27
|
||||
date: 2013-07-01
|
||||
menu:
|
||||
main:
|
||||
parent: content
|
||||
notoc: true
|
||||
prev: /content/ordering
|
||||
next: /content/markdown-extras
|
||||
title: Summaries
|
||||
weight: 65
|
||||
---
|
||||
|
||||
With the use of the `.Summary` [page variable](/templates/variables/), Hugo can generate summaries of content to show snippets in summary views. The summary view snippets are automatically generated by Hugo. Where a piece of content is split for the content summary depends on whether the split is Hugo-defined or user-defined.
|
||||
|
||||
Content summaries may also provide links to the original content, usually in the form of a "Read More..." link, with the help of the `.RelPermalink` or `.Permalink` variable, as well as the `.Truncated` boolean variable to determine whether such "Read More..." link is necessary.
|
||||
|
||||
## Hugo-defined: automatic summary split
|
||||
|
||||
By default, Hugo automatically takes the first 70 words of your content as its summary and stores it into the `.Summary` variable, which you may use in your templates.
|
||||
|
||||
* Pros: Automatic, no additional work on your part.
|
||||
* Cons: All HTML tags are stripped from the summary, and the first 70 words, whether they belong to a heading or to different paragraphs, are all lumped into one paragraph. Some people like it, but some people don't.
|
||||
|
||||
## User-defined: manual summary split:
|
||||
|
||||
Alternatively, you may add the <code><!--more--></code> summary divider[^1] (for org content, use <code># more</code>) where you want to split the article. Content prior to the summary divider will be used as that content's summary, and stored into the `.Summary` variable with all HTML formatting intact.
|
||||
|
||||
[^1]: The **summary divider** is also called "more tag", "excerpt separator", etc. in other literature.
|
||||
|
||||
* Pros: Freedom, precision, and improved rendering. All formatting is preserved.
|
||||
* Cons: Need to remember to type <code><!--more--></code> (or <code># more</code> for org content) in your content file. :-)
|
||||
|
||||
Be careful to enter <code><!--more--></code> (or <code># more</code> for org content) exactly, i.e. all lowercase with no whitespace, otherwise it would be treated as regular comment and ignored.
|
||||
|
||||
If there is nothing but spaces and newlines after the summary divider then `.Truncated` will be false.
|
||||
|
||||
## Showing Summaries
|
||||
|
||||
You can show content summaries with the following code. You could do this, for example, on a [list](/templates/list/) page.
|
||||
|
||||
{{ range first 10 .Data.Pages }}
|
||||
<div class="summary">
|
||||
<h4><a href="{{ .RelPermalink }}">{{ .Title }}</a></h4>
|
||||
{{ .Summary }}
|
||||
</div>
|
||||
{{ if .Truncated }}
|
||||
<div class="read-more-link">
|
||||
<a href="{{ .RelPermalink }}">Read More…</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
Note how the `.Truncated` boolean valuable may be used to hide the "Read More..." link when the content is not truncated, i.e. when the summary contains the entire article.
|
||||
@@ -1,27 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /doc/supported-formats/
|
||||
lastmod: 2015-08-01
|
||||
date: 2015-08-01
|
||||
menu:
|
||||
main:
|
||||
parent: content
|
||||
next: /content/front-matter
|
||||
prev: /content/organization
|
||||
title: Supported Formats
|
||||
weight: 15
|
||||
toc: true
|
||||
---
|
||||
|
||||
Since 0.14, Hugo has defined a new concept called _external helpers_. It means that you can write your content using Asciidoc[tor], reStructuredText or Org-Mode. If you have files with associated extensions ([details](https://github.com/gohugoio/hugo/blob/77c60a3440806067109347d04eb5368b65ea0fe8/helpers/general.go#L65)), then Hugo will call external commands to generate the content (the exception being Org-Mode content, which is parsed natively).
|
||||
|
||||
This means that you will have to install the associated tool on your machine to be able to use those formats.
|
||||
|
||||
For example, for Asciidoc files, Hugo will try to call __asciidoctor__ or __asciidoc__ command.
|
||||
|
||||
To use those formats, just use the standard extension and the front matter exactly as you would do with natively supported _.md_ files.
|
||||
|
||||
Notes:
|
||||
|
||||
* as these are external commands, generation performance for that content will heavily depend on the performance of those external tools.
|
||||
* this feature is still in early stage, hence feedback is even more welcome.
|
||||
@@ -1,80 +0,0 @@
|
||||
---
|
||||
lastmod: 2015-09-28
|
||||
date: 2013-07-01
|
||||
linktitle: Types
|
||||
menu:
|
||||
main:
|
||||
parent: content
|
||||
next: /content/archetypes
|
||||
prev: /content/sections
|
||||
title: Content Types
|
||||
weight: 40
|
||||
toc: true
|
||||
---
|
||||
|
||||
Hugo has full support for different types of content. A content type can have a
|
||||
unique set of meta data, template and can be automatically created by the `hugo new`
|
||||
command through using content [archetypes](/content/archetypes/).
|
||||
|
||||
A good example of when multiple types are needed is to look at [Tumblr](https://www.tumblr.com/). A piece
|
||||
of content could be a photo, quote or post, each with different meta data and
|
||||
rendered differently.
|
||||
|
||||
## Assigning a content type
|
||||
|
||||
Hugo assumes that your site will be organized into [sections](/content/sections/)
|
||||
and each section will use the corresponding type. If you are taking advantage of
|
||||
this, then each new piece of content you place into a section will automatically
|
||||
inherit the type.
|
||||
|
||||
Alternatively, you can set the type in the meta data under the key "`type`".
|
||||
|
||||
|
||||
## Creating new content of a specific type
|
||||
|
||||
Hugo has the ability to create a new content file and populate the front matter
|
||||
with the data set corresponding to that type. Hugo does this by utilizing
|
||||
[archetypes](/content/archetypes/).
|
||||
|
||||
To create a new piece of content, use:
|
||||
|
||||
hugo new relative/path/to/content.md
|
||||
|
||||
For example, if I wanted to create a new post inside the post section, I would type:
|
||||
|
||||
hugo new post/my-newest-post.md
|
||||
|
||||
|
||||
## Defining a content type
|
||||
|
||||
Creating a new content type is easy in Hugo. You simply provide the templates and archetype
|
||||
that the new type will use. You only need to define the templates, archetypes and/or views
|
||||
unique to that content type. Hugo will fall back to using the general templates and default archetype
|
||||
whenever a specific file is not present.
|
||||
|
||||
*Remember, all of the following are optional:*
|
||||
|
||||
### Create Type Directory
|
||||
Create a directory with the name of the type in `/layouts`. Type is always singular. *E.g. `/layouts/post`*.
|
||||
|
||||
### Create single template
|
||||
Create a file called `single.html` inside your directory. *E.g. `/layouts/post/single.html`*.
|
||||
|
||||
### Create list template
|
||||
Create a file called `post.html` inside the section lists template directory, `/layouts/section`. *E.g. `/layouts/section/post.html`*.
|
||||
|
||||
### Create views
|
||||
Many sites support rendering content in a few different ways, for
|
||||
instance, a single page view and a summary view to be used when
|
||||
displaying a [list of contents on a single page](/templates/list).
|
||||
Hugo makes no assumptions here about how you want to display your
|
||||
content, and will support as many different views of a content type
|
||||
as your site requires. All that is required for these additional
|
||||
views is that a template exists in each `/layouts/TYPE` directory
|
||||
with the same name.
|
||||
|
||||
### Create a corresponding archetype
|
||||
|
||||
Create a file called <code><em>type</em>.md</code> in the `/archetypes` directory. *E.g. `/archetypes/post.md`*.
|
||||
|
||||
More details about archetypes can be found at the [archetypes docs](/content/archetypes/).
|
||||
@@ -1,118 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /doc/using-index-md/
|
||||
lastmod: 2017-02-22
|
||||
date: 2017-02-22
|
||||
linktitle: Using _index.md
|
||||
menu:
|
||||
main:
|
||||
parent: content
|
||||
prev: /content/example
|
||||
next: /themes/overview
|
||||
notoc: true
|
||||
title: Using _index.md
|
||||
weight: 70
|
||||
---
|
||||
# \_index.md and 'Everything is a Page'
|
||||
|
||||
As of version v0.18 Hugo now treats '[everything as a page](http://bepsays.com/en/2016/12/19/hugo-018/)'. This allows you to add content and frontmatter to any page - including List pages like [Sections](/content/sections/), [Taxonomies](/taxonomies/overview/), [Taxonomy Terms pages](/templates/terms/) and even to potential 'special case' pages like the [Home page](/templates/homepage/).
|
||||
|
||||
In order to take advantage of this behaviour you need to do a few things.
|
||||
|
||||
1. Create an \_index.md file that contains the frontmatter and content you would like to apply.
|
||||
|
||||
2. Place the \_index.md file in the correct place in the directory structure.
|
||||
|
||||
3. Ensure that the respective template is configured to display `{{ .Content }}` if you wish for the content of the \_index.md file to be rendered on the respective page.
|
||||
|
||||
## How \_index.md pages work
|
||||
|
||||
Before continuing it's important to know that this page must reference certain templates to describe how the \_index.md page will be rendered. Hugo has a multitude of possible templates that can be used and placed in various places (think theme templates for instance). For simplicity/brevity the default/top level template location will be used to refer to the entire range of places the template can be placed.
|
||||
|
||||
If this is confusing or you are unfamiliar with Hugo's template hierarchy, visit the various template pages listed below. You may need to find the 'active' template responsible for any particular page on your own site by going through the template hierarchy and matching it to your particular setup/theme you are using.
|
||||
|
||||
- [Home page template](/templates/homepage/)
|
||||
- [Content List templates](/templates/list/)
|
||||
- [Single Content templates](/templates/content/)
|
||||
- [Taxonomy Terms templates](/templates/terms/)
|
||||
|
||||
Now that you've got a handle on templates lets recap some Hugo basics to understand how to use an \_index.md file with a List page.
|
||||
|
||||
1. Sections and Taxonomies are 'List' pages, NOT single pages.
|
||||
2. List pages are rendered using the template hierarchy found in the [Content - List Template](/templates/list/) docs.
|
||||
3. The Home page, though technically a List page, can have [its own template](/templates/homepage/) at layouts/index.html rather than \_default/list.html. Many themes exploit this behaviour so you are likely to encounter this specific use case.
|
||||
4. Taxonomy terms pages are 'lists of metadata' not lists of content, so [have their own templates](/templates/terms/).
|
||||
|
||||
Let's put all this information together:
|
||||
|
||||
> **\_index.md files used in List pages, Terms pages or the Home page are NOT rendered as single pages or with Single Content templates.**
|
||||
|
||||
> **All pages, including List pages, can have frontmatter and frontmatter can have markdown content - meaning \_index.md files are the way to _provide_ frontmatter and content to the respective List/Terms/Home page.**
|
||||
|
||||
Here are a couple of examples to make it clearer...
|
||||
|
||||
| \_index.md location | Page affected | Rendered by |
|
||||
| ------------------- | ------------ | ----------- |
|
||||
| /content/post/\_index.md | site.com/post/ | /layouts/section/post.html |
|
||||
| /content/categories/hugo/\_index.md | site.com/categories/hugo/ | /layouts/taxonomy/hugo.html |
|
||||
|
||||
## Why \_index.md files are used
|
||||
|
||||
With a Single page such as a post it's possible to add the frontmatter and content directly into the .md page itself. With List/Terms/Home pages this is not possible so \_index.md files can be used to provide that frontmatter/content to them.
|
||||
|
||||
## How to display content from \_index.md files
|
||||
|
||||
From the information above it should follow that content within an \_index.md file won't be rendered in its own Single Page, instead it'll be made available to the respective List/Terms/Home page.
|
||||
|
||||
To **_actually render that content_** you need to ensure that the relevant template responsible for rendering the List/Terms/Home page contains (at least) `{{ .Content }}`.
|
||||
|
||||
This is the way to actually display the content within the \_index.md file on the List/Terms/Home page.
|
||||
|
||||
A very simple/naive example of this would be:
|
||||
|
||||
```html
|
||||
{{ partial "header.html" . }}
|
||||
<main>
|
||||
{{ .Content }}
|
||||
{{ range .Paginator.Pages }}
|
||||
{{ partial "summary.html" . }}
|
||||
{{ end }}
|
||||
{{ partial "pagination.html" . }}
|
||||
</main>
|
||||
{{ partial "sidebar.html" . }}
|
||||
{{ partial "footer.html" . }}
|
||||
```
|
||||
|
||||
You can see `{{ .Content }}` just after the `<main>` element. For this particular example, the content of the \_index.md file will show before the main list of summaries.
|
||||
|
||||
## Where to organise an \_index.md file
|
||||
|
||||
To add content and frontmatter to the home page, a section, a taxonomy or a taxonomy terms listing, add a markdown file with the base name \_index on the relevant place on the file system.
|
||||
|
||||
```bash
|
||||
└── content
|
||||
├── _index.md
|
||||
├── categories
|
||||
│ ├── _index.md
|
||||
│ └── photo
|
||||
│ └── _index.md
|
||||
├── post
|
||||
│ ├── _index.md
|
||||
│ └── firstpost.md
|
||||
└── tags
|
||||
├── _index.md
|
||||
└── hugo
|
||||
└── _index.md
|
||||
```
|
||||
|
||||
In the above example \_index.md pages have been added to each section/taxonomy.
|
||||
|
||||
An \_index.md file has also been added in the top level 'content' directory.
|
||||
|
||||
### Where to place \_index.md for the Home page
|
||||
|
||||
Hugo themes are designed to use the 'content' directory as the root of the website, so adding an \_index.md file here (like has been done in the example above) is how you would add frontmatter/content to the home page.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
title: Contributing to the Hugo Project
|
||||
linktitle: Contributing to Hugo
|
||||
description: Contribute to Hugo development and documentation.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [contribute]
|
||||
#tags: []
|
||||
menu:
|
||||
docs:
|
||||
parent: "contribute"
|
||||
weight: 01
|
||||
weight: 01 #rem
|
||||
draft: false
|
||||
slug:
|
||||
aliases: [/tutorials/how-to-contribute-to-hugo/,/community/contributing/]
|
||||
toc: false
|
||||
---
|
||||
|
||||
Hugo relies heavily on the enthusiasm and participation of the open-source community. We need your support in both its development and documentation.
|
||||
|
||||
Hugo's contribution guidelines are [detailed in a `CONTRIBUTING.md`](https://github.com/gohugoio/hugo/blob/master/CONTRIBUTING.md) in the Hugo source repository on GitHub.
|
||||
+134
-74
@@ -1,46 +1,92 @@
|
||||
---
|
||||
date: 2016-04-03T13:21:56+02:00
|
||||
linktitle: How to contribute
|
||||
title: Contribute to Hugo Development
|
||||
linktitle: Development
|
||||
description: Hugo relies heavily on contributions from the open source community.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [contribute]
|
||||
#tags: [dev,open source]
|
||||
authors: [digitalcraftsman]
|
||||
menu:
|
||||
main:
|
||||
parent: tutorials
|
||||
next: /tutorials/installing-on-mac/
|
||||
prev: /tutorials/github-pages-blog/
|
||||
title: How to contribute to Hugo
|
||||
docs:
|
||||
parent: "contribute"
|
||||
weight: 10
|
||||
weight: 10
|
||||
sections_weight: 10
|
||||
draft: false
|
||||
aliases: [/contribute/development/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
## Introduction
|
||||
|
||||
Hugo is an open source project and lives by the work of its [contributors](https://github.com/gohugoio/hugo/graphs/contributors). Help to make Hugo even more awesome. There are plenty of [open issues](https://github.com/gohugoio/hugo/issues) on GitHub and we need your help.
|
||||
Hugo is an open-source project and lives by the work of its [contributors][]. There are plenty of [open issues][issues], and we need your help to make Hugo even more awesome. You don't need to be a Go guru to contribute to the project's development.
|
||||
|
||||
This tutorial is intended for people who are new to Git, GitHub or open source projects in general. It should help to overcome most of the barriers that newcomers encounter. It describes step by step what you need to do.
|
||||
## Assumptions
|
||||
|
||||
For any kind of questions please take a look at our [forum](https://discourse.gohugo.io/).
|
||||
This contribution guide takes a step-by-step approach in hopes of helping newcomers. Therefore, we only assume the following:
|
||||
|
||||
* You are new to Git or open-source projects in general
|
||||
* You are a fan of Hugo and enthusiastic about contributing to the project
|
||||
|
||||
{{% note "Additional Questions?" %}}
|
||||
If you're struggling at any point in this contribution guide, reach out to the Hugo community in [Hugo's Discussion forum](https://discourse.gohugo.io).
|
||||
{{% /note %}}
|
||||
|
||||
## Install Go
|
||||
|
||||
The installation of Go should take only a few minutes. [Download](https://golang.org/dl/) the latest stable version of Go and follow the official [installation guide](https://golang.org/doc/install).
|
||||
The installation of Go should take only a few minutes. You have more than one option to get Go up and running on your machine.
|
||||
|
||||
Let's confirm the correct installation of Go. Open a terminal (or command line under Windows). Execute `go version` and you should see the version number of your Go installation. Next, make sure that you setup the `GOPATH` as described in the installation guide.
|
||||
If you are having trouble following the installation guides for go, check out [Go Bootcamp, which contains setups for every platform][gobootcamp] or reach out to the Hugo community in the [Hugo Discussion Forums][forums].
|
||||
|
||||
You can print the `GOPATH` with `echo $GOPATH`. You should see a non-empty string containing a valid path to your Go workspace.
|
||||
### Install Go From Source
|
||||
|
||||
### GVM as alternative
|
||||
[Download the latest stable version of Go][godl] and follow the official [Golang installation guide][goinstall].
|
||||
|
||||
More experienced users can use the [Go Version Manager](https://github.com/moovweb/gvm), or GVM for short. It allows you to switch between different Go versions *on the same machine*. Probably you don't need this feature. But you can easily upgrade to a new released Go version with a few commands.
|
||||
Once you're finished installing Go, let's confirm everything is working correctly. Open a terminal---or command line under Windows--and type the following:
|
||||
|
||||
This is handy if you follow the developement of Hugo over a longer period of time. Future versions of Hugo will usually be compiled with the latest version of Go. Sooner or later you have to upgrade if you want to keep up.
|
||||
```bash
|
||||
go version
|
||||
```
|
||||
|
||||
You should see something similar to the following written to the console. Note that the version here reflects the most recent version of Go as of the last update for this page:
|
||||
|
||||
## Create an account on GitHub
|
||||
```bash
|
||||
go version go1.8 darwin/amd64
|
||||
```
|
||||
|
||||
Next, make sure that you set up your `GOPATH` [as described in the installation guide][setupgopath].
|
||||
|
||||
You can print the `GOPATH` with `echo $GOPATH`. You should see a non-empty string containing a valid path to your Go workspace; .e.g.:
|
||||
|
||||
```bash
|
||||
/Users/<yourusername>/Code/go
|
||||
```
|
||||
|
||||
### Install Go with Homebrew
|
||||
|
||||
If you are a macOS user and have [Homebrew](https://brew.sh/) installed on your machine, installing Go is as simple as the following command:
|
||||
|
||||
{{% code file="install-go.sh" %}}
|
||||
```bash
|
||||
brew install go
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
### Install Go via GVM
|
||||
|
||||
More experienced users can use the [Go Version Manager][gvm] (GVM). GVM allows you to switch between different Go versions *on the same machine*. If you're a beginner, you probably don't need this feature. However, GVM makes it easy to upgrade to a new released Go version with just a few commands.
|
||||
|
||||
GVM comes in especially handy if you follow the development of Hugo over a longer period of time. Future versions of Hugo will usually be compiled with the latest version of Go. Sooner or later, you will have to upgrade if you want to keep up.
|
||||
|
||||
## Create a GitHub Account
|
||||
|
||||
If you're going to contribute code, you'll need to have an account on GitHub. Go to [www.github.com/join](https://github.com/join) and set up a personal account.
|
||||
|
||||
## Install Git on Your System
|
||||
|
||||
## Install Git on your system
|
||||
|
||||
You will need to install Git. This tutorial assumes basic knowledge about Git. Refer to this excellent [Git book](https://git-scm.com/) if you are not sure where to begin. The used terminology will be explained with annotations.
|
||||
You will need to have Git installed on your computer to contribute to Hugo development. Teaching git is outside the scope of the Hugo docs, but if you're looking for an excellent reference to learn the basics of Git, we recommend the [Git book][gitbook] if you are not sure where to begin. The used terminology will be explained with annotations.
|
||||
|
||||
Git is a [version control system](https://en.wikipedia.org/wiki/Version_control) to track the changes of source code. Hugo depends on smaller third-party packages that are used to extend the functionality. We use them because we don't want to reinvent the wheel.
|
||||
|
||||
@@ -54,17 +100,17 @@ Finally, check again with `git version` if Git was installed successfully.
|
||||
|
||||
There are several [GUI clients](https://git-scm.com/downloads/guis) that help you to operate Git. Not all are available for all operating systems and maybe differ in their usage. Thus, so we will use the command line since the commands are everywhere the same.
|
||||
|
||||
### Install Hub on your system (optional)
|
||||
### Install Hub on Your System (Optional)
|
||||
|
||||
Hub is a great tool for working with GitHub. The main site for it is [www.hub.github.com](https://hub.github.com/). Feel free to install this little Git wrapper.
|
||||
|
||||
On a Mac, install Hub using brew:
|
||||
On a Mac, you can install [Hub](https://github.com/github/hub) using [Homebrew](https://brew.sh):
|
||||
|
||||
```sh
|
||||
brew install hub
|
||||
```
|
||||
|
||||
Create an alias (in Bash) so that typing git actually runs Hub:
|
||||
Now we'll create an [alias in Bash](http://tldp.org/LDP/abs/html/aliases.html) so that typing `git` actually runs `Hub`:
|
||||
|
||||
```sh
|
||||
echo "alias git='hub'" >> ~/.bash_profile
|
||||
@@ -77,22 +123,11 @@ git version 2.6.3
|
||||
hub version 2.2.2
|
||||
```
|
||||
|
||||
|
||||
## Set up your working copy
|
||||
|
||||
The working copy is set up locally on your computer. It's what you'll edit, compile, and end up pushing back to GitHub. The main steps are cloning the repository and creating your fork as a remote.
|
||||
|
||||
### Vendored Dependencies
|
||||
|
||||
Hugo uses [govendor](https://github.com/kardianos/govendor) to vendor dependencies, but we don't commit the vendored packages themselves to the Hugo git repository.
|
||||
Therefore, a simple `go get` is not supported since `go get` is not vendor-aware.
|
||||
You **must use govendor** to fetch and manage Hugo's dependencies.
|
||||
|
||||
```sh
|
||||
go get -v -u github.com/kardianos/govendor
|
||||
```
|
||||
|
||||
### Fetch the Sources from GitHub
|
||||
### Clone the repository
|
||||
|
||||
We assume that you've set up your `GOPATH` (see the section above if you're unsure about this). You should now copy the Hugo repository down to your computer. You'll hear this called "clone the repo". GitHub's [help pages](https://help.github.com/articles/cloning-a-repository/) give us a short explanation:
|
||||
|
||||
@@ -100,15 +135,15 @@ We assume that you've set up your `GOPATH` (see the section above if you're unsu
|
||||
|
||||
We're going to clone the [master Hugo repository](https://github.com/gohugoio/hugo). That seems counter-intuitive, since you won't have commit rights on it. But it's required for the Go workflow. You'll work on a copy of the master and push your changes to your own repository on GitHub.
|
||||
|
||||
So, let's clone that master repository with govendor:
|
||||
So, let's clone that master repository:
|
||||
|
||||
```sh
|
||||
govendor get -v github.com/gohugoio/hugo
|
||||
go get -v -u github.com/gohugoio/hugo
|
||||
```
|
||||
|
||||
### Fork the repository
|
||||
|
||||
If you're not familiar with this term, GitHub's [help pages](https://help.github.com/articles/fork-a-repo/) provide again a simple explanation:
|
||||
If you're not fimiliar with this term, GitHub's [help pages](https://help.github.com/articles/fork-a-repo/) provide again a simple explanation:
|
||||
|
||||
> A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project.
|
||||
|
||||
@@ -116,11 +151,11 @@ If you're not familiar with this term, GitHub's [help pages](https://help.github
|
||||
|
||||
Open the [Hugo repository](https://github.com/gohugoio/hugo) on GitHub and click on the "Fork" button in the top right.
|
||||
|
||||

|
||||

|
||||
|
||||
Now open your fork repository on GitHub and copy the remote url of your fork. You can choose between HTTPS and SSH as protocol that Git should use for the following operations. HTTPS works always [if you're not sure](https://help.github.com/articles/which-remote-url-should-i-use/).
|
||||
|
||||

|
||||

|
||||
|
||||
Switch back to the terminal and move into the directory of the cloned master repository from the last step.
|
||||
|
||||
@@ -155,14 +190,13 @@ git remote -v
|
||||
The output should look similar:
|
||||
|
||||
```sh
|
||||
digitalcraftsman git@github.com:digitalcraftsman/hugo.git (fetch)
|
||||
digitalcraftsman git@github.com:digitalcraftsman/hugo.git (push)
|
||||
origin https://github.com/gohugoio/hugo (fetch)
|
||||
origin https://github.com/gohugoio/hugo (push)
|
||||
digitalcraftsman git@github.com:digitalcraftsman/hugo.git (fetch)
|
||||
digitalcraftsman git@github.com:digitalcraftsman/hugo.git (push)
|
||||
origin https://github.com/gohugoio/hugo (fetch)
|
||||
origin https://github.com/gohugoio/hugo (push)
|
||||
```
|
||||
|
||||
|
||||
## The contribution workflow
|
||||
## The Hugo Git Contribution Workflow
|
||||
|
||||
### Create a new branch
|
||||
|
||||
@@ -183,34 +217,32 @@ git checkout -b <BRANCH-NAME>
|
||||
|
||||
You can check on which branch your are with `git branch`. You should see a list of all local branches. The current branch is indicated with a little asterisk.
|
||||
|
||||
### Contributing to the documentation
|
||||
### Contribute to Documentation
|
||||
|
||||
Perhaps you want to start contributing to the docs. Then you can ignore most of the following steps. You can find the documentation within the cloned repository in the subfolder `docs`. Change the directory with `cd docs`. Install the [latest release]({{< relref "overview/installing.md" >}}). Or read on and build Hugo from source.
|
||||
Perhaps you want to start contributing to the Hugo docs. If so, you can ignore most of the following steps and focus on the `/docs` directory within your newly cloned repository. You can change directories into the Hugo docs using `cd docs`.
|
||||
|
||||
You can start Hugo's built-in server via `hugo server`. Browse the documentation by entering [http://localhost:1313](http://localhost:1313) in the address bar of your browser. The server automatically updates the page if you change its content.
|
||||
You can start Hugo's built-in server via `hugo server`. Browse the documentation by entering [http://localhost:1313](http://localhost:1313) in the address bar of your browser. The server automatically updates the page whenever you change content.
|
||||
|
||||
### Building Hugo
|
||||
We have developed a [separate Hugo documentation contribution guide][docscontrib] for more information on how the Hugo docs are built, organized, and improved by the generosity of people like you.
|
||||
|
||||
### Build Hugo
|
||||
|
||||
While making changes in the codebase it's a good idea to build the binary to test them:
|
||||
|
||||
```sh
|
||||
make hugo
|
||||
go build -o hugo main.go
|
||||
```
|
||||
|
||||
### Testing
|
||||
|
||||
### Test
|
||||
Sometimes changes on the codebase can cause unintended side effects. Or they don't work as expected. Most functions have their own test cases. You can find them in files ending with `_test.go`.
|
||||
|
||||
```sh
|
||||
make check
|
||||
```
|
||||
Make sure the commands `go test ./...` passes, and `go build` completes.
|
||||
|
||||
### Formatting
|
||||
|
||||
The Go code styleguide maybe is opinionated but it ensures that the codebase looks the same, regardless who wrote the code. Go comes with its own formatting tool. Let's apply the styleguide to our additions:
|
||||
### Formatting
|
||||
The Go code styleguide maybe is opiniated but it ensures that the codebase looks the same, regardless who wrote the code. Go comes with its own formatting tool. Let's apply the styleguide to our addtions:
|
||||
|
||||
```sh
|
||||
govendor fmt +local
|
||||
go fmt ./...
|
||||
```
|
||||
|
||||
Once you made your additions commit your changes. Make sure that you follow our [code contribution guidelines](https://github.com/gohugoio/hugo/blob/master/CONTRIBUTING.md):
|
||||
@@ -229,7 +261,7 @@ You noticed some commit messages don't fulfill the code contribution guidelines
|
||||
|
||||
If you are unsure what a command does leave the commit as it is. We can fix your commits later in the pull request.
|
||||
|
||||
#### Modifying the last commit
|
||||
#### Modify the last commit
|
||||
|
||||
Let's say you want to modify the last commit message. Run the following command and replace the current message:
|
||||
|
||||
@@ -251,9 +283,13 @@ git add --all
|
||||
git commit --amend
|
||||
```
|
||||
|
||||
#### Modifying multiple commits
|
||||
#### Modify multiple commits
|
||||
|
||||
This is a bit more advanced. Git allows you to [rebase](https://git-scm.com/docs/git-rebase) commits interactively. In other words: it allows you to rewrite the commit history. **Take care of your actions. They can cause unintended changes. Skip this section if you're not sure!**
|
||||
{{% warning "Be Careful Modifying Multiple Commits"%}}
|
||||
Modifications such as those described in this section can have serious unintended consequences. Skip this section if you're not sure!
|
||||
{{% /warning %}}
|
||||
|
||||
This is a bit more advanced. Git allows you to [rebase](https://git-scm.com/docs/git-rebase) commits interactively. In other words: it allows you to rewrite the commit history.
|
||||
|
||||
```sh
|
||||
git rebase --interactive @~6
|
||||
@@ -274,7 +310,6 @@ In the case above we should merge the last to commits in the commit of this tuto
|
||||
|
||||
All operations are written before the commit message. Replace "pick" with an operation. In this case `squash` or `s` for short:
|
||||
|
||||
|
||||
```sh
|
||||
pick 80d02a1 tpl: Add hasPrefix to the template funcs' "smoke test"
|
||||
pick aaee038 tpl: Sort the smoke tests
|
||||
@@ -297,7 +332,7 @@ squash 33c8973 Begin workflow
|
||||
squash 3502f2e Refactoring and typo fixes
|
||||
```
|
||||
|
||||
Close the editor. It should open again with a new tab. A text is instructing you to define a new commit message for the last two commits that should be merged (a.k.a. squashed). Save the file (<kbd>CTRL</kbd>+<kbd>S</kbd>) and close the editor again.
|
||||
Close the editor. It should open again with a new tab. A text is instructing you to define a new commit message for the last two commits that should be merged (aka "squashed"). Save the file with <kbd>CTRL</kbd>+<kbd>S</kbd> and close the editor again.
|
||||
|
||||
A last time a new tab opens. Enter a new commit message and save again. Your terminal should contain a status message. Hopefully this one:
|
||||
|
||||
@@ -309,7 +344,7 @@ Check the commit log if everything looks as expected. Should an error occur you
|
||||
|
||||
### Push commits
|
||||
|
||||
To push our commits to the fork on GitHub we need to specify a destination. A destination is defined by the remote and a branch name. Earlier, the defined that the remote url of our fork is the same as our GitHub handle, in my case `digitalcraftsman`. The branch should have the same as our local one. This makes it easy to identify corresponding branches.
|
||||
To push our commits to the fork on GitHub we need to speficy a destination. A destination is defined by the remote and a branch name. Earlier, the defined that the remote url of our fork is the same as our GitHub handle, in my case `digitalcraftsman`. The branch should have the same as our local one. This makes it easy to identify corresponding branches.
|
||||
|
||||
```sh
|
||||
git push --set-upstream <YOUR-GITHUB-USERNAME> <BRANCHNAME>
|
||||
@@ -319,14 +354,13 @@ Now Git knows the destination. Next time when you to push commits you just need
|
||||
|
||||
If you modified your commit history in the last step GitHub will reject your try to push. This is a safety-feature because the commit history isn't the same and new commits can't be appended as usual. You can enforce this push explicitly with `git push --force`.
|
||||
|
||||
|
||||
## Open a pull request
|
||||
|
||||
We made a lot of progress. Good work. In this step we finally open a pull request to submit our additions. Open the [Hugo master repository](https://github.com/gohugoio/hugo/) on GitHub in your browser.
|
||||
|
||||
You should find a green button labeled with "New pull request". But GitHub is clever and probably suggests you a pull request like in the beige box below:
|
||||
You should find a green button labeld with "New pull request". But GitHub is clever and probably suggests you a pull request like in the beige box below:
|
||||
|
||||
<img src="/img/tutorials/how-to-contribute-to-hugo/open-pull-request.png" alt="Open a pull request">
|
||||

|
||||
|
||||
The new page summaries the most important information of your pull request. Scroll down and you find the additions of all your commits. Make sure everything looks as expected and click on "Create pull request".
|
||||
|
||||
@@ -334,19 +368,45 @@ The new page summaries the most important information of your pull request. Scro
|
||||
|
||||
Last but not least you should accept the contributor license agreement (CLA). A new comment should be added automatically to your pull request. Click on the yellow badge, accept the agreement and authenticate yourself with your GitHub account. It just takes a few clicks and only needs to be done once.
|
||||
|
||||
<img src="/img/tutorials/how-to-contribute-to-hugo/accept-cla.png" alt="Accept the CLA">
|
||||
|
||||

|
||||
|
||||
### Automatic builds
|
||||
|
||||
We use the [Travis CI loop](https://travis-ci.org/gohugoio/hugo) (Linux and OS X) and [AppVeyor](https://ci.appveyor.com/project/gohugoio/hugo/branch/master) (Windows) to compile Hugo with your additions. This should ensure that everything works as expected before merging your pull request. This in most cases only relevant if you made changes to the codebase of Hugo.
|
||||
|
||||
<img src="/img/tutorials/how-to-contribute-to-hugo/ci-errors.png" alt="Automic builds and their status">
|
||||

|
||||
|
||||
Above you can see that Travis wasn't able to compile the changes in this pull request. Click on "Details" and try to investigate why the build failed. But it doesn't have to be your fault. Mostly, the `master` branch that we used as foundation for your pull request should build without problems.
|
||||
|
||||
If you have questions leave a comment in the pull request. We are willing to assist you.
|
||||
If you have questions, leave a comment in the pull request. We are willing to assist you.
|
||||
|
||||
## Where to start?
|
||||
|
||||
Thank you for reading this tutorial. Hopefully, we see you again on GitHub. There are plenty of [open issues](https://github.com/gohugoio/hugo/issues) on GitHub. Feel free to open an issue if you think you found a bug or you have a new idea to improve Hugo. We are happy to hear from you.
|
||||
Thank you for reading through this contribution guide. Hopefully, we will see you again soon on GitHub. There are plenty of [open issues][issues] for you to help with.
|
||||
|
||||
Feel free to [open an issue][newissue] if you think you found a bug or you have a new idea to improve Hugo. We are happy to hear from you.
|
||||
|
||||
## Additional References for Learning Git and Golang
|
||||
|
||||
* [Codecademy's Free "Learn Git" Course][codecademy] (Free)
|
||||
* [Code School and GitHub's "Try Git" Tutorial][trygit] (Free)
|
||||
* [The Git Book][gitbook] (Free)
|
||||
* [Go Bootcamp][gobootcamp]
|
||||
* [GitHub Pull Request Tutorial, Thinkful][thinkful]
|
||||
|
||||
|
||||
[codecademy]: https://www.codecademy.com/learn/learn-git
|
||||
[contributors]: https://github.com/gohugoio/hugo/graphs/contributors
|
||||
[docscontrib]: /contribute/documentation/
|
||||
[forums]: https://discourse.gohugo.io
|
||||
[gitbook]: https://git-scm.com/
|
||||
[gobootcamp]: http://www.golangbootcamp.com/book/get_setup
|
||||
[godl]: https://golang.org/dl/
|
||||
[goinstall]: https://golang.org/doc/install
|
||||
[gvm]: https://github.com/moovweb/gvm
|
||||
[issues]: https://github.com/gohugoio/hugo/issues
|
||||
[newissue]: https://github.com/gohugoio/hugo/issues/new
|
||||
[releases]: /getting-started/
|
||||
[setupgopath]: https://golang.org/doc/code.html#Workspaces
|
||||
[thinkful]: https://www.thinkful.com/learn/github-pull-request-tutorial/
|
||||
[trygit]: https://try.github.io/levels/1/challenges/1
|
||||
@@ -0,0 +1,376 @@
|
||||
---
|
||||
title: Contribute to the Hugo Docs
|
||||
linktitle: Documentation
|
||||
description: Documentation is an integral part of any open source project. The Hugo docs are as much a work in progress as the source it attempts to cover.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [contribute]
|
||||
#tags: [docs,documentation,community, contribute]
|
||||
menu:
|
||||
docs:
|
||||
parent: "contribute"
|
||||
weight: 20
|
||||
weight: 20
|
||||
sections_weight: 20
|
||||
draft: false
|
||||
aliases: [/contribute/docs/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
## Create Your Fork
|
||||
|
||||
It's best to make changes to the Hugo docs on your local machine to check for consistent visual styling. Make sure you've created a fork of [hugoDocs](https://github.com/gohugoio/hugoDocs) on GitHub and cloned the repository locally on your machine. For more information, you can see [GitHub's documentation on "forking"][ghforking] or follow along with [Hugo's development contribution guide][hugodev].
|
||||
|
||||
You can then create a separate branch for your additions. Be sure to choose a descriptive branch name that best fits the type of content. The following is an example of a branch name you might use for adding a new website to the showcase:
|
||||
|
||||
```git
|
||||
git checkout -b jon-doe-showcase-addition
|
||||
```
|
||||
|
||||
## Add New Content
|
||||
|
||||
The Hugo docs make heavy use of Hugo's [archetypes][] feature. All content sections in Hugo documentation have an assigned archetype.
|
||||
|
||||
Adding new content to the Hugo docs follows the same pattern, regardless of the content section:
|
||||
|
||||
```
|
||||
hugo new <DOCS-SECTION>/<new-content-lowercase>.md
|
||||
```
|
||||
|
||||
{{% note "`title:`, `date:`, and Field Order" %}}
|
||||
`title` and `date` fields are added automatically when using archetypes via `hugo new`. Do not be worried if the order of the new file's front matter fields on your local machine is different than that of the examples provided in the Hugo docs. This is a known issue [(#452)](https://github.com/gohugoio/hugo/issues/452).
|
||||
{{% /note %}}
|
||||
|
||||
### Add a New Function
|
||||
|
||||
Once you have cloned the Hugo repository, you can create a new function via the following command. Keep the file name lowercase.
|
||||
|
||||
```
|
||||
hugo new functions/newfunction.md
|
||||
```
|
||||
|
||||
The archetype for `functions` according to the Hugo theme is as follows:
|
||||
|
||||
{{% code file="archetypes/functions.md" %}}
|
||||
```yaml
|
||||
{{< readfile file="/themes/gohugoioTheme/archetypes/functions.md">}}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
#### New Function Required Fields
|
||||
|
||||
Here is a review of the front matter fields automatically generated for you using `hugo new functions/*`:
|
||||
|
||||
***`title`***
|
||||
: this will be auto-populated in all lowercase when you use `hugo new` generator.
|
||||
|
||||
***`linktitle`***
|
||||
: the function's actual casing (e.g., `replaceRE` rather than `replacere`).
|
||||
|
||||
***`description`***
|
||||
: a brief description used to populate the [Functions Quick Reference](/functions/).
|
||||
|
||||
`categories`
|
||||
: currently auto-populated with 'functions` for future-proofing and portability reasons only; ignore this field.
|
||||
|
||||
`tags`
|
||||
: only if you think it will help end users find other related functions
|
||||
|
||||
`signature`
|
||||
: this is a signature/syntax definition for calling the function (e.g., `apply SEQUENCE FUNCTION [PARAM...]`).
|
||||
|
||||
`workson`
|
||||
: acceptable values include `lists`,`taxonomies`, `terms`, `groups`, and `files`.
|
||||
|
||||
`hugoversion`
|
||||
: the version of Hugo that will ship with this new function.
|
||||
|
||||
`relatedfuncs`
|
||||
: other [templating functions][] you feel are related to your new function to help fellow Hugo users.
|
||||
|
||||
`{{.Content}}`
|
||||
: an extended description of the new function; examples are not only welcomed but encouraged.
|
||||
|
||||
In the body of your function, expand the short description used in the front matter. Include as many examples as possible, and leverage the Hugo docs [`code` shortcode](#adding-code-blocks). If you are unable to add examples but would like to solicit help from the Hugo community, add `needsexample: true` to your front matter.
|
||||
|
||||
### Add a New Tutorial
|
||||
|
||||
Once you have cloned the Hugo repository, you can create a new tutorial via the following command. Name the markdown file accordingly:
|
||||
|
||||
```
|
||||
hugo new tutorials/my-new-tutorial.md
|
||||
```
|
||||
|
||||
The archetype for the `tutorials` content type is as follows:
|
||||
|
||||
{{% code file="archetypes/tutorials.md" %}}
|
||||
```yaml
|
||||
{{< readfile file="/themes/gohugoioTheme/archetypes/tutorials.md">}}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
## Add Code Blocks
|
||||
|
||||
Code blocks are crucial for providing examples of Hugo's new features to end users of the Hugo docs. Whenever possible, create examples that you think Hugo users will be able to implement in their own projects.
|
||||
|
||||
### Standard Syntax
|
||||
|
||||
Across all pages on the Hugo docs, the typical triple-back-tick markdown syntax is used. If you do not want to take the extra time to implement the following code block shortcodes, please use standard GitHub-flavored markdown. The Hugo docs use a version of [highlight.js](https://highlightjs.org/) with a specific set of languages.
|
||||
|
||||
Your options for languages are `xml`/`html`, `go`/`golang`, `md`/`markdown`/`mkd`, `handlebars`, `apache`, `toml`, `yaml`, `json`, `css`, `asciidoc`, `ruby`, `powershell`/`ps`, `scss`, `sh`/`zsh`/`bash`/`git`, `http`/`https`, and `javascript`/`js`.
|
||||
|
||||
````html
|
||||
```html
|
||||
<h1>Hello world!</h1>
|
||||
```
|
||||
````
|
||||
|
||||
### Code Block Shortcode
|
||||
|
||||
The Hugo documentation comes with a very robust shortcode for adding interactive code blocks.
|
||||
|
||||
{{% note %}}
|
||||
With the `code` shortcodes, *you must include triple back ticks and a language declaration*. This was done by design so that the shortcode wrappers were easily added to legacy documentation and will be that much easier to remove if needed in future versions of the Hugo docs.
|
||||
{{% /note %}}
|
||||
|
||||
### `code`
|
||||
|
||||
`code` is the Hugo docs shortcode you'll use most often. `code` requires has only one named parameter: `file`. Here is the pattern:
|
||||
|
||||
````markdown
|
||||
{{%/* code file="smart/file/name/with/path.html" download="download.html" copy="true" */%}}
|
||||
```language
|
||||
A whole bunch of coding going on up in here!
|
||||
```
|
||||
{{%/* /code */%}}
|
||||
````
|
||||
|
||||
The following are the arguments passed into `code`:
|
||||
|
||||
***`file`***
|
||||
: the only *required* argument. `file` is needed for styling but also plays an important role in helping users create a mental model around Hugo's directory structure. Visually, this will be displayed as text in the top left of the code block.
|
||||
|
||||
`download`
|
||||
: if omitted, this will have no effect on the rendered shortcode. When a value is added to `download`, it's used as the filename for a downloadable version of the code block.
|
||||
|
||||
`copy`
|
||||
: a copy button is added automatically to all `code` shortcodes. If you want to keep the filename and styling of `code` but don't want to encourage readers to copy the code (e.g., a "Do not do" snippet in a tutorial), use `copy="false"`.
|
||||
|
||||
#### Example `code` Input
|
||||
|
||||
This example HTML code block tells Hugo users the following:
|
||||
|
||||
1. This file *could* live in `layouts/_default`, as demonstrated by `layouts/_default/single.html` as the value for `file`.
|
||||
2. This snippet is complete enough to be downloaded and implemented in a Hugo project, as demonstrated by `download="single.html"`.
|
||||
|
||||
````md
|
||||
{{%/* code file="layouts/_default/single.html" download="single.html" */%}}
|
||||
```html
|
||||
{{ define "main" }}
|
||||
<main>
|
||||
<article>
|
||||
<header>
|
||||
<h1>{{.Title}}</h1>
|
||||
{{with .Params.subtitle}}
|
||||
<span>{{.}}</span>
|
||||
</header>
|
||||
<div>
|
||||
{{.Content}}
|
||||
</div>
|
||||
<aside>
|
||||
{{.TableOfContents}}
|
||||
</aside>
|
||||
</article>
|
||||
</main>
|
||||
{{ end }}
|
||||
```
|
||||
{{%/* /code */%}}
|
||||
````
|
||||
|
||||
##### Example 'code' Display
|
||||
|
||||
The output of this example will render to the Hugo docs as follows:
|
||||
|
||||
{{% code file="layouts/_default/single.html" download="single.html" %}}
|
||||
```html
|
||||
{{ define "main" }}
|
||||
<main>
|
||||
<article>
|
||||
<header>
|
||||
<h1>{{.Title}}</h1>
|
||||
{{with .Params.subtitle}}
|
||||
<span>{{.}}</span>
|
||||
</header>
|
||||
<div>
|
||||
{{.Content}}
|
||||
</div>
|
||||
<aside>
|
||||
{{.TableOfContents}}
|
||||
</aside>
|
||||
</article>
|
||||
</main>
|
||||
{{ end }}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
<!-- #### Output Code Block
|
||||
|
||||
The `output` shortcode is almost identical to the `code` shortcode but only takes and requires `file`. The purpose of `output` is to show *rendered* HTML and therefore almost always follows another basic code block *or* and instance of the `code` shortcode:
|
||||
|
||||
````html
|
||||
{{%/* output file="post/my-first-post/index.html" */%}}
|
||||
```html
|
||||
<h1>This is my First Hugo Blog Post</h1>
|
||||
<p>I am excited to be using Hugo.</p>
|
||||
```
|
||||
{{%/* /output */%}}
|
||||
````
|
||||
|
||||
The preceding `output` example will render as follows to the Hugo docs:
|
||||
|
||||
{{% output file="post/my-first-post/index.html" %}}
|
||||
```html
|
||||
<h1>This is my First Hugo Blog Post</h1>
|
||||
<p>I am excited to be using Hugo.</p>
|
||||
```
|
||||
{{% /output %}} -->
|
||||
|
||||
## Blockquotes
|
||||
|
||||
Blockquotes can be added to the Hugo documentation using [typical Markdown blockquote syntax][bqsyntax]:
|
||||
|
||||
```markdown
|
||||
> Without the threat of punishment, there is no joy in flight.
|
||||
```
|
||||
|
||||
The preceding blockquote will render as follows in the Hugo docs:
|
||||
|
||||
> Without the threat of punishment, there is no joy in flight.
|
||||
|
||||
However, you can add a quick and easy `<cite>` element (added on the client via JavaScript) by separating your main blockquote and the citation with a hyphen with a single space on each side:
|
||||
|
||||
```markdown
|
||||
> Without the threat of punishment, there is no joy in flight. - [Kobo Abe](https://en.wikipedia.org/wiki/Kobo_Abe)
|
||||
```
|
||||
|
||||
Which will render as follows in the Hugo docs:
|
||||
|
||||
> Without the threat of punishment, there is no joy in flight. - [Kobo Abe][abe]
|
||||
|
||||
{{% note "Blockquotes `!=` Admonitions" %}}
|
||||
Previous versions of Hugo documentation used blockquotes to draw attention to text. This is *not* the [intended semantic use of `<blockquote>`](http://html5doctor.com/cite-and-blockquote-reloaded/). Use blockquotes when quoting. To note or warn your user of specific information, use the admonition shortcodes that follow.
|
||||
{{% /note %}}
|
||||
|
||||
## Admonitions
|
||||
|
||||
**Admonitions** are common in technical documentation. The most popular is that seen in [reStructuredText Directives][sourceforge]. From the SourceForge documentation:
|
||||
|
||||
> Admonitions are specially marked "topics" that can appear anywhere an ordinary body element can. They contain arbitrary body elements. Typically, an admonition is rendered as an offset block in a document, sometimes outlined or shaded, with a title matching the admonition type. - [SourceForge][sourceforge]
|
||||
|
||||
The Hugo docs contain three admonitions: `note`, `tip`, and `warning`.
|
||||
|
||||
### `note` Admonition
|
||||
|
||||
Use the `note` shortcode when you want to draw attention to information subtly. `note` is intended to be less of an interruption in content than is `warning`.
|
||||
|
||||
#### Example `note` Input
|
||||
|
||||
{{% code file="note-with-heading.md" %}}
|
||||
```markdown
|
||||
{{%/* note */%}}
|
||||
Here is a piece of information I would like to draw your **attention** to.
|
||||
{{%/* /note */%}}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
#### Example `note` Output
|
||||
|
||||
{{% output file="note-with-heading.html" %}}
|
||||
```html
|
||||
{{% note %}}
|
||||
Here is a piece of information I would like to draw your **attention** to.
|
||||
{{% /note %}}
|
||||
```
|
||||
{{% /output %}}
|
||||
|
||||
#### Example `note` Display
|
||||
|
||||
{{% note %}}
|
||||
Here is a piece of information I would like to draw your **attention** to.
|
||||
{{% /note %}}
|
||||
|
||||
### `tip` Admonition
|
||||
|
||||
Use the `tip` shortcode when you want to give the reader advice. `tip`, like `note`, is intended to be less of an interruption in content than is `warning`.
|
||||
|
||||
#### Example `tip` Input
|
||||
|
||||
{{% code file="using-tip.md" %}}
|
||||
```markdown
|
||||
{{%/* tip */%}}
|
||||
Here's a bit of advice to improve your productivity with Hugo.
|
||||
{{%/* /tip */%}}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
#### Example `tip` Output
|
||||
|
||||
{{% output file="tip-output.html" %}}
|
||||
```html
|
||||
{{% tip %}}
|
||||
Here's a bit of advice to improve your productivity with Hugo.
|
||||
{{% /tip %}}
|
||||
```
|
||||
{{% /output %}}
|
||||
|
||||
#### Example `tip` Display
|
||||
|
||||
{{% tip %}}
|
||||
Here's a bit of advice to improve your productivity with Hugo.
|
||||
{{% /tip %}}
|
||||
|
||||
### `warning` Admonition
|
||||
|
||||
Use the `warning` shortcode when you want to draw the user's attention to something important. A good usage example is for articulating breaking changes in Hugo versions, known bugs, or templating "gotchas."
|
||||
|
||||
#### Example `warning` Input
|
||||
|
||||
{{% code file="warning-admonition-input.md" %}}
|
||||
```markdown
|
||||
{{%/* warning */%}}
|
||||
This is a warning, which should be reserved for *important* information like breaking changes.
|
||||
{{%/* /warning */%}}
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
#### Example `warning` Output
|
||||
|
||||
{{% output file="warning-admonition-output.html" %}}
|
||||
```html
|
||||
{{% warning %}}
|
||||
This is a warning, which should be reserved for *important* information like breaking changes.
|
||||
{{% /warning %}}
|
||||
```
|
||||
{{% /output %}}
|
||||
|
||||
#### Example `warning` Display
|
||||
|
||||
{{% warning %}}
|
||||
This is a warning, which should be reserved for *important* information like breaking changes.
|
||||
{{% /warning %}}
|
||||
|
||||
{{% note "Pull Requests and Branches" %}}
|
||||
Similar to [contributing to Hugo development](/contribute/development/), the Hugo team expects you to create a separate branch/fork when you make your contributions to the Hugo docs.
|
||||
{{% /note %}}
|
||||
|
||||
[abe]: https://en.wikipedia.org/wiki/Kobo_Abe
|
||||
[archetypes]: /content-management/archetypes/
|
||||
[bqsyntax]: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#blockquotes
|
||||
[charcount]: http://www.lettercount.com/
|
||||
[`docs/static/images/showcase/`]: https://github.com/gohugoio/hugo/tree/master/docs/static/images/showcase/
|
||||
[ghforking]: https://help.github.com/articles/fork-a-repo/
|
||||
[hugodev]: /contribute/development/
|
||||
[shortcodeparams]: content-management/shortcodes/#shortcodes-without-markdown
|
||||
[sourceforge]: http://docutils.sourceforge.net/docs/ref/rst/directives.html#admonitions
|
||||
[templating function]: /functions/
|
||||
@@ -0,0 +1,154 @@
|
||||
---
|
||||
title: Add Your Hugo Theme to the Showcase
|
||||
linktitle: Themes
|
||||
description: If you've built a Hugo theme and want to contribute back to the Hugo Community, add your theme to the Hugo Showcase.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-27
|
||||
categories: [contribute]
|
||||
#tags: [contribute,themes,design]
|
||||
authors: [digitalcraftsman]
|
||||
menu:
|
||||
docs:
|
||||
parent: "contribute"
|
||||
weight: 30
|
||||
weight: 30
|
||||
sections_weight: 30
|
||||
draft: false
|
||||
aliases: [/contribute/theme/]
|
||||
wip: true
|
||||
toc: true
|
||||
---
|
||||
|
||||
A collection of all themes created by the Hugo community, including screenshots and demos, can be found at <https://themes.gohugo.io>. Every theme in this list will automatically be added to the theme site. Theme updates aren't scheduled but usually happen at least once a week.
|
||||
|
||||
## tl;dr
|
||||
|
||||
1. Create your theme using `hugo new theme <THEMENAME>`;
|
||||
2. Test your theme against <https://github.com/spf13/HugoBasicExample> \*
|
||||
3. Add a `theme.toml` file to the root of the theme with all required metadata
|
||||
4. Add a descriptive `README.md` to the root of the theme source
|
||||
5. Add `/images/screenshot.png` and `/images/tn.png`
|
||||
|
||||
\* If your theme doesn't fit into the `Hugo Basic Example` site, we encourage theme authors to supply a self-contained Hugo site in `/exampleSite`.
|
||||
|
||||
{{% note %}}
|
||||
The folder name here---`exampleSite`---is important, as this folder will be picked up and used by the script that generates the Hugo Theme Site. It mirrors the root directory of a Hugo website and allows you to add custom content, assets, and a `config` file with preset values.
|
||||
{{% /note %}}
|
||||
|
||||
See the [Hugo Artist theme's exampleSite][artistexample] for a good example.
|
||||
|
||||
{{% note %}}
|
||||
Please make your example site's content is as neutral as possible. We hope this goes without saying.
|
||||
{{% /note %}}
|
||||
|
||||
## Theme Requirements
|
||||
|
||||
In order to add your theme to the Hugo Themes Showcase, the following requirements need to be met:
|
||||
|
||||
1. `theme.toml` with all required fields
|
||||
2. Images for thumbnail and screenshot
|
||||
3. A good README file instructions for users
|
||||
4. Addition to the hugoThemes GitHub repository
|
||||
|
||||
### Add Your Theme to the Repo
|
||||
|
||||
The easiest way to add your theme is to [open up a new issue in the theme repository][themeissuenew] with a link to the theme's repository on GitHub.
|
||||
|
||||
### Create a `theme.toml` File
|
||||
|
||||
`theme.toml` contains metadata about the theme and its creator and should be created automatically when running the `hugo new theme`. The auto-generated file is provided here as well for easy downloading:
|
||||
|
||||
{{% code file="theme.toml" download="theme.toml" %}}
|
||||
```toml
|
||||
name = ""
|
||||
license = "MIT"
|
||||
licenselink = "https://github.com/<YOURNAME>/<YOURTHEME>/blob/master/LICENSE.md"
|
||||
description = ""
|
||||
homepage = "http://yoursite.com/"
|
||||
tags = []
|
||||
features = []
|
||||
min_version = 0.19
|
||||
|
||||
[author]
|
||||
name = ""
|
||||
homepage = ""
|
||||
|
||||
# If porting an existing theme
|
||||
[original]
|
||||
name = ""
|
||||
homepage = ""
|
||||
repo = ""
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
The following fields are required:
|
||||
|
||||
```toml
|
||||
name = "Hyde"
|
||||
license = "MIT"
|
||||
licenselink = "https://github.com/spf13/hyde/blob/master/LICENSE.md"
|
||||
description = "An elegant open source and mobile first theme"
|
||||
homepage = "http://siteforthistheme.com/"
|
||||
tags = ["blog", "company"]
|
||||
features = ["blog"]
|
||||
min_version = 0.13
|
||||
|
||||
[author]
|
||||
name = "spf13"
|
||||
homepage = "http://spf13.com/"
|
||||
|
||||
# If porting an existing theme
|
||||
[original]
|
||||
author = "mdo"
|
||||
homepage = "http://hyde.getpoole.com/"
|
||||
repo = "https://www.github.com/mdo/hyde"
|
||||
```
|
||||
|
||||
{{% note %}}
|
||||
1. This is different from the `theme.toml` file created by `hugo new theme` in Hugo versions before v0.14.
|
||||
2. Only `theme.toml` is accepted; ie. not `theme.yaml` andnot `theme.json`.
|
||||
{{% /note %}}
|
||||
|
||||
### Images
|
||||
|
||||
Screenshots are used for previews in the Hugo Theme Gallery. Make sure that they have the right dimensions:
|
||||
|
||||
* Thumbnail should be 900px × 600px
|
||||
* Screenshot should be 1500px × 1000px
|
||||
* Media must be located in
|
||||
* <THEMEDIR>/images/screenshot.png</code>
|
||||
* <THEMEDIR>/images/tn.png</code>
|
||||
|
||||
Additional media may be provided in the same directory.
|
||||
|
||||
### Create a README File
|
||||
|
||||
Your theme's README file should be written in markdown and saved at the root of your theme's directory structure. Your `README.md` serves as
|
||||
|
||||
1. Content for your theme's details page at <https://themes.gohugo.io>
|
||||
2. General information about the theme in your GitHub repository (i.e., it's usual purpose)
|
||||
|
||||
#### Example `README.md`
|
||||
|
||||
You can download the following `README.md` as an outline:
|
||||
|
||||
{{% code file="README.md" download="README.md" %}}
|
||||
```markdown
|
||||
|
||||
# Theme Title
|
||||
|
||||
**Need input from @digitalcraftsman on what could be added to this file.**
|
||||
|
||||
|
||||
|
||||
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
{{% note "Screenshots in your `README.md`"%}}
|
||||
If you add screenshots to the README, please make use of absolute file paths instead of relative ones like `/images/screenshot.png`. Relative paths work great on GitHub but they don't correspond to the directory structure of [themes.gohugo.io](http://themes.gohugo.io/). Therefore, browsers will not be able to display screenshots on the theme site under the given (relative) path.
|
||||
{{% /note %}}
|
||||
|
||||
[artistexample]: https://github.com/digitalcraftsman/hugo-artists-theme/tree/master/exampleSite
|
||||
[themeissuenew]: https://github.com/gohugoio/hugoThemes/issues/new
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
title: Hugo Documentation
|
||||
linktitle: Hugo
|
||||
description: Hugo is the world's fastest static website engine. It's written in Go (aka Golang) and developed by bep, spf13 and friends.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
menu:
|
||||
main:
|
||||
parent: "section name"
|
||||
weight: 01
|
||||
weight: 01 #rem
|
||||
draft: false
|
||||
slug:
|
||||
aliases: []
|
||||
toc: false
|
||||
layout: documentation-home
|
||||
---
|
||||
Hugo is the **world's fastest static website engine.** It's written in Go (aka Golang) and developed by [bep](https://github.com/bep), [spf13](https://github.com/spf13) and [friends](https://github.com/gohugoio/hugo/graphs/contributors). Below you will find some of the most common and helpful pages from our documentation.
|
||||
@@ -1,103 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /doc/redirects/
|
||||
- /doc/alias/
|
||||
- /doc/aliases/
|
||||
lastmod: 2015-12-23
|
||||
date: 2013-07-09
|
||||
menu:
|
||||
main:
|
||||
parent: extras
|
||||
next: /extras/analytics
|
||||
prev: /taxonomies/methods
|
||||
title: Aliases
|
||||
---
|
||||
|
||||
For people migrating existing published content to Hugo, there's a good chance you need a mechanism to handle redirecting old URLs.
|
||||
|
||||
Luckily, redirects can be handled easily with _aliases_ in Hugo.
|
||||
|
||||
## Example
|
||||
|
||||
Given a post on your current Hugo site, with a path of:
|
||||
|
||||
``content/posts/my-awesome-blog-post.md``
|
||||
|
||||
... you create an "aliases" section in the frontmatter of your post, and add previous paths to that.
|
||||
|
||||
### TOML frontmatter
|
||||
|
||||
```toml
|
||||
+++
|
||||
...
|
||||
aliases = [
|
||||
"/posts/my-original-url/",
|
||||
"/2010/01/01/even-earlier-url.html"
|
||||
]
|
||||
...
|
||||
+++
|
||||
```
|
||||
|
||||
### YAML frontmatter
|
||||
|
||||
```yaml
|
||||
---
|
||||
...
|
||||
aliases:
|
||||
- /posts/my-original-url/
|
||||
- /2010/01/01/even-earlier-url.html
|
||||
...
|
||||
---
|
||||
```
|
||||
|
||||
Now when you visit any of the locations specified in aliases, _assuming the same site domain_, you'll be redirected to the page they are specified on.
|
||||
|
||||
## Important Behaviors
|
||||
|
||||
1. *Hugo makes no assumptions about aliases. They also don't change based
|
||||
on your UglyURLs setting. You need to provide absolute path to your webroot
|
||||
and the complete filename or directory.*
|
||||
|
||||
2. *Aliases are rendered prior to any content and will be overwritten by
|
||||
any content with the same location.*
|
||||
|
||||
## Multilingual example
|
||||
|
||||
On [multilingual sites]({{< relref "content/multilingual.md" >}}), each translation of a post can have unique aliases. To use the same alias across multiple languages, prefix it with the language code.
|
||||
|
||||
In `/posts/my-new-post.es.md`:
|
||||
|
||||
```yaml
|
||||
---
|
||||
aliases:
|
||||
- /es/posts/my-original-post/
|
||||
---
|
||||
```
|
||||
|
||||
## How Hugo Aliases Work
|
||||
|
||||
When aliases are specified, Hugo creates a physical folder structure to match the alias entry, and, an html file specifying the canonical URL for the page, and a redirect target.
|
||||
|
||||
Assuming a baseURL of `mysite.tld`, the contents of the html file will look something like:
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>http://mysite.tld/posts/my-original-url</title>
|
||||
<link rel="canonical" href="http://mysite.tld/posts/my-original-url"/>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
|
||||
<meta http-equiv="refresh" content="0; url=http://mysite.tld/posts/my-original-url"/>
|
||||
</head>
|
||||
</html>
|
||||
```
|
||||
|
||||
The `http-equiv="refresh"` line is what performs the redirect, in 0 seconds in this case.
|
||||
|
||||
## Customizing
|
||||
|
||||
You may customize this alias page by creating an alias.html template in the
|
||||
layouts folder of your site. In this case, the data passed to the template is
|
||||
|
||||
* Permalink - the link to the page being aliased
|
||||
* Page - the Page data for the page being aliased
|
||||
@@ -1,28 +0,0 @@
|
||||
---
|
||||
date: 2016-02-06
|
||||
linktitle: Analytics
|
||||
menu:
|
||||
main:
|
||||
parent: extras
|
||||
next: /extras/builders
|
||||
prev: /extras/aliases
|
||||
title: Analytics in Hugo
|
||||
---
|
||||
|
||||
Hugo ships with prebuilt internal templates for Google Analytics tracking, including both synchronous and asynchronous tracking codes.
|
||||
|
||||
## Configuring Google Analytics
|
||||
|
||||
Provide your tracking id in your configuration file, e.g. config.yaml.
|
||||
|
||||
googleAnalytics = "UA-123-45"
|
||||
|
||||
## Example
|
||||
|
||||
Include the internal template in your templates like so:
|
||||
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
|
||||
For async include the async template:
|
||||
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
@@ -1,56 +0,0 @@
|
||||
---
|
||||
lastmod: 2015-12-24
|
||||
date: 2014-05-26
|
||||
linktitle: Builders
|
||||
menu:
|
||||
main:
|
||||
parent: extras
|
||||
next: /extras/comments
|
||||
prev: /extras/analytics
|
||||
title: Hugo Builders
|
||||
---
|
||||
|
||||
Hugo provides the functionality to quickly get a site, theme or page
|
||||
started.
|
||||
|
||||
|
||||
## New Site
|
||||
|
||||
Want to get a site built quickly?
|
||||
|
||||
{{< nohighlight >}}$ hugo new site <i>path/to/site</i>
|
||||
{{< /nohighlight >}}
|
||||
|
||||
Hugo will create all the needed directories and files to get started
|
||||
quickly.
|
||||
|
||||
Hugo will only touch the files and create the directories (in the right
|
||||
places), [configuration](/overview/configuration/) and content are up to
|
||||
you... but luckily we have builders for content (see below).
|
||||
|
||||
## New Theme
|
||||
|
||||
Want to design a new theme?
|
||||
|
||||
$ hugo new theme THEME_NAME
|
||||
|
||||
Run from your working directory, this will create a new theme with all
|
||||
the needed files in your themes directory. Hugo will provide you with a
|
||||
license and theme.toml file with most of the work done for you.
|
||||
|
||||
Follow the [Theme Creation Guide](/themes/creation/) once the builder is
|
||||
done.
|
||||
|
||||
## New Content
|
||||
|
||||
You will use this builder the most of all. Every time you want to create
|
||||
a new piece of content, the content builder will get you started right.
|
||||
|
||||
Leveraging [content archetypes](/content/archetypes/) the content builder
|
||||
will not only insert the current date and appropriate metadata, but it
|
||||
will pre-populate values based on the content type.
|
||||
|
||||
$ hugo new relative/path/to/content
|
||||
|
||||
This assumes it is being run from your working directory and the content
|
||||
path starts from your content directory. Now, Hugo watches your content directory by default and rebuilds your entire website if any change occurs.
|
||||
@@ -1,99 +0,0 @@
|
||||
---
|
||||
lastmod: 2015-08-04
|
||||
date: 2014-05-26
|
||||
linktitle: Comments
|
||||
menu:
|
||||
main:
|
||||
parent: extras
|
||||
next: /extras/crossreferences
|
||||
prev: /extras/builders
|
||||
title: Comments in Hugo
|
||||
---
|
||||
|
||||
As Hugo is a static site generator, the content produced is static and doesn’t interact with the users. The most common interaction people ask for is comment capability.
|
||||
|
||||
Hugo ships with support for [Disqus](https://disqus.com/), a third-party service that provides comment and community capabilities to website via JavaScript.
|
||||
|
||||
Your theme may already support Disqus, but even it if doesn’t, it is easy to add.
|
||||
|
||||
# Disqus Support
|
||||
|
||||
## Adding Disqus to a template
|
||||
|
||||
Hugo comes with all the code you would need to include load Disqus. Simply include the following line where you want your comments to appear:
|
||||
|
||||
{{ template "_internal/disqus.html" . }}
|
||||
|
||||
## Configuring Disqus
|
||||
|
||||
That template requires you to set a single value in your site config file, e.g. config.yaml.
|
||||
|
||||
disqusShortname = "XYW"
|
||||
|
||||
Additionally, you can optionally set the following in the front matter
|
||||
for a given piece of content:
|
||||
|
||||
* **disqus_identifier**
|
||||
* **disqus_title**
|
||||
* **disqus_url**
|
||||
|
||||
## Conditional Loading of Disqus Comments
|
||||
|
||||
Users have noticed that enabling Disqus comments when running the Hugo web server on localhost causes the creation of unwanted discussions on the associated Disqus account. In order to prevent this, a slightly tweaked partial template is required. So, rather than using the built-in `"_internal/disqus.html"` template referenced above, create a template in your `partials` folder that looks like this:
|
||||
|
||||
```html
|
||||
<div id="disqus_thread"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
(function() {
|
||||
// Don't ever inject Disqus on localhost--it creates unwanted
|
||||
// discussions from 'localhost:1313' on your Disqus account...
|
||||
if (window.location.hostname == "localhost")
|
||||
return;
|
||||
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||
var disqus_shortname = '{{ .Site.DisqusShortname }}';
|
||||
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||
<a href="http://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
||||
```
|
||||
|
||||
Notice that there is a simple `if` statement that detects when you are running on localhost and skips the initialization of the Disqus comment injection.
|
||||
|
||||
Now, reference the partial template from your page template:
|
||||
|
||||
{{ partial "disqus.html" . }}
|
||||
|
||||
|
||||
# Alternatives
|
||||
|
||||
A few alternatives exist to [Disqus](https://disqus.com/):
|
||||
|
||||
* [txtpen](https://txtpen.com)
|
||||
* [Discourse](http://www.discourse.org)
|
||||
* [IntenseDebate](http://intensedebate.com/)
|
||||
* [Livefyre](http://www.adobe.com/marketing-cloud/enterprise-content-management/ugc-content-platform.html)
|
||||
* [Muut](http://muut.com/)
|
||||
* [多说](http://duoshuo.com/) ([Duoshuo](http://duoshuo.com/), popular in China)
|
||||
* [isso](http://posativ.org/isso/) (Self-hosted, Python)
|
||||
* [Kaiju](https://github.com/spf13/kaiju)
|
||||
|
||||
## Kaiju
|
||||
|
||||
[Kaiju](https://github.com/spf13/kaiju) is an open-source project started by [spf13](http://spf13.com/) (Hugo’s author) to bring easy and fast real time discussions to the web.
|
||||
|
||||
Written using Go, Socket.io and MongoDB, it is very fast and easy to deploy.
|
||||
|
||||
It is in early development but shows promise. If you have interest, please help by contributing whether via a pull request, an issue or even just a tweet. Everything helps.
|
||||
|
||||
## txtpen
|
||||
|
||||
[txtpen](https://txtpen.com) adds highlighting an in-line commenting similar to Medium to your Hugo blog.
|
||||
|
||||
## Discourse
|
||||
|
||||
Additionally, you may recognize [Discourse](http://www.discourse.org) as the system that powers the [Hugo Discussion Forum](https://discourse.gohugo.io).
|
||||
|
||||
@@ -1,153 +0,0 @@
|
||||
---
|
||||
lastmod: 2015-12-23
|
||||
date: 2014-11-25
|
||||
menu:
|
||||
main:
|
||||
parent: extras
|
||||
next: /extras/robots-txt
|
||||
prev: /extras/comments
|
||||
title: Cross-References
|
||||
toc: true
|
||||
---
|
||||
|
||||
Hugo makes it easy to link documents together with the `ref` and `relref` shortcodes. These shortcodes are also used to safely provide links to headings inside of your content, whether across documents or within a document. The only difference between `ref` and `relref` is whether the resulting URL is absolute (`http://1.com/about/`) or relative (`/about/`).
|
||||
|
||||
## Using `ref` and `relref`
|
||||
|
||||
```django
|
||||
{{</* ref "document" */>}}
|
||||
{{</* ref "#anchor" */>}}
|
||||
{{</* ref "document#anchor" */>}}
|
||||
{{</* relref "document" */>}}
|
||||
{{</* relref "#anchor" */>}}
|
||||
{{</* relref "document#anchor" */>}}
|
||||
```
|
||||
|
||||
The single parameter to `ref` is a string with a content _document name_ (`about.md`), an in-document _anchor_ (`#who`), or both (`about.md#who`).
|
||||
|
||||
### Document Names
|
||||
|
||||
The _document name_ is the name of a document including the format extension; this may be just the filename, or the relative path from the `content/` directory. With a document `content/blog/post.md`, either format will produce the same result.
|
||||
|
||||
{{</* relref "blog/post.md" */>}} ⇒ `/blog/post/`
|
||||
{{</* relref "post.md" */>}} ⇒ `/blog/post/`
|
||||
|
||||
If you have multiple sections with the same filename, you should only use the relative path format, because the behaviour is _undefined_. So, if I also have a document `link/post.md`, the output of `ref` is unknown for `post.md`.
|
||||
|
||||
{{</* relref "blog/post.md" */>}} ⇒ `/blog/post/`
|
||||
{{</* relref "post.md" */>}} ⇒ `/blog/post/` (maybe)
|
||||
{{</* relref "post.md" */>}} ⇒ `/link/post/` (maybe)
|
||||
{{</* relref "link/post.md" */>}} ⇒ `/link/post/`
|
||||
|
||||
A relative document name must *not* begin with a slash (`/`).
|
||||
|
||||
{{</* relref "/blog/post.md" */>}} ⇒ `""`
|
||||
|
||||
### Anchors
|
||||
|
||||
When an _anchor_ is provided by itself, the current page’s unique identifier will be appended; when an _anchor_ is provided with a document name, the found page's unique identifier will be appended.
|
||||
|
||||
{{</* relref "#who" */>}} ⇒ `#who:9decaf7`
|
||||
{{</* relref "blog/post.md#who" */>}} ⇒ `/blog/post/#who:badcafe`
|
||||
|
||||
More information about document unique identifiers and headings can be found [below]({{< ref "#hugo-heading-anchors" >}}).
|
||||
|
||||
### Examples
|
||||
|
||||
* `{{</* ref "blog/post.md" */>}}` ⇒ `http://1.com/blog/post/`
|
||||
* `{{</* ref "post.md#tldr" */>}}` ⇒ `http://1.com/blog/post/#tldr:caffebad`
|
||||
* `{{</* relref "post.md" */>}}` ⇒ `/blog/post/`
|
||||
* `{{</* relref "blog/post.md#tldr" */>}}` ⇒ `/blog/post/#tldr:caffebad`
|
||||
* `{{</* ref "#tldr" */>}}` ⇒ `#tldr:badcaffe`
|
||||
* `{{</* relref "#tldr" */>}}` ⇒ `#tldr:badcaffe`
|
||||
|
||||
## Hugo Heading Anchors
|
||||
|
||||
When using Markdown document types, Hugo generates heading anchors automatically. The generated anchor for this section is `hugo-heading-anchors`. Because the heading anchors are generated automatically, Hugo takes some effort to ensure that heading anchors are unique both inside a document and across the entire site.
|
||||
|
||||
Ensuring heading uniqueness across the site is accomplished with a unique identifier for each document based on its path. Unless a document is renamed or moved between sections *in the filesystem*, the unique identifier for the document will not change: `blog/post.md` will always have a unique identifier of `81df004c333b392d34a49fd3a91ba720`.
|
||||
|
||||
`ref` and `relref` were added so you can make these reference links without having to know the document’s unique identifier. (The links in document tables of contents are automatically up-to-date with this value.)
|
||||
|
||||
{{</* relref "extras/crossreferences.md#hugo-heading-anchors" */>}}
|
||||
/extras/crossreferences/#hugo-heading-anchors:77cd9ea530577debf4ce0f28c8dca242
|
||||
|
||||
> What follows is a deeper discussion of *why* and *how* Hugo generates heading anchors. It is not necessary to know this to use `ref` and `relref`, but it may be useful in understanding how some anchors may not match your expectations.
|
||||
|
||||
### How to Generate a Heading Anchor
|
||||
|
||||
Convert the text of the heading to lowercase.
|
||||
|
||||
Hugo: A Fast & Modern Static Web Engine
|
||||
hugo: a fast & modern static web engine
|
||||
|
||||
Replace anything that isn't an ASCII letter (`a-z`) or number (`0-9`) with a dash (`-`).
|
||||
|
||||
hugo: a fast & modern static web engine
|
||||
hugo--a-fast---modern-static-web-engine
|
||||
|
||||
Get rid of extra dashes.
|
||||
|
||||
hugo--a-fast---modern-static-web-engine
|
||||
hugo-a-fast-modern-static-web-engine
|
||||
|
||||
You have just converting the text of a heading to a suitable anchor. If your document has unique heading text, all of the anchors will be unique, too.
|
||||
|
||||
#### Specifying Heading Anchors
|
||||
|
||||
You can also tell Hugo to use a particular heading anchor.
|
||||
|
||||
# Hugo: A Fast & Modern Static Web Engine {#hugo-main}
|
||||
|
||||
Hugo will use `hugo-main` as the heading anchor.
|
||||
|
||||
### What About Duplicate Heading Anchors?
|
||||
|
||||
The technique outlined above works well enough, but some documents have headings with identical text, like the [shortcodes](/extras/shortcodes/) page—there are three headings with the text "Example". You can specify heading anchors manually:
|
||||
|
||||
### Example {#example-1}
|
||||
### Example {#example-2}
|
||||
### Example {#example-3}
|
||||
|
||||
It’s easy to forget to do that all the time, and Hugo is smart enough to do it for you. It just adds `-x` to the end of each heading it has already seen.
|
||||
|
||||
* `### Example` ⇒ `example`
|
||||
* `### Example` ⇒ `example-1`
|
||||
* `### Example` ⇒ `example-2`
|
||||
|
||||
Sometimes it's a little harder, but Hugo can recover from those, too, by adding more suffixes:
|
||||
|
||||
* `# Heading` ⇒ `heading`
|
||||
* `# Heading 1` ⇒ `heading-1`
|
||||
* `# Heading` ⇒ `heading-1-1`
|
||||
* `# Heading` ⇒ `heading-1-2`
|
||||
* `# Heading 1` ⇒ `heading-2`
|
||||
|
||||
This can even affect specified heading anchors that come after a generated heading anchor.
|
||||
|
||||
* `# My Heading` ⇒ `my-heading`
|
||||
* `# My Heading {#my-heading}` ⇒ `my-heading-1`
|
||||
|
||||
> This particular collision and override is unfortunate, but unavoidable because Hugo processes each heading for collision detection as it sees it during conversion.
|
||||
|
||||
This technique works well for documents rendered on individual pages, like blog posts. What about on Hugo list pages?
|
||||
|
||||
### Unique Heading Anchors in Lists
|
||||
|
||||
Hugo converts each document from Markdown independently. it doesn’t know that `blog/post.md` has an "Example" heading that will collide with the "Example" heading in `blog/post2.md`. Even if it did know this, the addition of `blog/post3.md` should not cause the anchors for the headings in the other blog posts to change.
|
||||
|
||||
Enter the document’s unique identifier. To prevent this sort of collision on
|
||||
list pages, Hugo always appends the document's to a generated heading anchor.
|
||||
So, the "Example" heading in `blog/post.md` actually turns into
|
||||
`#example:81df004…`, and the "Example" heading in `blog/post2.md` actually
|
||||
turns into `#example:8cf1599…`. All you have to know is the heading anchor that
|
||||
was generated, not the document identifier; `ref` and `relref` take care of the
|
||||
rest for you.
|
||||
|
||||
<a href='{{</* relref "blog/post.md#example" */>}}'>Post Example</a>
|
||||
<a href='/blog/post.md#81df004…'>Post Example</a>
|
||||
|
||||
[Post Two Example]({{</* relref "blog/post2.md#example" */>}})
|
||||
<a href='/blog/post2.md#8cf1599…'>Post Two Example</a>
|
||||
|
||||
Now you know.
|
||||
@@ -1,142 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /doc/datadrivencontent/
|
||||
lastmod: 2016-03-03
|
||||
date: 2015-02-14
|
||||
menu:
|
||||
main:
|
||||
parent: extras
|
||||
next: /extras/gitinfo
|
||||
prev: /extras/datafiles
|
||||
title: Data-driven Content
|
||||
toc: true
|
||||
---
|
||||
|
||||
Data-driven content with a static site generator? Yes, it is possible!
|
||||
|
||||
In addition to the [data files](/extras/datafiles/) feature, we have also
|
||||
implemented the feature "Data-driven Content", which lets you load
|
||||
any [JSON](http://www.json.org/) or
|
||||
[CSV](http://en.wikipedia.org/wiki/Comma-separated_values) file
|
||||
from nearly any resource.
|
||||
|
||||
"Data-driven Content" currently consists of two functions, `getJSON`
|
||||
and `getCSV`, which are available in **all template files**.
|
||||
|
||||
## Implementation details
|
||||
|
||||
### Calling the functions with an URL
|
||||
|
||||
In any HTML template or Markdown document, call the functions like this:
|
||||
|
||||
{{ $dataJ := getJSON "url" }}
|
||||
{{ $dataC := getCSV "separator" "url" }}
|
||||
|
||||
or, if you use a prefix or postfix for the URL, the functions
|
||||
accept [variadic arguments](http://en.wikipedia.org/wiki/Variadic_function):
|
||||
|
||||
{{ $dataJ := getJSON "url prefix" "arg1" "arg2" "arg n" }}
|
||||
{{ $dataC := getCSV "separator" "url prefix" "arg1" "arg2" "arg n" }}
|
||||
|
||||
The separator for `getCSV` must be put in the first position and can only
|
||||
be one character long.
|
||||
|
||||
All passed arguments will be joined to the final URL; for example:
|
||||
|
||||
{{ $urlPre := "https://api.github.com" }}
|
||||
{{ $gistJ := getJSON $urlPre "/users/GITHUB_USERNAME/gists" }}
|
||||
|
||||
will resolve internally to:
|
||||
|
||||
{{ $gistJ := getJSON "https://api.github.com/users/GITHUB_USERNAME/gists" }}
|
||||
|
||||
Finally, you can range over an array. This example will output the
|
||||
first 5 gists for a GitHub user:
|
||||
|
||||
<ul>
|
||||
{{ $urlPre := "https://api.github.com" }}
|
||||
{{ $gistJ := getJSON $urlPre "/users/GITHUB_USERNAME/gists" }}
|
||||
{{ range first 5 $gistJ }}
|
||||
{{ if .public }}
|
||||
<li><a href="{{ .html_url }}" target="_blank">{{ .description }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
||||
|
||||
### Example for CSV files
|
||||
|
||||
For `getCSV`, the one-character long separator must be placed in the
|
||||
first position followed by the URL.
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Salary</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ $url := "http://a-big-corp.com/finance/employee-salaries.csv" }}
|
||||
{{ $sep := "," }}
|
||||
{{ range $i, $r := getCSV $sep $url }}
|
||||
<tr>
|
||||
<td>{{ index $r 0 }}</td>
|
||||
<td>{{ index $r 1 }}</td>
|
||||
<td>{{ index $r 2 }}</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
The expression `{{index $r number}}` must be used to output the nth-column from
|
||||
the current row.
|
||||
|
||||
### Caching of URLs
|
||||
|
||||
Each downloaded URL will be cached in the default folder `$TMPDIR/hugo_cache/`.
|
||||
The variable `$TMPDIR` will be resolved to your system-dependent
|
||||
temporary directory.
|
||||
|
||||
With the command-line flag `--cacheDir`, you can specify any folder on
|
||||
your system as a caching directory.
|
||||
|
||||
You can also set `cacheDir` in the main configuration file.
|
||||
|
||||
If you don't like caching at all, you can fully disable caching with the
|
||||
command line flag `--ignoreCache`.
|
||||
|
||||
### Authentication when using REST URLs
|
||||
|
||||
Currently, you can only use those authentication methods that can
|
||||
be put into an URL. [OAuth](http://en.wikipedia.org/wiki/OAuth) or
|
||||
other authentication methods are not implemented.
|
||||
|
||||
### Loading local files
|
||||
|
||||
To load local files with the two functions `getJSON` and `getCSV`, the
|
||||
source files must reside within Hugo's working directory. The file
|
||||
extension does not matter but the content does.
|
||||
|
||||
It applies the same output logic as in the topic: *Calling the functions with an URL*.
|
||||
|
||||
## LiveReload
|
||||
|
||||
There is no chance to trigger a [LiveReload](/extras/livereload/) when
|
||||
the content of an URL changes. However, when a local JSON/CSV file changes,
|
||||
then a LiveReload will be triggered of course. Symlinks are not supported.
|
||||
|
||||
**URLs and LiveReload**: If you change any local file and the LiveReload
|
||||
is triggered, Hugo will either read the URL content from the cache or, if
|
||||
you have disabled the cache, Hugo will re-download the content.
|
||||
This can create huge traffic and you may also reach API limits quickly.
|
||||
|
||||
As downloading of content takes a while, Hugo stops processing
|
||||
your Markdown files until the content has been downloaded.
|
||||
|
||||
## Examples
|
||||
|
||||
- Photo gallery JSON powered: [https://github.com/pcdummy/hugo-lightslider-example](https://github.com/pcdummy/hugo-lightslider-example)
|
||||
- GitHub Starred Repositories [in a posts](https://github.com/SchumacherFM/blog-cs/blob/master/content%2Fposts%2Fgithub-starred.md) with the related [short code](https://github.com/SchumacherFM/blog-cs/blob/master/layouts%2Fshortcodes%2FghStarred.html).
|
||||
- More? Please tell us!
|
||||
@@ -1,106 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /doc/datafiles/
|
||||
lastmod: 2015-08-04
|
||||
date: 2015-01-22
|
||||
menu:
|
||||
main:
|
||||
parent: extras
|
||||
next: /extras/datadrivencontent
|
||||
prev: /extras/robots-txt
|
||||
title: Data Files
|
||||
---
|
||||
|
||||
In addition to the [built-in variables](/templates/variables/) available from Hugo, you can specify your own custom data that can be accessed via templates or shortcodes.
|
||||
|
||||
Hugo supports loading data from [YAML](http://yaml.org/), [JSON](http://www.json.org/), and [TOML](https://github.com/toml-lang/toml) files located in the `data` directory.
|
||||
|
||||
**It even works with [LiveReload](/extras/livereload/).**
|
||||
|
||||
Data Files can also be used in [themes](/themes/overview/), but note: If the same `key` is used in both the main data folder and in the theme's data folder, the main one will win. So, for theme authors, for theme specific data items that shouldn't be overridden, it can be wise to prefix the folder structure with a namespace, e.g. `mytheme/data/mytheme/somekey/...`. To check if any such duplicate exists, run hugo with the `-v` flag, e.g. `hugo -v`.
|
||||
|
||||
## The Data Folder
|
||||
|
||||
The `data` folder is where you can store additional data for Hugo to use when generating your site. Data files aren't used to generate standalone pages - rather they're meant to supplement the content files. This feature can extend the content in case your frontmatter would grow immensely. Or perhaps you want to show a larger dataset in a template (see example below). In both cases it's a good idea to outsource the data in their own file.
|
||||
|
||||
These files must be YAML, JSON or TOML files (using either the `.yml`, `.yaml`, `.json` or `toml` extension) and the data will be accessible as a `map` in `.Site.Data`.
|
||||
|
||||
**The keys in this map will be a dot chained set of _path_, _filename_ and _key_ in file (if applicable).**
|
||||
|
||||
This is best explained with an example:
|
||||
|
||||
## Example: Jaco Pastorius' Solo Discography
|
||||
|
||||
[Jaco Pastorius](http://en.wikipedia.org/wiki/Jaco_Pastorius_discography) was a great bass player, but his solo discography is short enough to use as an example. [John Patitucci](http://en.wikipedia.org/wiki/John_Patitucci) is another bass giant.
|
||||
|
||||
The example below is a bit constructed, but it illustrates the flexibility of Data Files. It uses TOML as file format.
|
||||
|
||||
Given the files:
|
||||
|
||||
* `data/jazz/bass/jacopastorius.toml`
|
||||
* `data/jazz/bass/johnpatitucci.toml`
|
||||
|
||||
`jacopastorius.toml` contains the content below, `johnpatitucci.toml` contains a similar list:
|
||||
|
||||
```
|
||||
discography = [
|
||||
"1974 – Modern American Music … Period! The Criteria Sessions",
|
||||
"1974 – Jaco",
|
||||
"1976 - Jaco Pastorius",
|
||||
"1981 - Word of Mouth",
|
||||
"1981 - The Birthday Concert (released in 1995)",
|
||||
"1982 - Twins I & II (released in 1999)",
|
||||
"1983 - Invitation",
|
||||
"1986 - Broadway Blues (released in 1998)",
|
||||
"1986 - Honestly Solo Live (released in 1990)",
|
||||
"1986 - Live In Italy (released in 1991)",
|
||||
"1986 - Heavy'n Jazz (released in 1992)",
|
||||
"1991 - Live In New York City, Volumes 1-7.",
|
||||
"1999 - Rare Collection (compilation)",
|
||||
"2003 - Punk Jazz: The Jaco Pastorius Anthology (compilation)",
|
||||
"2007 - The Essential Jaco Pastorius (compilation)"
|
||||
]
|
||||
```
|
||||
|
||||
The list of bass players can be accessed via `.Site.Data.jazz.bass`, a single bass player by adding the filename without the suffix, e.g. `.Site.Data.jazz.bass.jacopastorius`.
|
||||
|
||||
You can now render the list of recordings for all the bass players in a template:
|
||||
|
||||
```
|
||||
{{ range $.Site.Data.jazz.bass }}
|
||||
{{ partial "artist.html" . }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
And then in `partial/artist.html`:
|
||||
|
||||
```
|
||||
<ul>
|
||||
{{ range .discography }}
|
||||
<li>{{ . }}</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
```
|
||||
|
||||
Discover a new favourite bass player? Just add another TOML-file.
|
||||
|
||||
## Example: Accessing named values in a Data File
|
||||
|
||||
Assuming you have the following YAML structure to your `User0123.yml` Data File located directly in `data/`
|
||||
|
||||
```
|
||||
Name: User0123
|
||||
"Short Description": "He is a **jolly good** fellow."
|
||||
Achievements:
|
||||
- "Can create a Key, Value list from Data File"
|
||||
- "Learns Hugo"
|
||||
- "Reads documentation"
|
||||
```
|
||||
|
||||
To render the `Short Description` in your `layout` File following code is required.
|
||||
|
||||
```
|
||||
<div>Short Description of {{.Site.Data.User0123.Name}}: <p>{{ index .Site.Data.User0123 "Short Description" | markdownify }}</p></div>
|
||||
```
|
||||
|
||||
Note the use of the `markdownify` template function. This will send the description through the Blackfriday Markdown rendering engine.
|
||||
@@ -1,54 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /doc/gitinfo/
|
||||
lastmod: 2016-12-11
|
||||
date: 2016-12-11
|
||||
menu:
|
||||
main:
|
||||
parent: extras
|
||||
next: /extras/livereload
|
||||
prev: /extras/datadrivencontent
|
||||
title: GitInfo
|
||||
---
|
||||
|
||||
Hugo provides a way to integrate Git data into your site.
|
||||
|
||||
|
||||
## Prerequisites
|
||||
|
||||
1. The Hugo site must be in a Git-enabled directory.
|
||||
1. The Git executable must be installed and in your system `PATH`.
|
||||
1. Enable the GitInfo feature in Hugo by using `--enableGitInfo` on the command
|
||||
line or by setting `enableGitInfo` to `true` in your site configuration.
|
||||
|
||||
## The GitInfo Object
|
||||
|
||||
The `GitInfo` object contains the following fields:
|
||||
|
||||
AbbreviatedHash
|
||||
: abbreviated commit hash, e.g. `866cbcc`
|
||||
|
||||
AuthorName
|
||||
: author name, respecting `.mailmap`
|
||||
|
||||
AuthorEmail
|
||||
: author email address, respecting `.mailmap`
|
||||
|
||||
AuthorDate
|
||||
: the author date
|
||||
|
||||
Hash
|
||||
: commit hash, e.g. `866cbccdab588b9908887ffd3b4f2667e94090c3`
|
||||
|
||||
Subject
|
||||
: commit message subject, e.g. `tpl: Add custom index function`
|
||||
|
||||
|
||||
## Other Considerations
|
||||
|
||||
The Git integrations should be fairly performant, but it does add some time to the build, which depends somewhat on the Git history size.
|
||||
|
||||
The accuracy of data depends on the underlying local git respository. If the local repository is a *shallow clone*, then any file that hasn't been modified in the truncated history will default to data in the oldest commit. In particular, if the respository has been cloned using `--depth=1` then every file will the exact same `GitInfo` data -- that of the only commit in the repository.
|
||||
|
||||
In particular, many CI/CD systems such as [travis-ci.org](https://travis-ci.org) default to a clone depth of 50 which is unlikely to be deep enough. You can explicitly add back the missing history using using `git fetch --unshallow` or [make the initial checkout deeper](https://docs.travis-ci.com/user/customizing-the-build#Git-Clone-Depth).
|
||||
|
||||
@@ -1,197 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /extras/highlight/
|
||||
lastmod: 2015-10-27
|
||||
date: 2013-07-01
|
||||
menu:
|
||||
main:
|
||||
parent: extras
|
||||
next: /extras/toc
|
||||
prev: /extras/shortcodes
|
||||
title: Syntax Highlighting
|
||||
toc: true
|
||||
---
|
||||
|
||||
Hugo provides the ability for you to highlight source code in _two different ways_ — either pre-processed server side from your content, or to defer the processing to the client side, using a JavaScript library.
|
||||
|
||||
**The advantage of server side** is that it doesn’t depend on a JavaScript library and consequently works very well when read from an RSS feed.
|
||||
|
||||
**The advantage of client side** is that it doesn’t cost anything when building your site and some of the highlighting scripts available cover more languages than Pygments does.
|
||||
|
||||
## Server-side
|
||||
|
||||
For the pre-processed approach, highlighting is performed by an external Python-based program called [Pygments](http://pygments.org/) and is triggered via an embedded Hugo shortcode (see example below). If Pygments is absent from the path, it will silently simply pass the content along unhighlighted.
|
||||
|
||||
### Pygments
|
||||
|
||||
If you have never worked with Pygments before, here is a brief primer:
|
||||
|
||||
+ Install Python from [python.org](https://www.python.org/downloads/). Version 2.7.x is already sufficient.
|
||||
+ Run `pip install Pygments` in order to install Pygments. Once installed, Pygments gives you a command `pygmentize`. Make sure it sits in your PATH, otherwise Hugo cannot find it.
|
||||
|
||||
On Debian and Ubuntu systems, you may also install Pygments by running `sudo apt-get install python3-pygments`.
|
||||
|
||||
Hugo gives you two options that you can set with the variable `pygmentsuseclasses` (default `false`) in `config.toml` (or `config.yaml`).
|
||||
|
||||
1. Color-codes for highlighting keywords are directly inserted if `pygmentsuseclasses = false` (default). See in the example below. The color-codes depend on your choice of the `pygmentsstyle` (default `"monokai"`). You can explore the different color styles on [pygments.org](http://pygments.org/) after inserting some example code.
|
||||
2. If you choose `pygmentsuseclasses = true`, Hugo includes class names in your code instead of color-codes. For class-names to be meaningful, you need to include a `.css`-file in your website representing your color-scheme. You can either generate this `.css`-files according to this [description](http://pygments.org/docs/cmdline/) or download the standard ones from the [GitHub pygments-css repository](https://github.com/richleland/pygments-css).
|
||||
|
||||
### Usage
|
||||
|
||||
Highlighting is carried out via the in-built shortcode `highlight`. `highlight` takes exactly one required parameter of language, and requires a closing shortcode. Note that `highlight` is _not_ used for client-side javascript highlighting.
|
||||
|
||||
### Example
|
||||
|
||||
```
|
||||
{{</* highlight html */>}}
|
||||
<section id="main">
|
||||
<div>
|
||||
<h1 id="title">{{ .Title }}</h1>
|
||||
{{ range .Data.Pages }}
|
||||
{{ .Render "summary"}}
|
||||
{{ end }}
|
||||
</div>
|
||||
</section>
|
||||
{{</* /highlight */>}}
|
||||
```
|
||||
|
||||
### Example Output
|
||||
|
||||
```
|
||||
<span style="color: #f92672"><section</span> <span style="color: #a6e22e">id=</span><span style="color: #e6db74">"main"</span><span style="color: #f92672">></span>
|
||||
<span style="color: #f92672"><div></span>
|
||||
<span style="color: #f92672"><h1</span> <span style="color: #a6e22e">id=</span><span style="color: #e6db74">"title"</span><span style="color: #f92672">></span>{{ .Title }}<span style="color: #f92672"></h1></span>
|
||||
{{ range .Data.Pages }}
|
||||
{{ .Render "summary"}}
|
||||
{{ end }}
|
||||
<span style="color: #f92672"></div></span>
|
||||
<span style="color: #f92672"></section></span>
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
Options to control highlighting can be added as a quoted, comma separated key-value list as the second argument in the shortcode. The example below will highlight as language `go` with inline line numbers, with line number 2 and 3 highlighted.
|
||||
|
||||
```
|
||||
{{</* highlight go "linenos=inline,hl_lines=2 3" */>}}
|
||||
var a string
|
||||
var b string
|
||||
var c string
|
||||
var d string
|
||||
{{</* / highlight */>}}
|
||||
```
|
||||
|
||||
Supported keywords: `style`, `encoding`, `noclasses`, `hl_lines`, `linenos`. Note that `style` and `noclasses` will override the similar setting in the global config.
|
||||
|
||||
The keywords are the same you would using with Pygments from the command line, see the [Pygments doc](http://pygments.org/docs/) for more info.
|
||||
|
||||
### Code fences
|
||||
|
||||
It is also possible to add syntax highlighting with GitHub flavoured code fences. To enable this, set the `PygmentsCodeFences` to `true` in Hugo's configuration file.
|
||||
|
||||
````
|
||||
``` html
|
||||
<section id="main">
|
||||
<div>
|
||||
<h1 id="title">{{ .Title }}</h1>
|
||||
{{ range .Data.Pages }}
|
||||
{{ .Render "summary"}}
|
||||
{{ end }}
|
||||
</div>
|
||||
</section>
|
||||
```
|
||||
````
|
||||
|
||||
### Disclaimers
|
||||
|
||||
* Pygments is relatively slow and _causes a performance hit when building your site_, but Hugo has been designed to cache the results to disk.
|
||||
* The caching can be turned off by setting the `--ignoreCache` flag to `true`.
|
||||
* Languages available depends on your Pygments installation.
|
||||
|
||||
## Client-side
|
||||
|
||||
Alternatively, code highlighting can be done in client-side JavaScript.
|
||||
|
||||
Client-side syntax highlighting is very simple to add. You'll need to pick
|
||||
a library and a corresponding theme. Some popular libraries are:
|
||||
|
||||
- [Highlight.js]
|
||||
- [Prism]
|
||||
- [Rainbow]
|
||||
- [Syntax Highlighter]
|
||||
- [Google Prettify]
|
||||
|
||||
### Highlight.js example
|
||||
|
||||
This example uses the popular [Highlight.js] library, hosted by [Yandex], a popular Russian search engine.
|
||||
|
||||
In your `./layouts/partials/` (or `./layouts/chrome/`) folder, depending on your specific theme, there will be a snippet that will be included in every generated HTML page, such as `header.html` or `header.includes.html`. Simply add the css and js to initialize [Highlight.js]:
|
||||
|
||||
~~~
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/styles/default.min.css">
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/highlight.min.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
~~~
|
||||
|
||||
### Prism example
|
||||
|
||||
Prism is another popular highlighter library, used on some major sites. Similar to Highlight.js, you simply load `prism.css` in your `<head>` via whatever Hugo partial template is creating that part of your pages, like so:
|
||||
|
||||
```html
|
||||
...
|
||||
<link href="/css/prism.css" rel="stylesheet" />
|
||||
...
|
||||
```
|
||||
|
||||
... and add `prism.js` near the bottom of your `<body>` tag, again in whatever Hugo partial template is appropriate for your site or theme.
|
||||
|
||||
```html
|
||||
...
|
||||
<script src="/js/prism.js"></script>
|
||||
...
|
||||
</body>
|
||||
```
|
||||
|
||||
In this example, the local paths indicate that your own copy of these files are being added to the site, typically under `./static/`.
|
||||
|
||||
### Using Client-side highlighting
|
||||
|
||||
To use client-side highlighting, most of these javascript libraries expect your code to be wrapped in semantically correct `<code>` tags, with the language expressed in a class attribute on the `<code>` tag, such as `class="language-abc"`, where the `abc` is the code the highlighter script uses to represent that language.
|
||||
|
||||
The script would be looking for classes like `language-go`, `language-html`, or `language-css`. If you look at the page's source, it would be marked up like so:
|
||||
|
||||
~~~html
|
||||
<pre>
|
||||
<code class="language-css">
|
||||
body {
|
||||
font-family: "Noto Sans", sans-serif;
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
~~~
|
||||
|
||||
The markup in your content pages (e.g. `my-css-tutorial.md`) needs to look like the following, with the name of the language to be highlighted entered directly after the first "fence", in a fenced code block:
|
||||
|
||||
<pre><code class="language-css">~~~css
|
||||
body {
|
||||
font-family: "Noto Sans", sans-serif;
|
||||
}
|
||||
~~~</code></pre>
|
||||
|
||||
When passed through the highlighter script, it would yield something like this output when viewed on your rendered page:
|
||||
|
||||
~~~css
|
||||
body {
|
||||
font-family: "Noto Sans", sans-serif;
|
||||
}
|
||||
~~~
|
||||
|
||||
Please see individual libraries' documentation for how to implement each of the JavaScript-based libraries.
|
||||
|
||||
[Prism]: http://prismjs.com
|
||||
[Highlight.js]: http://highlightjs.org/
|
||||
[Rainbow]: http://craig.is/making/rainbows
|
||||
[Syntax Highlighter]: http://alexgorbatchev.com/SyntaxHighlighter/
|
||||
[Google Prettify]: https://github.com/google/code-prettify
|
||||
[Yandex]: http://yandex.ru/
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
---
|
||||
lastmod: 2016-08-09
|
||||
date: 2014-05-26
|
||||
menu:
|
||||
main:
|
||||
parent: extras
|
||||
next: /extras/menus
|
||||
prev: /extras/gitinfo
|
||||
title: LiveReload
|
||||
---
|
||||
|
||||
Hugo may not be the first static site generator to utilize LiveReload
|
||||
technology, but it’s the first to do it right.
|
||||
|
||||
The combination of Hugo’s insane build speed and LiveReload make
|
||||
crafting your content pure joy. Virtually instantly after you hit save
|
||||
your rebuilt content will appear in your browser.
|
||||
|
||||
## Using LiveReload
|
||||
|
||||
Hugo comes with LiveReload built in. There are no additional packages to
|
||||
install. A common way to use Hugo while developing a site is to have
|
||||
Hugo run a server and watch for changes:
|
||||
|
||||
{{< nohighlight >}}$ hugo server
|
||||
{{< /nohighlight >}}
|
||||
|
||||
This will run a full functioning web server while simultaneously
|
||||
watching your file system for additions, deletions or changes within
|
||||
your:
|
||||
|
||||
* static files
|
||||
* content
|
||||
* data files
|
||||
* layouts
|
||||
* current theme
|
||||
* configuration files
|
||||
|
||||
Whenever anything changes, Hugo will rebuild the site while continuing to serve
|
||||
the content. As soon as the build is finished, it will tell the
|
||||
browser and silently reload the page. Because most Hugo builds are so
|
||||
fast they are barely noticeable, you merely need to glance at your open
|
||||
browser and you will see the change, already there.
|
||||
|
||||
This means that keeping the site open on a second monitor (or another
|
||||
half of your current monitor) allows you to see exactly what your
|
||||
content looks like, without even leaving your text editor.
|
||||
|
||||
## Disabling Watch
|
||||
|
||||
If for some reason you don't want the Hugo server's watch functionality,
|
||||
just do:
|
||||
|
||||
{{< nohighlight >}}$ hugo server --watch=false
|
||||
{{< /nohighlight >}}
|
||||
|
||||
## Disabling LiveReload
|
||||
|
||||
LiveReload works by injecting JavaScript into the pages Hugo generates,
|
||||
which creates a connection from the browser web socket client to the
|
||||
Hugo web socket server.
|
||||
|
||||
Awesome for development, but not something you would want to do in
|
||||
production. Since many people use `hugo server` in production to
|
||||
instantly display any updated content, we’ve made it easy to disable the
|
||||
LiveReload functionality:
|
||||
|
||||
{{< nohighlight >}}$ hugo server --disableLiveReload
|
||||
{{< /nohighlight >}}
|
||||
|
||||
## Notes
|
||||
|
||||
You must have a closing `</body>` tag for LiveReload to work.
|
||||
Hugo injects the LiveReload `<script>` before this tag.
|
||||
@@ -1,57 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /doc/localfiles/
|
||||
lastmod: 2016-09-12
|
||||
date: 2015-06-12
|
||||
menu:
|
||||
main:
|
||||
parent: extras
|
||||
next: /extras/urls
|
||||
notoc: true
|
||||
prev: /extras/toc
|
||||
title: Traversing Local Files
|
||||
---
|
||||
## Traversing Local Files
|
||||
|
||||
Using Hugo's function `readDir`,
|
||||
you can traverse your web site's files on your server.
|
||||
## Using _readDir_
|
||||
|
||||
The `readDir` function returns an array
|
||||
of [`os.FileInfo`](https://golang.org/pkg/os/#FileInfo).
|
||||
It takes a single, string argument: a path.
|
||||
This path can be to any directory of your web site
|
||||
(as found on your server's filesystem).
|
||||
|
||||
Whether the path is absolute or relative makes no difference,
|
||||
because—at least for `readDir`—the root of your web site (typically `./public/`)
|
||||
in effect becomes both:
|
||||
|
||||
1. The filesystem root; and
|
||||
1. The current working directory.
|
||||
|
||||
## New Shortcode
|
||||
|
||||
So, let's create a new shortcode using `readDir`:
|
||||
|
||||
**layouts/shortcodes/directoryindex.html**
|
||||
```html
|
||||
{{< readfile "layouts/shortcodes/directoryindex.html" >}}
|
||||
```
|
||||
For the files in any given directory,
|
||||
this shortcode usefully lists their basenames and sizes,
|
||||
while providing links to them.
|
||||
|
||||
Already—actually—this shortcode
|
||||
has been included in this very web site.
|
||||
So, let's list some of its CSS files.
|
||||
(If you click on their names, you can reveal the contents.)
|
||||
{{< directoryindex path="/static/css" pathURL="/css" >}}
|
||||
<br />
|
||||
This is the call that rendered the above output:
|
||||
```html
|
||||
{{</* directoryindex path="/static/css" pathURL="/css" */>}}
|
||||
```
|
||||
By the way,
|
||||
regarding the pathURL argument, the initial slash `/` is important.
|
||||
Otherwise, it becomes relative to the current web page.
|
||||
@@ -1,393 +0,0 @@
|
||||
---
|
||||
lastmod: 2015-08-04
|
||||
date: 2014-05-14T02:36:37Z
|
||||
toc: true
|
||||
menu:
|
||||
main:
|
||||
parent: extras
|
||||
next: /extras/pagination
|
||||
prev: /extras/livereload
|
||||
title: Menus
|
||||
---
|
||||
|
||||
Hugo has a simple yet powerful menu system that permits content to be
|
||||
placed in menus with a good degree of control without a lot of work.
|
||||
|
||||
|
||||
*TIP:* If all you want is a simple menu for your sections, see [Section Menu for "the Lazy Blogger"]({{< relref "#section-menu-for-the-lazy-blogger" >}}).
|
||||
|
||||
Some of the features of Hugo Menus:
|
||||
|
||||
* Place content in one or many menus
|
||||
* Handle nested menus with unlimited depth
|
||||
* Create menu entries without being attached to any content
|
||||
* Distinguish active element (and active branch)
|
||||
|
||||
## What is a menu?
|
||||
|
||||
A menu is a named array of menu entries accessible on the site under
|
||||
`.Site.Menus` by name. For example, if I have a menu called `main`, I would
|
||||
access it via `.Site.Menus.main`.
|
||||
|
||||
If you make use of the [multilingual feature]({{< relref "content/multilingual.md#menus">}}) you can define menus language independent.
|
||||
|
||||
A menu entry has the following properties:
|
||||
|
||||
* `URL string`
|
||||
* `Name string`
|
||||
* `Menu string`
|
||||
* `Identifier string`
|
||||
* `Pre template.HTML`
|
||||
* `Post template.HTML`
|
||||
* `Weight int`
|
||||
* `Parent string`
|
||||
* `Children Menu`
|
||||
|
||||
And the following functions:
|
||||
|
||||
* `HasChildren() bool`
|
||||
|
||||
Additionally, the `Page` object has two functions, which can be used when rendering menus:
|
||||
|
||||
* `IsMenuCurrent (menu string, menuEntry *MenuEntry ) bool`
|
||||
* `HasMenuCurrent** (menu string, menuEntry *MenuEntry) bool`
|
||||
|
||||
See [Menu Functions](#menu-functions) for explanations of these functions, and [Rendering Nested Menus](#rendering-nested-menus) for an example of their use.
|
||||
|
||||
## Adding content to menus
|
||||
|
||||
Hugo supports a couple of different methods of adding a piece of content
|
||||
to the front matter.
|
||||
|
||||
### Simple
|
||||
|
||||
If all you need to do is add an entry to a menu, the simple form works
|
||||
well.
|
||||
|
||||
**A single menu:**
|
||||
|
||||
---
|
||||
menu: "main"
|
||||
---
|
||||
|
||||
**Multiple menus:**
|
||||
|
||||
---
|
||||
menu: ["main", "footer"]
|
||||
---
|
||||
|
||||
|
||||
### Advanced
|
||||
|
||||
If more control is required, then the advanced approach gives you the
|
||||
control you want. All of the menu entry properties listed above are
|
||||
available.
|
||||
|
||||
---
|
||||
menu:
|
||||
main:
|
||||
parent: 'extras'
|
||||
weight: 20
|
||||
---
|
||||
|
||||
|
||||
## Adding (non-content) entries to a menu
|
||||
|
||||
You can also add entries to menus that aren’t attached to a piece of
|
||||
content. This takes place in the sitewide [config file](/overview/configuration/).
|
||||
|
||||
Here’s an example `config.toml`:
|
||||
|
||||
[[menu.main]]
|
||||
name = "about hugo"
|
||||
pre = "<i class='fa fa-heart'></i>"
|
||||
weight = -110
|
||||
identifier = "about"
|
||||
url = "/about/"
|
||||
[[menu.main]]
|
||||
name = "getting started"
|
||||
pre = "<i class='fa fa-road'></i>"
|
||||
weight = -100
|
||||
url = "/getting-started/"
|
||||
|
||||
And the equivalent example `config.yaml`:
|
||||
|
||||
---
|
||||
menu:
|
||||
main:
|
||||
- Name: "about hugo"
|
||||
Pre: "<i class='fa fa-heart'></i>"
|
||||
Weight: -110
|
||||
Identifier: "about"
|
||||
URL: "/about/"
|
||||
- Name: "getting started"
|
||||
Pre: "<i class='fa fa-road'></i>"
|
||||
Weight: -100
|
||||
URL: "/getting-started/"
|
||||
---
|
||||
|
||||
|
||||
**NOTE:** The URLs must be relative to the context root. If the `baseURL` is `http://example.com/mysite/`, then the URLs in the menu must not include the context root `mysite`. Using an absolute URL will overide the baseURL. If the `URL` is `http://subdomain.example.com/`, the output will be `http://subdomain.example.com`.
|
||||
|
||||
## Nesting
|
||||
|
||||
All nesting of content is done via the `parent` field.
|
||||
|
||||
The parent of an entry should be the identifier of another entry.
|
||||
Identifier should be unique (within a menu).
|
||||
|
||||
The following order is used to determine an Identifier:
|
||||
|
||||
> Name > LinkTitle > Title.
|
||||
|
||||
This means that the title will be used unless
|
||||
linktitle is present, etc. In practice Name and Identifier are never
|
||||
displayed and only used to structure relationships.
|
||||
|
||||
In this example, the top level of the menu is defined in the config file
|
||||
and all content entries are attached to one of these entries via the
|
||||
`parent` field.
|
||||
|
||||
## Rendering menus
|
||||
|
||||
Hugo makes no assumptions about how your rendered HTML will be
|
||||
structured. Instead, it provides all of the functions you will need to be
|
||||
able to build your menu however you want.
|
||||
|
||||
|
||||
The following is an example:
|
||||
|
||||
<!--sidebar start-->
|
||||
<aside>
|
||||
<div id="sidebar" class="nav-collapse">
|
||||
<!-- sidebar menu start-->
|
||||
<ul class="sidebar-menu">
|
||||
{{ $currentPage := . }}
|
||||
{{ range .Site.Menus.main }}
|
||||
{{ if .HasChildren }}
|
||||
|
||||
<li class="sub-menu{{if $currentPage.HasMenuCurrent "main" . }} active{{end}}">
|
||||
<a href="javascript:;" class="">
|
||||
{{ .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
<span class="menu-arrow arrow_carrot-right"></span>
|
||||
</a>
|
||||
<ul class="sub">
|
||||
{{ range .Children }}
|
||||
<li{{if $currentPage.IsMenuCurrent "main" . }} class="active"{{end}}><a href="{{.URL}}"> {{ .Name }} </a> </li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{else}}
|
||||
<li>
|
||||
<a href="{{.URL}}">
|
||||
{{ .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
</li>
|
||||
{{end}}
|
||||
<li> <a href="https://github.com/gohugoio/hugo/issues" target="blank">Questions and Issues</a> </li>
|
||||
<li> <a href="#" target="blank">Edit this Page</a> </li>
|
||||
</ul>
|
||||
<!-- sidebar menu end-->
|
||||
</div>
|
||||
</aside>
|
||||
<!--sidebar end-->
|
||||
|
||||
> **Note**: use the `absLangURL` or `relLangURL` if your theme makes use of the [multilingual feature]({{< relref "content/multilingual.md" >}}). In contrast to `absURL` and `relURL` it adds the correct language prefix to the url. [Read more]({{< relref "templates/functions.md#urls" >}}).
|
||||
|
||||
## Section Menu for "the Lazy Blogger"
|
||||
|
||||
To enable this menu, add this to your site config, i.e. `config.toml`:
|
||||
|
||||
```
|
||||
SectionPagesMenu = "main"
|
||||
```
|
||||
|
||||
The menu name can be anything, but take a note of what it is.
|
||||
|
||||
This will create a menu with all the sections as menu items and all the sections' pages as "shadow-members". The _shadow_ implies that the pages isn't represented by a menu-item themselves, but this enables you to create a top-level menu like this:
|
||||
|
||||
```
|
||||
<nav class="sidebar-nav">
|
||||
{{ $currentPage := . }}
|
||||
{{ range .Site.Menus.main }}
|
||||
<a class="sidebar-nav-item{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{end}}" href="{{.URL}}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
</nav>
|
||||
|
||||
```
|
||||
|
||||
In the above, the menu item is marked as active if on the current section's list page or on a page in that section.
|
||||
|
||||
The above is all that's needed. But if you want custom menu items, e.g. changing weight or name, you can define them manually in the site config, i.e. `config.toml`:
|
||||
|
||||
```
|
||||
[[menu.main]]
|
||||
name = "This is the blog section"
|
||||
weight = -110
|
||||
identifier = "blog"
|
||||
url = "/blog/"
|
||||
|
||||
```
|
||||
|
||||
**Note** that the `identifier` must match the section name.
|
||||
|
||||
|
||||
|
||||
|
||||
## Menu Functions
|
||||
|
||||
Suppose you have the menu structure shown below.
|
||||
|
||||
```
|
||||
[menu.main]
|
||||
│
|
||||
├───colour
|
||||
│ │
|
||||
│ ├───warm
|
||||
│ │ ├───orange
|
||||
│ │ ├───red
|
||||
│ │ └───yellow
|
||||
│ │
|
||||
│ └───cool
|
||||
│ ├───blue
|
||||
│ ├───green
|
||||
│ └───purple
|
||||
│
|
||||
└───tool
|
||||
├───hammer
|
||||
├───shovel
|
||||
└───saw
|
||||
```
|
||||
|
||||
For each menu item, you can determine:
|
||||
|
||||
* If the menu item has any children: `.HasChildren()`
|
||||
* If the menu item is a parent of the page you are currently rendering: `.Page.HasMenuCurrent()`
|
||||
* If the menu item **is** the page you are currently rendering: `.Page.IsMenuCurrent()`
|
||||
|
||||
For example, if you are currently rendering the page `/colour/warm`, the values of `.HasChildren`, `HasMenuCurrent`, and `IsMenuCurrent` would be as shown below:
|
||||
|
||||
```
|
||||
|
||||
[menu.main] | | | |
|
||||
│ | | | |
|
||||
├───colour | HasMenuCurrent | | HasChildren |
|
||||
│ ├───<< WARM >> | | IsMenuCurrent | HasChildren |
|
||||
│ │ ├───orange | | | |
|
||||
│ │ ├───red | | | |
|
||||
│ │ └───yellow | | | |
|
||||
│ └───cool | | | HasChildren |
|
||||
│ ├───blue | | | |
|
||||
│ ├───green | | | |
|
||||
│ └───purple | | | |
|
||||
└───tool | | | HasChildren |
|
||||
├───hammer | | | |
|
||||
├───shovel | | | |
|
||||
└───saw | | | |
|
||||
```
|
||||
|
||||
## Rendering nested menus
|
||||
|
||||
Hugo supports nested menus with as many levels as you like.
|
||||
|
||||
Nested menus can be rendered using a recursive partial template, such as the example below.
|
||||
|
||||
```
|
||||
<!-- layouts/index.html, layouts/_default/single.html, ... -->
|
||||
<h1>{{ .Title }}</h1>
|
||||
<!-- Put this line in your main template, at the place where you want to
|
||||
render the menu. -->
|
||||
{{ partial "menu_include.html" . }}
|
||||
```
|
||||
|
||||
```
|
||||
<!-- layouts/partials/menu_include.html -->
|
||||
{{ partial "menu_recursive.html" (dict "menu" .Site.Menus.main "page" . "site" .Site) }}
|
||||
```
|
||||
|
||||
```
|
||||
<!-- layouts/partials/menu_recursive.html -->
|
||||
{{ $page := .page }}
|
||||
{{ $site := .site }}
|
||||
<ul>
|
||||
{{ range .menu }}
|
||||
{{ $is := $page.IsMenuCurrent "main" . }}
|
||||
{{ $has := $page.HasMenuCurrent "main" . }}
|
||||
{{ if .HasChildren }}
|
||||
<li>
|
||||
<a href="{{ .URL }}">
|
||||
{{ .Name }}
|
||||
{{ if $is }}[Is]{{ end }}
|
||||
{{ if $has }}[Has]{{ end }}
|
||||
{{ if .HasChildren }}[Children]{{ end }}
|
||||
</a>
|
||||
<!-- If the menu item has children, include this partial template again (recursively) -->
|
||||
{{ partial "menu_recursive.html" (dict "menu" .Children "page" $page "site" $site) }}
|
||||
</li>
|
||||
{{ else }}
|
||||
<li>
|
||||
<a href="{{ .URL }}">
|
||||
{{ .Name }}
|
||||
{{ if $is }}[Is]{{ end }}
|
||||
{{ if $has }}[Has]{{ end }}
|
||||
{{ if .HasChildren }}[Children]{{ end }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
```
|
||||
|
||||
This example code renders the words `[Is]`, `[Has]`, and `[Children]` to demonstrate how the `IsMenuCurrent()`, `HasMenuCurrent()`, and `HasChildren()` functions work.
|
||||
|
||||
You can customise this example to implement features such as:
|
||||
|
||||
* Highlight the current item, by applying a CSS style:
|
||||
|
||||
<a href="{{ .URL }}"{{ if $is }} class="active"{{ end }}>
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
* Highlight parents of the current item, by applying a CSS style:
|
||||
|
||||
<a href="{{ .URL }}"{{ if $has }} class="parent-active"{{ end }}>
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
* Only render sub-menus for parents of the current menu item, and the current menu item itself:
|
||||
|
||||
{{ if or $is $has }}
|
||||
{{ partial "menu_recursive.html" (dict "menu" .Children "page" $page "site" $site) }}
|
||||
{{ end }}
|
||||
|
||||
A working example, implementing these features, is shown below.
|
||||
|
||||
```
|
||||
<!-- layouts/partials/menu_recursive.html -->
|
||||
{{ $page := .page }}
|
||||
{{ $site := .site }}
|
||||
<ul>
|
||||
<!-- Menu items sorted alphabetically by name -->
|
||||
{{ range .menu.ByName }}
|
||||
{{ $is := $page.IsMenuCurrent "main" . }}
|
||||
{{ $has := $page.HasMenuCurrent "main" . }}
|
||||
{{ if .HasChildren }}
|
||||
<li>
|
||||
<a href="{{ .URL }}" class="{{ if $is }} active{{ end }}{{ if $has }} parent-active{{ end }}">
|
||||
{{ .Name }}
|
||||
<!-- Show a » symbol if there is a sub-menu we haven't rendered -->
|
||||
{{ if not (or $is $has) }}»{{ end }}
|
||||
</a>
|
||||
<!-- Only render sub-menu for parent items and the current item -->
|
||||
{{ if or $is $has }}
|
||||
{{ partial "menu_recursive.html" (dict "menu" .Children "page" $page "site" $site) }}
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ else }}
|
||||
<li>
|
||||
<a href="{{ .URL }}" class="{{ if $is }}active{{end}}">{{ .Name }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
```
|
||||
@@ -1,185 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /doc/output-formats/
|
||||
- /doc/custom-output/
|
||||
date: 2017-03-22T08:20:13+01:00
|
||||
menu:
|
||||
main:
|
||||
parent: extras
|
||||
title: Output Formats
|
||||
weight: 5
|
||||
toc: true
|
||||
---
|
||||
|
||||
Hugo `0.20` introduced the powerful feature **Custom Output Formats**; Hugo isn't just that "static HTML with an added RSS feed" anymore. _Say hello_ to calendars, e-book formats, Google AMP, and JSON search indexes, to name a few.
|
||||
|
||||
This page describes how to properly configure your site with the media types and output formats you need.
|
||||
|
||||
## Media Types
|
||||
|
||||
A [media type](https://en.wikipedia.org/wiki/Media_type) (also known as MIME type and content type) is a two-part identifier for file formats and format contents transmitted on the Internet.
|
||||
|
||||
This is the full set of built-in media types in Hugo:
|
||||
|
||||
{{< datatable "media" "types" "Type" "Suffix" >}}
|
||||
|
||||
**Note:**
|
||||
|
||||
* It is possible to add custom media types or change the defaults (if you, say, want to change the suffix to `asp` for `text/html`).
|
||||
* The `Suffix` is the value that will be used for URLs and filenames for that media type in Hugo.
|
||||
* The `Type` is the identifier that must be used when defining new `Output Formats` (see below).
|
||||
* The `Delimiter` defaults to ".", but can be changed or even blanked out to support, as an example, Netlify's `_redirect` files.
|
||||
* The full set of media types will be registered in Hugo's built-in development server to make sure they are recognized by the browser.
|
||||
|
||||
To add or modify a media type, define it in a `mediaTypes` section in your site config (either for all sites or for a given language).
|
||||
|
||||
Example in `config.toml`:
|
||||
|
||||
```toml
|
||||
[mediaTypes]
|
||||
[mediaTypes."text/enriched"]
|
||||
suffix = "enr"
|
||||
[mediaTypes."text/html"]
|
||||
suffix = "asp"
|
||||
```
|
||||
|
||||
The above example adds one new media type, `text/enriched`, and changes the suffix for the built-in `text/html` media type.
|
||||
|
||||
## Output Formats
|
||||
Given a media type and some additional configuration, you get an `Output Format`.
|
||||
|
||||
This is the full set of built-in output formats in Hugo:
|
||||
|
||||
{{< datatable "output" "formats" "Name" "MediaType" "Path" "BaseName" "Rel" "Protocol" "IsPlainText" "IsHTML" "NoUgly" "NotAlternative">}}
|
||||
|
||||
**Note:**
|
||||
|
||||
* A page can be output in as many output formats as you want, and you can have an infinite amount of output formats defined, as long as _they resolve to a unique path on the file system_. In the table above, the best example of this is `AMP` vs. `HTML`: We have given `AMP` a value for `Path` so it doesn't overwrite the `HTML` version, i.e. we can now have both `/index.html` and `/amp/index.html`.
|
||||
* The `MediaType` must match the `Type` of an already defined media type (see above).
|
||||
* You can define new or redefine built-in output formats (if you, as an example, want to put `AMP` pages in a different path).
|
||||
|
||||
To add or modify a media type, define it in a `outputFormats` section in your site config (either for all sites or for a given language).
|
||||
|
||||
Example in `config.toml`:
|
||||
|
||||
```toml
|
||||
[outputFormats.MyEnrichedFormat]
|
||||
mediaType = "text/enriched"
|
||||
baseName = "myindex"
|
||||
isPlainText = true
|
||||
protocol = "bep://"
|
||||
```
|
||||
|
||||
The above example is fictional, but if used for the home page on a site with `baseURL` `http://example.org`, it will produce a plain text home page with the URL `bep://example.org/myindex.enr`.
|
||||
|
||||
All the available configuration options for output formats and their default values:
|
||||
|
||||
Field | Description
|
||||
--- | ---
|
||||
**Name** | The output format identifier. This is used to define what output format(s) you want for your pages.
|
||||
**MediaType**|This must match the `Type` of a defined media type. |
|
||||
**Path** | Sub path to save the output files.
|
||||
**BaseName** | The base filename for the list filenames (home page etc.). **Default:** _index_.
|
||||
**Rel** | Can be used to create `rel` values in `link` tags. **Default:** _alternate_.
|
||||
**Protocol** | Will replace the "http://" or "https://" in your `baseURL` for this output format.
|
||||
**IsPlainText** | Use Go's plain text templates parser for the templates. **Default:** _false_.
|
||||
**IsHTML** | Used in situations only relevant for `HTML` type of formats, page aliases being one example.|
|
||||
**NoUgly** | If `uglyURLs` is enabled globally, this can be used to turn it off for a given output format. **Default:** _false_.
|
||||
**NotAlternative** | Enable if it doesn't make sense to include this format in an the `.AlternativeOutputFormats` format listing on `Page`, `CSS` being one good example. Note that we use the term "alternative" and not "alternate" here, as it does not necessarily replace the other format, it is an alternative representation. **Default:** _false_.
|
||||
|
||||
|
||||
## Output Formats for your pages
|
||||
|
||||
A `Page` in Hugo can be rendered to multiple representations on the file system: In its default configuration all will get an `HTML` page and some of them will get an `RSS` page (home page, sections etc.).
|
||||
|
||||
This can be changed by defining an `outputs` list of output formats in either the `Page` front matter or in the site configuration (either for all sites or per language).
|
||||
|
||||
Example from site config in `config.toml`:
|
||||
|
||||
```toml
|
||||
[outputs]
|
||||
home = [ "HTML", "AMP", "RSS"]
|
||||
page = [ "HTML"]
|
||||
```
|
||||
Note:
|
||||
|
||||
* The output definition is per `Page` `Kind`(`page`, `home`, `section`, `taxonomy`, `taxonomyTerm`).
|
||||
* The names used must match the `Name` of a defined `Output Format`.
|
||||
* Any `Kind` without a definition will get `HTML`.
|
||||
* These can be overriden per `Page` in front matter (see below).
|
||||
* When `outputs` is specified, only the formats defined in outputs will be rendered
|
||||
|
||||
A `Page` with `YAML` front matter defining some output formats for that `Page`:
|
||||
|
||||
```yaml
|
||||
---
|
||||
date: "2016-03-19"
|
||||
outputs:
|
||||
- html
|
||||
- amp
|
||||
- json
|
||||
---
|
||||
```
|
||||
Note:
|
||||
|
||||
* The names used for the output formats are case insensitive.
|
||||
* The first output format in the list will act as the default.
|
||||
* The default output format is used when generating links to other pages in menus, etc.
|
||||
|
||||
## Link to Output Formats
|
||||
|
||||
`Page` has both `.OutputFormats` (all formats including the current) and `.AlternativeOutputFormats`, the latter useful for creating a `link rel` list in your `head` section:
|
||||
|
||||
```
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
|
||||
{{ end -}}
|
||||
```
|
||||
|
||||
Note that `.Permalink` on `RelPermalink` on `Page` will return the first output format defined for that page (usually `HTML` if nothing else is defined).
|
||||
|
||||
This is how you link to a given output format:
|
||||
|
||||
```
|
||||
{{ with .OutputFormats.Get "json" -}}
|
||||
<a href="{{ .Permalink }}">{{ .Name }}</a>
|
||||
{{- end }}
|
||||
```
|
||||
From content files, you can use the `ref` or `relref` shortcodes:
|
||||
|
||||
```
|
||||
[Neat]({{</* ref "blog/neat.md" "amp" */>}})
|
||||
[Who]({{</* relref "about.md#who" "amp" */>}})
|
||||
```
|
||||
|
||||
## Templates for your Output Formats
|
||||
|
||||
Of course, for a new Output Format to render anything useful, we need a template for it.
|
||||
|
||||
**The fundamental thing to understand about this is that we in `Hugo 0.20` now also look at Output Format´s `Name` and MediaType´s `Suffix` when we choose the templates to use to render a given `Page`.**
|
||||
|
||||
And with so many possible variations, this is best explained with some examples:
|
||||
|
||||
|
||||
{{< datatable "output" "layouts" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}
|
||||
|
||||
**Note:**
|
||||
|
||||
* All of the above examples can use a base template, see [Blocks]({{< relref "templates/blocks.md" >}}).
|
||||
* All of the above examples can also include partials.
|
||||
|
||||
Hugo will now also detect the media type and output format of partials, if possible, and use that information to decide if the partial should be parsed as a plain text template or not.
|
||||
|
||||
Hugo will look for the name given, so you can name it whatever you want. But if you want it treated as plain text, you should use the file suffix and, if needed, the name of the Output Format (`[partial name].[OutputFormat].[suffix])`.
|
||||
|
||||
The partial below is a plain text template (Output Format is `CSV`, and since this is the only output format with the suffix `csv`, we don't need to include the Output Format's `Name`):
|
||||
|
||||
```
|
||||
{{ partial "mytextpartial.csv" . }}
|
||||
```
|
||||
|
||||
Also note that plain text partials can currently only be included in plain text templates, and vice versa. See [this issue](https://github.com/gohugoio/hugo/issues/3273) for some background.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /doc/pagination/
|
||||
lastmod: 2015-07-16
|
||||
date: 2014-01-01
|
||||
menu:
|
||||
main:
|
||||
parent: extras
|
||||
next: /extras/permalinks
|
||||
prev: /extras/menus
|
||||
title: Pagination
|
||||
---
|
||||
|
||||
Hugo supports pagination for the home page, sections and taxonomies. It's built to be easy use, but with loads of flexibility when needed. The real power shines when you combine it with [`where`](/templates/functions/), with its SQL-like operators, `first` and others --- you can even [order the content](/templates/list/) the way you've become used to with Hugo.
|
||||
|
||||
## Configuration
|
||||
|
||||
Pagination can be configured in the site configuration (e.g. `config.toml`):
|
||||
|
||||
* `Paginate` (default `10`) (this setting can be overridden in the template)
|
||||
* `PaginatePath` (default `page`)
|
||||
|
||||
Setting `Paginate` to a positive value will split the list pages for the home page, sections and taxonomies into chunks of that size. But note that the generation of the pagination pages for sections, taxonomies and home page is *lazy* --- the pages will not be created if not referenced by a `.Paginator` (see below).
|
||||
|
||||
`PaginatePath` is used to adapt the `URL` to the pages in the paginator (the default setting will produce URLs on the form `/page/1/`.
|
||||
|
||||
## List the pages
|
||||
|
||||
**A `.Paginator` is provided to help building a pager menu. This is currently only relevant for the templates for the home page and the list pages (sections and taxonomies).**
|
||||
|
||||
There are two ways to configure and use a `.Paginator`:
|
||||
|
||||
1. The simplest way is just to call `.Paginator.Pages` from a template. It will contain the pages for *that page* .
|
||||
2. Select a sub-set of the pages with the available template functions and ordering options, and pass the slice to `.Paginate`, e.g. `{{ range (.Paginate ( first 50 .Data.Pages.ByTitle )).Pages }}`.
|
||||
|
||||
For a given **Page**, it's one of the options above. The `.Paginator` is static and cannot change once created.
|
||||
|
||||
The global page size setting (`Paginate`) can be overridden by providing a positive integer as the last argument. The examples below will give five items per page:
|
||||
|
||||
* `{{ range (.Paginator 5).Pages }}`
|
||||
* `{{ $paginator := .Paginate (where .Data.Pages "Type" "post") 5 }}`
|
||||
|
||||
It is also possible to use the `GroupBy` functions in combination with pagination:
|
||||
|
||||
```
|
||||
{{ range (.Paginate (.Data.Pages.GroupByDate "2006")).PageGroups }}
|
||||
```
|
||||
|
||||
## Build the navigation
|
||||
|
||||
The `.Paginator` contains enough information to build a paginator interface.
|
||||
|
||||
The easiest way to add this to your pages is to include the built-in template (with `Bootstrap`-compatible styles):
|
||||
|
||||
```
|
||||
{{ template "_internal/pagination.html" . }}
|
||||
```
|
||||
|
||||
**Note:** If you use any filters or ordering functions to create your `.Paginator` **and** you want the navigation buttons to be shown before the page listing, you must create the `.Paginator` before it's used:
|
||||
|
||||
```
|
||||
{{ $paginator := .Paginate (where .Data.Pages "Type" "post") }}
|
||||
{{ template "_internal/pagination.html" . }}
|
||||
{{ range $paginator.Pages }}
|
||||
{{ .Title }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
Without the where-filter, the above is simpler:
|
||||
|
||||
```
|
||||
{{ template "_internal/pagination.html" . }}
|
||||
{{ range .Paginator.Pages }}
|
||||
{{ .Title }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
If you want to build custom navigation, you can do so using the `.Paginator` object:
|
||||
|
||||
* `PageNumber`: The current page's number in the pager sequence
|
||||
* `URL`: The relative URL to the current pager
|
||||
* `Pages`: The pages in the current pager
|
||||
* `NumberOfElements`: The number of elements on this page
|
||||
* `HasPrev`: Whether there are page(s) before the current
|
||||
* `Prev`: The pager for the previous page
|
||||
* `HasNext`: Whether there are page(s) after the current
|
||||
* `Next`: The pager for the next page
|
||||
* `First`: The pager for the first page
|
||||
* `Last`: The pager for the last page
|
||||
* `Pagers`: A list of pagers that can be used to build a pagination menu
|
||||
* `PageSize`: Size of each pager
|
||||
* `TotalPages`: The number of pages in the paginator
|
||||
* `TotalNumberOfElements`: The number of elements on all pages in this paginator
|
||||
|
||||
## Additional information
|
||||
|
||||
The pages are built on the following form (`BLANK` means no value):
|
||||
|
||||
```
|
||||
[SECTION/TAXONOMY/BLANK]/index.html
|
||||
[SECTION/TAXONOMY/BLANK]/page/1/index.html => redirect to [SECTION/TAXONOMY/BLANK]/index.html
|
||||
[SECTION/TAXONOMY/BLANK]/page/2/index.html
|
||||
....
|
||||
```
|
||||
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /doc/permalinks/
|
||||
lastmod: 2015-01-19
|
||||
date: 2013-11-18
|
||||
menu:
|
||||
main:
|
||||
parent: extras
|
||||
next: /extras/scratch
|
||||
notoc: true
|
||||
prev: /extras/pagination
|
||||
title: Permalinks
|
||||
---
|
||||
|
||||
By default, content is laid out into the target `publishdir` (public)
|
||||
namespace matching its layout within the `contentdir` hierarchy.
|
||||
The `permalinks` site configuration option allows you to adjust this on a
|
||||
per-section basis.
|
||||
This will change where the files are written to and will change the page's
|
||||
internal "canonical" location, such that template references to
|
||||
`.RelPermalink` will honour the adjustments made as a result of the mappings
|
||||
in this option.
|
||||
|
||||
For instance, if one of your sections is called `post`, and you want to adjust
|
||||
the canonical path to be hierarchical based on the year and month, then you
|
||||
might use:
|
||||
|
||||
```yaml
|
||||
permalinks:
|
||||
post: /:year/:month/:title/
|
||||
```
|
||||
|
||||
Only the content under `post/` will be so rewritten.
|
||||
A file named `content/post/sample-entry` which contains a line
|
||||
`date: 2013-11-18T19:20:00-05:00` might end up with the rendered page
|
||||
appearing at `public/2013/11/sample-entry/index.html` and be reachable via
|
||||
the URL <http://yoursite.example.com/2013/11/sample-entry/>.
|
||||
|
||||
The following is a list of values that can be used in a permalink definition.
|
||||
All references to time are dependent on the content's date.
|
||||
|
||||
* **:year** the 4-digit year
|
||||
* **:month** the 2-digit month
|
||||
* **:monthname** the name of the month
|
||||
* **:day** the 2-digit day
|
||||
* **:weekday** the 1-digit day of the week (Sunday = 0)
|
||||
* **:weekdayname** the name of the day of the week
|
||||
* **:yearday** the 1- to 3-digit day of the year
|
||||
* **:section** the content's section
|
||||
* **:title** the content's title
|
||||
* **:slug** the content's slug (or title if no slug)
|
||||
* **:filename** the content's filename (without extension)
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
---
|
||||
lastmod: 2016-01-06
|
||||
date: 2015-12-08
|
||||
menu:
|
||||
main:
|
||||
parent: extras
|
||||
next: /extras/datafiles
|
||||
prev: /extras/crossreferences
|
||||
title: Custom robots.txt
|
||||
---
|
||||
|
||||
Hugo can generate a customized [robots.txt](http://www.robotstxt.org/) in the
|
||||
[same way as any other templates]({{< ref "templates/go-templates.md" >}}).
|
||||
|
||||
To enable it, just set `enableRobotsTXT` option to `true` in the [configuration file]({{< ref "overview/configuration.md" >}}). By default, it generates a robots.txt, which allows everything, with the following content:
|
||||
|
||||
```http
|
||||
User-agent: *
|
||||
```
|
||||
|
||||
|
||||
Hugo will use the template `robots.txt` according to the following list in descending precedence:
|
||||
|
||||
* /layouts/robots.txt
|
||||
* /themes/`THEME`/layout/robots.txt
|
||||
|
||||
An example of a robots.txt layout is:
|
||||
|
||||
```http
|
||||
User-agent: *
|
||||
|
||||
{{range .Data.Pages}}
|
||||
Disallow: {{.RelPermalink}}{{end}}
|
||||
```
|
||||
|
||||
This template disallows and all the pages of the site creating one `Disallow` entry for each one.
|
||||
@@ -1,413 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /doc/shortcodes/
|
||||
lastmod: 2016-02-03
|
||||
date: 2013-07-01
|
||||
menu:
|
||||
main:
|
||||
parent: extras
|
||||
next: /extras/highlighting
|
||||
prev: /extras/scratch
|
||||
title: Shortcodes
|
||||
toc: true
|
||||
---
|
||||
|
||||
Hugo uses Markdown for its simple content format. However, there are a lot
|
||||
of things that Markdown doesn’t support well.
|
||||
|
||||
We are unwilling to accept being constrained by our simple format. Also
|
||||
unacceptable is writing raw HTML in our Markdown every time we want to include
|
||||
unsupported content such as a video. To do so is in complete opposition to the
|
||||
intent of using a bare-bones format for our content and utilizing templates to
|
||||
apply styling for display.
|
||||
|
||||
To avoid both of these limitations, Hugo created shortcodes.
|
||||
|
||||
A shortcode is a simple snippet inside a content file that Hugo will render
|
||||
using a predefined template. Note that shortcodes will not work in template
|
||||
files---if you need a functionality like that in a template, you most likely
|
||||
want a [partial template](/templates/partials/) instead.
|
||||
|
||||
Another benefit is, you can update your shortcode with any related new classes or
|
||||
techniques, and upon generation, Hugo will easily merge in your changes. You
|
||||
avoid a possibly complicated search and replace operation.
|
||||
|
||||
## Using a shortcode
|
||||
|
||||
In your content files, a shortcode can be called by using the `{{%/* name parameters
|
||||
*/%}}` form. Shortcode parameters are space delimited. Parameters with spaces
|
||||
can be quoted.
|
||||
|
||||
The first word is always the name of the shortcode. Parameters follow the name.
|
||||
Depending upon how the shortcode is defined, the parameters may be named,
|
||||
positional or both (although you can't mix parameter types in a single call).
|
||||
The format for named parameters models that of HTML with the format
|
||||
`name="value"`.
|
||||
|
||||
Some shortcodes use or require closing shortcodes. Like HTML, the opening and closing
|
||||
shortcodes match (name only), the closing being prepended with a slash.
|
||||
|
||||
Example of a paired shortcode:
|
||||
|
||||
{{</* highlight go */>}} A bunch of code here {{</* /highlight */>}}
|
||||
|
||||
The examples above use two different delimiters, the difference being the `%` and the `<` character:
|
||||
|
||||
### Shortcodes with Markdown
|
||||
|
||||
The `%` characters indicates that the shortcode's inner content needs further processing by the page's rendering processor (i.e. Markdown), needed to get the **bold** text in the example below:
|
||||
|
||||
|
||||
{{%/* myshortcode */%}}Hello **World!**{{%/* /myshortcode */%}}
|
||||
|
||||
|
||||
### Shortcodes without Markdown
|
||||
|
||||
The `<` character indicates that the shortcode's inner content doesn't need any further rendering, this will typically be pure HTML:
|
||||
|
||||
{{</* myshortcode */>}}<p>Hello <strong>World!</strong></p>{{</* /myshortcode */>}}
|
||||
|
||||
|
||||
## Built-in Shortcodes
|
||||
|
||||
Hugo ships with a set of predefined shortcodes.
|
||||
|
||||
### highlight
|
||||
|
||||
This shortcode will convert the source code provided into syntax highlighted
|
||||
HTML. Read more on [highlighting](/extras/highlighting/).
|
||||
|
||||
#### Usage
|
||||
|
||||
`highlight` takes exactly one required parameter of _language_ and requires a
|
||||
closing shortcode.
|
||||
|
||||
#### Example
|
||||
|
||||
{{</* highlight html */>}}
|
||||
<section id="main">
|
||||
<div>
|
||||
<h1 id="title">{{ .Title }}</h1>
|
||||
{{ range .Data.Pages }}
|
||||
{{ .Render "summary"}}
|
||||
{{ end }}
|
||||
</div>
|
||||
</section>
|
||||
{{</* /highlight */>}}
|
||||
|
||||
|
||||
#### Example Output
|
||||
|
||||
<span style="color: #f92672"><section</span> <span style="color: #a6e22e">id=</span><span style="color: #e6db74">"main"</span><span style="color: #f92672">></span>
|
||||
<span style="color: #f92672"><div></span>
|
||||
<span style="color: #f92672"><h1</span> <span style="color: #a6e22e">id=</span><span style="color: #e6db74">"title"</span><span style="color: #f92672">></span>{{ .Title }}<span style="color: #f92672"></h1></span>
|
||||
{{ range .Data.Pages }}
|
||||
{{ .Render "summary"}}
|
||||
{{ end }}
|
||||
<span style="color: #f92672"></div></span>
|
||||
<span style="color: #f92672"></section></span>
|
||||
|
||||
### figure
|
||||
|
||||
`figure` is simply an extension of the image capabilities present with Markdown.
|
||||
`figure` provides the ability to add captions, CSS classes, alt text, links etc.
|
||||
|
||||
#### Usage
|
||||
|
||||
`figure` can use the following named parameters:
|
||||
|
||||
* src
|
||||
* link
|
||||
* title
|
||||
* caption
|
||||
* class
|
||||
* attr (attribution)
|
||||
* attrlink
|
||||
* alt
|
||||
|
||||
#### Example
|
||||
|
||||
{{</* figure src="/media/spf13.jpg" title="Steve Francia" */>}}
|
||||
|
||||
#### Example output
|
||||
|
||||
<figure>
|
||||
<img src="/media/spf13.jpg" />
|
||||
<figcaption>
|
||||
<h4>Steve Francia</h4>
|
||||
</figcaption>
|
||||
</figure>
|
||||
|
||||
### ref, relref
|
||||
|
||||
These shortcodes will look up the pages by their relative path (e.g.,
|
||||
`blog/post.md`) or their logical name (`post.md`) and return the permalink
|
||||
(`ref`) or relative permalink (`relref`) for the found page.
|
||||
|
||||
`ref` and `relref` also make it possible to make fragmentary links that work
|
||||
for the header links generated by Hugo.
|
||||
|
||||
Read more on [cross-references]({{% ref "extras/crossreferences.md" %}}).
|
||||
|
||||
#### Usage
|
||||
|
||||
`ref` and `relref` take exactly one required parameter of _reference_.
|
||||
|
||||
#### Example
|
||||
|
||||
[Neat]({{</* ref "blog/neat.md" */>}})
|
||||
[Who]({{</* relref "about.md#who" */>}})
|
||||
|
||||
If the page exists in multiple [output formats]({{< relref "extras/output-formats.md" >}}), `ref` or `relref` can be used with a output format name:
|
||||
|
||||
[Neat]({{</* ref "blog/neat.md" "amp" */>}})
|
||||
|
||||
|
||||
#### Example Output
|
||||
|
||||
Assuming that standard Hugo pretty URLs are turned on.
|
||||
|
||||
<a href="/blog/neat">Neat</a>
|
||||
<a href="/about/#who:c28654c202e73453784cfd2c5ab356c0">Who</a>
|
||||
|
||||
### Twitter
|
||||
|
||||
You want to include a single tweet into your blog post? Everything you need is the URL of the tweet, e.g.:
|
||||
|
||||
* https://twitter.com/spf13/status/666616452582129664
|
||||
|
||||
Pass the tweet's ID from the URL as parameter to the shortcode as shown below:
|
||||
|
||||
{{</* tweet 666616452582129664 */>}}
|
||||
|
||||
### YouTube
|
||||
|
||||
This shortcode embeds a responsive video player for [YouTube](https://www.youtube.com/) videos. Only the ID of the video is required, e.g.:
|
||||
|
||||
* https://www.youtube.com/watch?v=w7Ft2ymGmfc
|
||||
|
||||
Copy the ID from behind `v=` and pass it to the shortcode:
|
||||
|
||||
{{</* youtube w7Ft2ymGmfc */>}}
|
||||
|
||||
Furthermore, you can autoplay the embedded video by setting the `autoplay` parameter to true. Remember that you can't mix named and unnamed parameters. Assign the yet unnamed video id to the parameter `id` like below too.
|
||||
|
||||
{{</* youtube id="w7Ft2ymGmfc" autoplay="true" */>}}
|
||||
|
||||
|
||||
### Vimeo
|
||||
|
||||
Adding a video from [Vimeo](https://vimeo.com/) is equivalent to the YouTube shortcode above. Extract the ID from the URL, e.g.:
|
||||
|
||||
* https://vimeo.com/channels/staffpicks/146022717
|
||||
|
||||
and pass it to the shortcode:
|
||||
|
||||
{{</* vimeo 146022717 */>}}
|
||||
|
||||
### GitHub gists
|
||||
|
||||
Including code snippets with GitHub gists while writing a tutorial is common situation bloggers face. With a given URL of the gist, e.g.:
|
||||
|
||||
* https://gist.github.com/spf13/7896402
|
||||
|
||||
pass the owner and the ID of the gist to the shortcode:
|
||||
|
||||
{{</* gist spf13 7896402 */>}}
|
||||
|
||||
If the gist contains several files and you want to quote just one of them, you can pass the filename (quoted) as an optional third argument:
|
||||
|
||||
{{</* gist spf13 7896402 "img.html" */>}}
|
||||
|
||||
### Speaker Deck
|
||||
|
||||
To embed slides from [Speaker Deck](https://speakerdeck.com/), click on "< /> Embed" (under Share right next to the template on Speaker Deck) and copy the URL, e.g.:
|
||||
|
||||
<script async class="speakerdeck-embed" data-id="4e8126e72d853c0060001f97" data-ratio="1.33333333333333" src="//speakerdeck.com/assets/embed.js"></script>
|
||||
|
||||
Extract the value from the field `data-id` and pass it to the shortcode:
|
||||
|
||||
{{</* speakerdeck 4e8126e72d853c0060001f97 */>}}
|
||||
|
||||
### Instagram
|
||||
|
||||
If you'd like to embed photo from [Instagram](https://www.instagram.com/), all you need is photo ID from the URL, e. g.:
|
||||
|
||||
* https://www.instagram.com/p/BMokmydjG-M/
|
||||
|
||||
Pass it to the shortcode:
|
||||
|
||||
{{</* instagram BMokmydjG-M */>}}
|
||||
|
||||
Optionally, hide caption:
|
||||
|
||||
{{</* instagram BMokmydjG-M hidecaption */>}}
|
||||
|
||||
## Creating your own shortcodes
|
||||
|
||||
To create a shortcode, place a template in the layouts/shortcodes directory. The
|
||||
template name will be the name of the shortcode.
|
||||
|
||||
In creating a shortcode, you can choose if the shortcode will use _positional
|
||||
parameters_, or _named parameters_, or _both_. A good rule of thumb is that if a
|
||||
shortcode has a single required value in the case of the `youtube` example below,
|
||||
then positional works very well. For more complex layouts with optional
|
||||
parameters, named parameters work best. Allowing both types of parameters is
|
||||
useful for complex layouts where you want to set default values that can be
|
||||
overridden.
|
||||
|
||||
**Inside the template**
|
||||
|
||||
To access a parameter by position, the `.Get` method can be used:
|
||||
|
||||
{{ .Get 0 }}
|
||||
|
||||
To access a parameter by name, the `.Get` method should be utilized:
|
||||
|
||||
{{ .Get "class" }}
|
||||
|
||||
`with` is great when the output depends on a parameter being set:
|
||||
|
||||
{{ with .Get "class"}} class="{{.}}"{{ end }}
|
||||
|
||||
`.Get` can also be used to check if a parameter has been provided. This is
|
||||
most helpful when the condition depends on either one value or another...
|
||||
or both:
|
||||
|
||||
{{ or .Get "title" | .Get "alt" | if }} alt="{{ with .Get "alt"}}{{.}}{{else}}{{.Get "title"}}{{end}}"{{ end }}
|
||||
|
||||
If a closing shortcode is used, the variable `.Inner` will be populated with all
|
||||
of the content between the opening and closing shortcodes. If a closing
|
||||
shortcode is required, you can check the length of `.Inner` and provide a warning
|
||||
to the user.
|
||||
|
||||
A shortcode with `.Inner` content can be used without the inline content, and without the closing shortcode, by using the self-closing syntax:
|
||||
|
||||
{{</* innershortcode /*/>}}
|
||||
|
||||
The variable `.Params` contains the list of parameters in case you need to do
|
||||
more complicated things than `.Get`. It is sometimes useful to provide a
|
||||
flexible shortcode that can take named or positional parameters. To meet this
|
||||
need, Hugo shortcodes have a `.IsNamedParams` boolean available that can be used
|
||||
such as `{{ if .IsNamedParams }}...{{ else }}...{{ end }}`. See the
|
||||
`Single Flexible Example` below for an example.
|
||||
|
||||
You can also use the variable `.Page` to access all the normal [Page Variables](/templates/variables/).
|
||||
|
||||
A shortcodes can be nested. In a nested shortcode you can access the parent shortcode context with `.Parent`. This can be very useful for inheritance of common shortcode parameters from the root.
|
||||
|
||||
## Single Positional Example: youtube
|
||||
|
||||
{{</* youtube 09jf3ow9jfw */>}}
|
||||
|
||||
Would load the template /layouts/shortcodes/youtube.html
|
||||
|
||||
<div class="embed video-player">
|
||||
<iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube.com/embed/{{ index .Params 0 }}" allowfullscreen frameborder="0">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
This would be rendered as:
|
||||
|
||||
<div class="embed video-player">
|
||||
<iframe class="youtube-player" type="text/html"
|
||||
width="640" height="385"
|
||||
src="http://www.youtube.com/embed/09jf3ow9jfw"
|
||||
allowfullscreen frameborder="0">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
## Single Named Example: image with caption
|
||||
|
||||
{{</* img src="/media/spf13.jpg" title="Steve Francia" */>}}
|
||||
|
||||
Would load the template /layouts/shortcodes/img.html
|
||||
|
||||
<!-- image -->
|
||||
<figure {{ with .Get "class" }}class="{{.}}"{{ end }}>
|
||||
{{ with .Get "link"}}<a href="{{.}}">{{ end }}
|
||||
<img src="{{ .Get "src" }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}"{{ end }} />
|
||||
{{ if .Get "link"}}</a>{{ end }}
|
||||
{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
|
||||
<figcaption>{{ if isset .Params "title" }}
|
||||
<h4>{{ .Get "title" }}</h4>{{ end }}
|
||||
{{ if or (.Get "caption") (.Get "attr")}}<p>
|
||||
{{ .Get "caption" }}
|
||||
{{ with .Get "attrlink"}}<a href="{{.}}"> {{ end }}
|
||||
{{ .Get "attr" }}
|
||||
{{ if .Get "attrlink"}}</a> {{ end }}
|
||||
</p> {{ end }}
|
||||
</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
||||
<!-- image -->
|
||||
|
||||
Would be rendered as:
|
||||
|
||||
<figure >
|
||||
<img src="/media/spf13.jpg" />
|
||||
<figcaption>
|
||||
<h4>Steve Francia</h4>
|
||||
</figcaption>
|
||||
</figure>
|
||||
|
||||
## Single Flexible Example: vimeo with defaults
|
||||
|
||||
{{</* vimeo 49718712 */>}}
|
||||
{{</* vimeo id="49718712" class="flex-video" */>}}
|
||||
|
||||
Would load the template /layouts/shortcodes/vimeo.html
|
||||
|
||||
{{ if .IsNamedParams }}
|
||||
<div class="{{ if .Get "class" }}{{ .Get "class" }}{{ else }}vimeo-container{{ end }}">
|
||||
<iframe src="//player.vimeo.com/video/{{ .Get "id" }}" allowfullscreen></iframe>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="{{ if len .Params | eq 2 }}{{ .Get 1 }}{{ else }}vimeo-container{{ end }}">
|
||||
<iframe src="//player.vimeo.com/video/{{ .Get 0 }}" allowfullscreen></iframe>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
Would be rendered as:
|
||||
|
||||
<div class="vimeo-container">
|
||||
<iframe src="//player.vimeo.com/video/49718712" allowfullscreen></iframe>
|
||||
</div>
|
||||
<div class="flex-video">
|
||||
<iframe src="//player.vimeo.com/video/49718712" allowfullscreen></iframe>
|
||||
</div>
|
||||
|
||||
## Paired Example: Highlight
|
||||
*Hugo already ships with the `highlight` shortcode*
|
||||
|
||||
{{</* highlight html */>}}
|
||||
<html>
|
||||
<body> This HTML </body>
|
||||
</html>
|
||||
{{</* /highlight */>}}
|
||||
|
||||
The template for this utilizes the following code (already included in Hugo)
|
||||
|
||||
{{ .Get 0 | highlight .Inner }}
|
||||
|
||||
And will be rendered as:
|
||||
|
||||
<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span style="color: #f92672"><html></span>
|
||||
<span style="color: #f92672"><body></span> This HTML <span style="color: #f92672"></body></span>
|
||||
<span style="color: #f92672"></html></span>
|
||||
</pre></div>
|
||||
|
||||
Please notice that this template makes use of a Hugo-specific template function
|
||||
called `highlight` which uses Pygments to add the highlighting code.
|
||||
|
||||
## Simple Single-word Example: Year
|
||||
|
||||
Let's assume you would like to have a shortcode to be replaced by the current year in your Markdown content files, for a license or copyright statement. Calling a shortcode like this:
|
||||
|
||||
{{</* year */>}}
|
||||
|
||||
... would load your one-line template ``/layouts/shortcodes/year.html``, which contains:
|
||||
|
||||
{{ .Page.Now.Year }}
|
||||
|
||||
More shortcode examples can be found at [spf13.com](https://github.com/spf13/spf13.com/tree/master/layouts/shortcodes).
|
||||
@@ -1,37 +0,0 @@
|
||||
---
|
||||
lastmod: 2015-01-27
|
||||
date: 2013-07-09
|
||||
menu:
|
||||
main:
|
||||
parent: extras
|
||||
next: /extras/localfiles
|
||||
prev: /extras/highlighting
|
||||
title: Table of Contents
|
||||
---
|
||||
|
||||
Hugo will automatically parse the Markdown for your content and create
|
||||
a Table of Contents you can use to guide readers to the sections within
|
||||
your content.
|
||||
|
||||
## Usage
|
||||
|
||||
Simply create content like you normally would with the appropriate
|
||||
headers.
|
||||
|
||||
Hugo will take this Markdown and create a table of contents stored in the
|
||||
[content variable](/layout/variables/) `.TableOfContents`
|
||||
|
||||
|
||||
## Template Example
|
||||
|
||||
This is example code of a [single.html template](/layout/content/).
|
||||
|
||||
{{ partial "header.html" . }}
|
||||
<div id="toc" class="well col-md-4 col-sm-6">
|
||||
{{ .TableOfContents }}
|
||||
</div>
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ .Content }}
|
||||
{{ partial "footer.html" . }}
|
||||
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /doc/urls/
|
||||
lastmod: 2016-05-07
|
||||
date: 2014-01-03
|
||||
menu:
|
||||
main:
|
||||
parent: extras
|
||||
next: /community/mailing-list
|
||||
notoc: true
|
||||
prev: /extras/localfiles
|
||||
title: URLs
|
||||
---
|
||||
|
||||
## Pretty URLs
|
||||
|
||||
By default, Hugo creates content with 'pretty' URLs. For example,
|
||||
content created at `/content/extras/urls.md` will be rendered at
|
||||
`/public/extras/urls/index.html`, thus accessible from the browser
|
||||
at http://example.com/extras/urls/. No non-standard server-side
|
||||
configuration is required for these pretty URLs to work.
|
||||
|
||||
If you would like to have what we call "ugly URLs",
|
||||
e.g. http://example.com/extras/urls.html, you are in luck.
|
||||
Hugo supports the ability to create your entire site with ugly URLs.
|
||||
Simply add `uglyurls = true` to your site-wide `config.toml`,
|
||||
or use the `--uglyURLs=true` flag on the command line.
|
||||
|
||||
If you want a specific piece of content to have an exact URL, you can
|
||||
specify this in the front matter under the `url` key. See [Content
|
||||
Organization](/content/organization/) for more details.
|
||||
|
||||
## Canonicalization
|
||||
|
||||
By default, all relative URLs encountered in the input are left unmodified,
|
||||
e.g. `/css/foo.css` would stay as `/css/foo.css`,
|
||||
i.e. `canonifyURLs` defaults to `false`.
|
||||
|
||||
By setting `canonifyURLs` to `true`, all relative URLs would instead
|
||||
be *canonicalized* using `baseURL`. For example, assuming you have
|
||||
`baseURL = http://yoursite.example.com/` defined in the site-wide
|
||||
`config.toml`, the relative URL `/css/foo.css` would be turned into
|
||||
the absolute URL `http://yoursite.example.com/css/foo.css`.
|
||||
|
||||
Benefits of canonicalization include fixing all URLs to be absolute, which may
|
||||
aid with some parsing tasks. Note though that all real browsers handle this
|
||||
client-side without issues.
|
||||
|
||||
Benefits of non-canonicalization include being able to have resource inclusion
|
||||
be scheme-relative, so that http vs https can be decided based on how this
|
||||
page was retrieved.
|
||||
|
||||
> Note: In the May 2014 release of Hugo v0.11, the default value of `canonifyURLs` was switched from `true` to `false`, which we think is the better default and should continue to be the case going forward. So, please verify and adjust your website accordingly if you are upgrading from v0.10 or older versions.
|
||||
|
||||
To find out the current value of `canonifyURLs` for your website, you may use the handy `hugo config` command added in v0.13:
|
||||
|
||||
hugo config | grep -i canon
|
||||
|
||||
Or, if you are on Windows and do not have `grep` installed:
|
||||
|
||||
hugo config | FINDSTR /I canon
|
||||
|
||||
## Relative URLs
|
||||
|
||||
By default, all relative URLs are left unchanged by Hugo,
|
||||
which can be problematic when you want to make your site browsable from a local file system.
|
||||
|
||||
Setting `relativeURLs` to `true` in the site configuration will cause Hugo to rewrite all relative URLs to be relative to the current content.
|
||||
|
||||
For example, if the `/post/first/` page contained a link with a relative URL of `/about/`, Hugo would rewrite that URL to `../../about/`.
|
||||
@@ -0,0 +1,67 @@
|
||||
---
|
||||
title: .GetPage
|
||||
description: "Gets a `Page` of a given `Kind` and `path`."
|
||||
godocref:
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [functions]
|
||||
menu:
|
||||
docs:
|
||||
parent: "functions"
|
||||
#tags: [sections,lists,indexes]
|
||||
signature: [".GetPage TYPE PATH"]
|
||||
workson: []
|
||||
hugoversion:
|
||||
relatedfuncs: []
|
||||
deprecated: false
|
||||
aliases: []
|
||||
---
|
||||
|
||||
Every `Page` has a `Kind` attribute that shows what kind of page it is. While this attribute can be used to list pages of a certain `kind` using `where`, often it can be useful to fetch a single page by its path.
|
||||
|
||||
`.GetPage` looks up a page of a given `Kind` and `path`.
|
||||
|
||||
```
|
||||
{{ with .Site.GetPage "section" "blog" }}{{ .Title }}{{ end }}
|
||||
```
|
||||
|
||||
This method wil return `nil` when no page could be found, so the above will not print anything if the blog section isn't found.
|
||||
|
||||
For a regular page:
|
||||
|
||||
```
|
||||
{{ with .Site.GetPage "page" "blog" "my-post.md" }}{{ .Title }}{{ end }}
|
||||
```
|
||||
|
||||
Note that the path can also be supplied like this:
|
||||
|
||||
```
|
||||
{{ with .Site.GetPage "page" "blog/my-post.md" }}{{ .Title }}{{ end }}
|
||||
```
|
||||
|
||||
The valid page kinds are: *page, home, section, taxonomy and taxonomyTerm.*
|
||||
|
||||
## `.GetPage` Example
|
||||
|
||||
This code snippet---in the form of a [partial template][partials]---allows you to do the following:
|
||||
|
||||
1. Grab the index object of your `tags` [taxonomy][].
|
||||
2. Assign this object to a variable, `$t`
|
||||
3. Sort the terms associated with the taxonomy by popularity.
|
||||
4. Grab the top two most popular terms in the taxonomy (i.e., the two most popular tags assigned to content.
|
||||
|
||||
{{% code file="grab-top-two-tags.html" %}}
|
||||
```html
|
||||
<ul class="most-popular-tags">
|
||||
{{ $t := $.Site.GetPage "taxonomyTerm" "tags" }}
|
||||
{{ range first 2 $t.Data.Terms.ByCount }}
|
||||
<li>{{.}}</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
```
|
||||
{{% /code %}}
|
||||
|
||||
|
||||
[partials]: /templates/partials/
|
||||
[taxonomy]: /content-management/taxonomies/
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
title: lang.NumFmt
|
||||
description: "Formats a number with a given precision using the requested `decimal`, `grouping`, and `negative` characters."
|
||||
godocref: ""
|
||||
workson: []
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [functions]
|
||||
#tags: [numbers]
|
||||
menu:
|
||||
docs:
|
||||
parent: "functions"
|
||||
toc: false
|
||||
signature: ["lang.NumFmt <decimal> <grouping> <negative> <precision> <number>"]
|
||||
workson: []
|
||||
hugoversion:
|
||||
relatedfuncs: []
|
||||
deprecated: false
|
||||
draft: false
|
||||
aliases: []
|
||||
comments:
|
||||
---
|
||||
|
||||
The default options value is `- . ,`.
|
||||
|
||||
Numbers greater than or equal to 5 are rounded up. For example, if precision is set to `0`, `1.5` becomes `2`, and `1.4` becomes `1`.
|
||||
|
||||
```
|
||||
{{ lang.NumFmt "," "." "-" 2 12345.6789 }} → 12.345,68
|
||||
{{ lang.NumFmt "." "" "-" 6 -12345.6789 }} → -12345.678900
|
||||
{{ lang.NumFmt "." "," "-" 0 -12345.6789 }} → -12,346
|
||||
{{ -98765.4321 | lang.NumFmt "." "," "-" 2 }} → -98,765.43
|
||||
```
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
title: Functions Quick Reference
|
||||
linktitle: Functions Quick Reference
|
||||
description: Comprehensive list of Hugo templating functions, including basic and advanced usage examples.
|
||||
godocref:
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
#tags: []
|
||||
menu:
|
||||
docs:
|
||||
parent: "functions"
|
||||
weight: 01 #rem
|
||||
draft: false
|
||||
aliases: [/layout/functions/,/templates/functions]
|
||||
---
|
||||
|
||||
Go templates are lightweight but extensible. Go itself supplies built-in functions, including comparison operators and other basic tools. These are listed in the [Go template documentation][gofuncs]. Hugo has added additional functions to the basic template logic.
|
||||
|
||||
[gofuncs]: http://golang.org/pkg/text/template/#hdr-Functions
|
||||
Loaded 100 of 580 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user