"stringifier",
"struct",
"toclevels",
+ "unpublishdate",
"zgotmplz",
"# ----------------------------------------------------------------------",
"# cspell: ignore foreign language words",
"Samsa",
"Stucki",
"Thénardier",
+ "WASI",
"# ----------------------------------------------------------------------",
"# cspell: ignore operating systems and software packages",
"# ----------------------------------------------------------------------",
"achristie",
"ddmaurier",
"dring",
+ "fleqn",
"inor",
"jausten",
"jdoe",
"jsmith",
+ "leqno",
"milli",
"rgba",
"rsmith",
[](https://app.netlify.com/sites/gohugoio/deploys)
[](https://gohugo.io/contribute/documentation/)
-This is the repository for the [Hugo](https://github.com/gohugoio/hugo) documentation site.
+This is the repository for the [Hugo](https://github.com/gohugoio/hugo) documentation site.
Please see the [contributing] section for guidelines, examples, and process.
-
-
[bep]: https://github.com/bep
[spf13]: https://github.com/spf13
[friends]: https://github.com/gohugoio/hugo/graphs/contributors
}
.sans-serif {
- font-family: 'Muli',
- avenir,
- 'helvetica neue', helvetica,
- ubuntu,
- roboto, noto,
- 'segoe ui', arial,
- sans-serif;
+ font-family: 'Muli', Avenir, 'Helvetica Neue', Helvetica, Roboto, Noto, 'Segoe UI', Arial, sans-serif;
}
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 238 79">
+ <defs>
+ <linearGradient id="a" x1="63.6351" x2="39.318" y1="54.0451" y2="1.59593" gradientUnits="userSpaceOnUse">
+ <stop offset=".24" stop-color="#00D886"/>
+ <stop offset=".51" stop-color="#007DFE"/>
+ </linearGradient>
+ <linearGradient id="b" x1="59.3792" x2=".674325" y1="4.38051" y2="63.0854" gradientUnits="userSpaceOnUse">
+ <stop offset=".27" stop-color="#007DFE"/>
+ <stop offset=".7" stop-color="#D249FC"/>
+ </linearGradient>
+ </defs>
+ <path fill="#000" fill-rule="evenodd" d="M107.38 35.54h-7.19v-4.29h12.41v2.31c0 2.63-.62 5-1.88 7.11-1.26 2.12-2.99 3.78-5.19 4.99-2.2 1.21-4.51 1.82-7.37 1.82-2.86 0-5.44-.67-7.74-2.02-2.31-1.34-4.12-3.2-5.44-5.56-1.32-2.36-1.98-5-1.98-7.91s.66-5.55 1.98-7.91c1.32-2.36 3.14-4.21 5.44-5.56 2.31-1.35 4.89-2.02 7.74-2.02 2.27 0 4.36.4 6.29 1.21 1.93.8 3.56 1.93 4.9 3.39 1.35 1.45 2.29 3.14 2.85 5.07h-5.71c-.49-1-1.14-1.86-1.95-2.59-.82-.73-1.76-1.28-2.84-1.67-1.08-.39-2.25-.58-3.5-.58-1.84 0-3.51.46-5 1.38-1.49.92-2.66 2.19-3.5 3.81-.84 1.62-1.26 3.44-1.26 5.47s.42 3.85 1.26 5.47c.84 1.62 2.01 2.89 3.5 3.81 1.49.92 3.16 1.38 5 1.38 1.71 0 3.25-.32 4.63-.96 1.38-.65 2.48-1.54 3.29-2.69.73-1.04 1.14-2.19 1.26-3.46Zm19.54-11c2.15 0 4.11.5 5.86 1.5s3.13 2.37 4.14 4.12c1.01 1.74 1.51 3.7 1.51 5.85 0 2.15-.5 4.1-1.51 5.85s-2.38 3.12-4.14 4.12c-1.76 1-3.74 1.5-5.89 1.5-2.15 0-4.11-.5-5.86-1.5s-3.13-2.37-4.14-4.12c-1.01-1.74-1.51-3.7-1.51-5.85 0-2.15.5-4.1 1.5-5.85s2.38-3.12 4.14-4.12c1.77-1 3.75-1.5 5.9-1.5Zm3.25 17.55c.95-.58 1.69-1.4 2.21-2.46s.78-2.25.78-3.62-.26-2.58-.79-3.63c-.52-1.05-1.26-1.87-2.21-2.46-.95-.59-2.04-.89-3.26-.89-1.22 0-2.31.3-3.26.88-.95.58-1.68 1.4-2.2 2.46-.52 1.06-.78 2.28-.78 3.64 0 1.36.26 2.56.78 3.62.52 1.05 1.25 1.88 2.2 2.46.94.59 2.04.88 3.26.88 1.22 0 2.32-.3 3.27-.88Zm17.73-25.08h.01l-.01-.01v.01Zm0 0h-5.3v29.96h19.75v-4.82H147.9V17.01Zm30.87 8.73c1.11.66 2.02 1.54 2.73 2.63v-3.31h4.96v21.92h-4.96v-3.31c-.71 1.09-1.62 1.98-2.73 2.63-1.36.8-2.95 1.2-4.76 1.2-1.94 0-3.68-.49-5.22-1.47-1.54-.98-2.75-2.34-3.62-4.09-.87-1.75-1.3-3.72-1.3-5.92 0-2.2.43-4.17 1.3-5.92.87-1.75 2.08-3.11 3.61-4.09 1.53-.98 3.28-1.47 5.23-1.47 1.81 0 3.4.4 4.76 1.2Zm-.29 16.36c.94-.59 1.67-1.41 2.2-2.46.53-1.05.79-2.26.79-3.63s-.26-2.58-.79-3.63c-.52-1.05-1.26-1.87-2.2-2.46-.94-.59-2.05-.89-3.25-.89-1.2 0-2.27.3-3.21.89-.94.59-1.67 1.41-2.19 2.46s-.78 2.26-.78 3.63.26 2.58.78 3.64 1.25 1.88 2.19 2.46c.94.59 1.99.88 3.21.88s2.31-.3 3.25-.89Zm24.72-17.56c1.57 0 2.95.34 4.13 1.03l.01.03c1.18.68 2.11 1.68 2.76 2.97.65 1.29.98 2.84.98 4.64v13.78h-5.03V33.98c0-1.06-.18-1.96-.54-2.7-.36-.74-.87-1.31-1.54-1.7-.67-.39-1.47-.59-2.4-.59-.99 0-1.88.22-2.65.67-.77.45-1.37 1.07-1.79 1.88-.42.81-.63 1.72-.63 2.75v12.69h-5.05V25.06h4.9v3.21c.63-1.06 1.44-1.92 2.45-2.55 1.25-.79 2.72-1.18 4.4-1.18Zm29.04 3.79v-11.3h5.05v29.96h-5.05v-3.28c-.71 1.07-1.61 1.94-2.71 2.59-1.36.8-2.95 1.2-4.76 1.2-1.94 0-3.68-.49-5.22-1.47-1.54-.98-2.75-2.34-3.62-4.09-.87-1.75-1.31-3.72-1.31-5.92 0-2.2.44-4.17 1.31-5.92.87-1.75 2.08-3.11 3.61-4.09 1.53-.98 3.27-1.47 5.23-1.47 1.81 0 3.4.4 4.76 1.2 1.1.64 2 1.52 2.71 2.59Zm-3.01 13.77c.95-.59 1.68-1.41 2.21-2.46s.79-2.26.79-3.63-.26-2.58-.79-3.63c-.53-1.05-1.27-1.87-2.21-2.46-.94-.59-2.05-.89-3.25-.89-1.2 0-2.27.3-3.21.89-.94.59-1.67 1.41-2.19 2.46s-.78 2.26-.78 3.63.26 2.58.78 3.64 1.25 1.88 2.19 2.46c.94.59 1.99.88 3.21.88s2.31-.3 3.25-.89ZM87.7037 74.19c.17-.31.25-.66.25-1.05h.01v-9.15h3.1v9.37c0 .88-.2 1.67-.61 2.38s-.97 1.26-1.68 1.66c-.71.4-1.52.6-2.41.6h-2.37v-2.85h1.95c.4 0 .75-.08 1.05-.25.31-.17.54-.4.71-.71Zm15.2603-1.9h-6.5003v3.02h7.3803v2.7H93.4437V63.99h10.2003v2.71h-7.1803v2.97h6.5003v2.62Zm6.16-5.52h-4.16v-2.78h11.39v2.78h-4.13V78h-3.1V66.77Zm17.2 3.9c.29.08.56.18.81.31h.01c.57.31 1.02.73 1.34 1.28.32.55.48 1.17.48 1.86 0 .75-.2 1.42-.61 2.01-.41.59-.98 1.05-1.72 1.38-.74.33-1.58.5-2.52.5h-6.35V63.99h6.23c.89 0 1.69.16 2.39.47.7.31 1.24.75 1.63 1.31.39.56.58 1.2.58 1.91 0 .62-.15 1.17-.44 1.65-.29.48-.7.86-1.21 1.12-.18.0945-.386.1532-.585.21l-.035.01Zm-2.8-4.33h-2.75v3.45h2.75c.38 0 .72-.08 1.01-.22.3-.14.52-.34.69-.61.17-.27.25-.59.25-.93 0-.34-.09-.64-.25-.89-.17-.26-.4-.45-.69-.59-.29-.14-.63-.21-1.01-.21Zm1.24 9.1c.32-.15.57-.35.75-.62v.02c.18-.27.27-.57.27-.93 0-.36-.09-.68-.27-.96-.18-.28-.44-.5-.76-.65-.33-.15-.7-.23-1.11-.23h-2.87v3.59h2.87c.42 0 .8-.07 1.12-.22Zm16.56-4.67c-.43.67-1.03 1.2-1.81 1.57h-.01c-.14.07-.3.13-.46.19l3.2 5.48h-3.54l-2.84-5.11h-2.02v5.11h-3.1V63.99h6.14c1.01 0 1.9.18 2.67.55.77.37 1.36.89 1.78 1.56.42.67.63 1.43.63 2.32 0 .89-.21 1.68-.64 2.35Zm-3.56-.61c.32-.16.57-.39.74-.68v.01c.17-.29.26-.63.26-1.03s-.09-.74-.26-1.03c-.17-.29-.42-.51-.74-.67-.32-.15-.7-.23-1.13-.23h-2.79v3.87h2.79c.43 0 .81-.08 1.13-.24Zm5.51 7.85 5.01-14.02h3.36l5.12 14.02h-3.09l-1.06-3.09h-5.2l-.99 3.09h-3.15Zm6.46-10.39-1.61 4.95h3.71l-1.72-4.95-.19-.9-.19.9Zm11.43 10.39h-3.2V63.99h3.2v14.02Zm5.44-14.02 6.02 9.48h.01v-9.48h2.83v14.02h-3.05l-6-9.48v9.48h-2.83V63.99h3.02Zm17.78 5.66c.71.13 1.33.4 1.88.79v-.02c.55.4.97.88 1.28 1.47.31.59.46 1.23.46 1.92 0 .85-.23 1.61-.68 2.28-.45.67-1.08 1.2-1.88 1.58-.81.38-1.74.57-2.77.57s-1.95-.19-2.75-.56c-.8-.37-1.43-.9-1.89-1.56-.46-.66-.7-1.44-.71-2.31h3.1c0 .36.1.68.29.96.19.28.46.49.81.64.35.15.75.23 1.18.23.43 0 .8-.07 1.12-.2.32-.13.56-.32.74-.57.18-.25.27-.53.27-.84 0-.39-.12-.71-.36-.97s-.57-.44-.98-.54l-2.52-.52c-.66-.14-1.24-.39-1.74-.75s-.89-.82-1.16-1.36c-.27-.55-.41-1.16-.41-1.83 0-.84.22-1.58.64-2.23.43-.65 1.02-1.16 1.78-1.53.76-.37 1.62-.55 2.6-.55s1.86.18 2.62.53c.76.35 1.36.84 1.79 1.47.43.62.66 1.35.68 2.16h-3.1c0-.3-.09-.57-.25-.81-.17-.24-.4-.42-.69-.55-.29-.14-.64-.2-1.02-.2s-.72.07-1.01.19c-.29.12-.52.3-.68.52-.16.23-.24.49-.24.79 0 .34.11.61.33.84.22.23.52.38.89.47l2.38.49Zm14.38 8.36h-3.2V63.99h3.2v14.02Zm7.88-14.02c1.33 0 2.53.31 3.59.91 1.06.61 1.9 1.44 2.5 2.51.61 1.06.91 2.27.91 3.59 0 1.32-.31 2.52-.91 3.59-.6 1.07-1.43 1.9-2.5 2.51-1.07.61-2.26.91-3.59.91h-5.47V63.99h5.47Zm2.01 10.86c.58-.35 1.03-.85 1.34-1.5v-.01c.31-.65.47-1.44.47-2.35 0-.91-.16-1.7-.47-2.35-.31-.65-.76-1.15-1.34-1.5-.58-.35-1.26-.52-2.05-.52h-2.32v8.75h2.32c.79 0 1.47-.17 2.05-.52Zm9.8-2.56v3.02h7.38v2.7h-10.4V63.99h10.2v2.71h-7.18v2.97h6.5v2.62h-6.5Z" clip-rule="evenodd"/>
+ <path fill="#00D886" d="m48.0521 58.1839 11.8755-.0017c2.2493 0 4.0722-1.8234 4.0722-4.0727V42.6029c0-1.1887-.5196-2.3186-1.422-3.0924L24.4164 6.80068c-.7384-.63244-1.6786-.98037-2.6508-.98037H9.89011c-2.24931 0-4.07273 1.82342-4.07273 4.07273V21.4014c0 1.1887.51957 2.3185 1.42197 3.0924L45.4002 57.203c.7383.633 1.6786.9804 2.6514.9804l.0005.0005Z"/>
+ <path fill="url(#a)" d="M49.4806 58.1818h10.4465c2.2493 0 4.0728-1.8234 4.0728-4.0727V41.0164c0-.1925-.014-.3851-.0408-.576L58.6815 3.49673C58.3952 1.49062 56.6765 0 54.65 0H38.977c-2.2499 0-4.0733 1.824-4.0727 4.07389l.0047 18.53851c0 .4375.0704.8721.2088 1.2869l10.4995 31.4979c.5545 1.6629 2.1109 2.7846 3.8639 2.7846h-.0006Z"/>
+ <path fill="url(#b)" d="M4.07273 64H38.041c1.6291 0 3.1017-.9711 3.7434-2.4681l16.0681-37.4906c.217-.5068.3293-1.0531.3293-1.6046V4.07273C58.1818 1.82342 56.3584 0 54.1091 0h-17.966c-.8046 0-1.5912.238545-2.2609.685382L1.81353 22.0881C.681309 22.8439.001745 24.1146.001745 25.4755L0 59.9273C0 62.1766 1.82342 64 4.07273 64Z"/>
+ <path fill="#000" d="M52 12H12v40h40V12Z"/>
+ <path fill="#fff" d="M19.764 31.6245c1.174.6765 2.4847 1.0155 3.9318 1.0155 1.3899 0 2.6427-.3095 3.7589-.9293 1.1231-.6197 2.005-1.4651 2.6461-2.5384.6481-1.0798.9721-2.2857.9721-3.6183v-1.1879h-6.405v2.3221h3.516c-.0722.5605-.2761 1.0718-.6106 1.5339-.3958.5468-.9322.9762-1.6092 1.2852-.6701.3096-1.4188.4646-2.2469.4646-.8928 0-1.6988-.2227-2.4193-.6695-.7204-.4467-1.2857-1.0583-1.6959-1.836-.4034-.784-.6047-1.667-.6047-2.6461 0-.979.2013-1.858.6047-2.6357.4108-.7846.9761-1.4003 1.6959-1.847.7199-.4467 1.5265-.6695 2.4193-.6695.6053 0 1.1706.0972 1.696.2916.526.1875.9831.4577 1.372.8101.3958.3455.7094.7563.9397 1.2314h3.1542c-.2737-.9866-.7529-1.8575-1.4368-2.6137-.677-.7563-1.5126-1.3436-2.5061-1.7608-.9866-.4172-2.0669-.6267-3.2404-.6267-1.4477 0-2.7583.3414-3.9318 1.0259-1.1741.6765-2.0959 1.6133-2.7653 2.8082-.6695 1.1879-1.0046 2.5165-1.0046 3.9856 0 1.4692.3351 2.8018 1.0046 3.9967.67 1.1879 1.5918 2.1236 2.7653 2.8081Z"/>
+ <path fill="#fff" fill-rule="evenodd" d="M36.1829 31.6245c1.181.6765 2.4951 1.0155 3.9422 1.0155 1.4541 0 2.7688-.339 3.9423-1.0155 1.181-.6845 2.1062-1.6202 2.7757-2.8081.6695-1.1949 1.0045-2.5275 1.0045-3.9967 0-1.4691-.335-2.7977-1.0045-3.9856-.6695-1.1949-1.5947-2.1317-2.7757-2.8082C42.8939 17.3414 41.5723 17 40.1251 17c-1.4471 0-2.7612.3414-3.9422 1.0259-1.1735.6765-2.0988 1.6133-2.7758 2.8082-.6695 1.1879-1.0045 2.5165-1.0045 3.9856 0 1.4692.335 2.8018 1.0045 3.9967.6765 1.1879 1.6023 2.1236 2.7758 2.8081Zm6.3621-2.2463c-.7129.4468-1.516.6695-2.4089.6695-.8928 0-1.6994-.2227-2.4193-.6695-.7128-.4536-1.2747-1.0756-1.685-1.8684-.4033-.7991-.6046-1.696-.6046-2.6895 0-.9935.2013-1.8858.6046-2.6785.4103-.7991.9722-1.4217 1.685-1.8684.7199-.4537 1.5265-.6805 2.4193-.6805.8929 0 1.696.2268 2.4089.6805.7129.4467 1.2707 1.0693 1.674 1.8684.4033.7921.6047 1.685.6047 2.6785s-.2014 1.8904-.6047 2.6895c-.4033.7922-.9611 1.4148-1.674 1.8684Z" clip-rule="evenodd"/>
+ <path fill="#fff" d="M16.9941 44h16v3h-16v-3Z"/>
+</svg>
font-family: 'inconsolata',Menlo,Monaco,'Courier New',monospace;
}
.sans-serif {
- font-family: 'Muli',
- avenir,
- 'helvetica neue', helvetica,
- ubuntu,
- roboto, noto,
- 'segoe ui', arial,
- sans-serif;
+ font-family: 'Muli', Avenir, 'Helvetica Neue', Helvetica, Roboto, Noto, 'Segoe UI', Arial, sans-serif;
}
.serif {
font-family: Palatino,"Palatino Linotype","Palatino LT STD","Book Antiqua",Georgia,serif;
link_attr = "style='color: #ffffff; font-weight: bold; text-decoration: none; text-align: center'"
[[banners]]
- name = "Your Company?"
- link = "https://bep.is/en/hugo-sponsor-2023-01/"
- utm_campaign = "hugosponsor"
- show_on_hover = true
- bgcolor = "#4e4f4f"
- link_attr = "style='color: #ffffff; font-weight: bold; text-decoration: none; text-align: center'"
+ name = "GoLand"
+ title = "The complete IDE crafted for professional Go developers."
+ no_query_params = true
+ link = "https://www.jetbrains.com/go/?utm_source=OSS&utm_medium=referral&utm_campaign=hugo"
+ logo = "images/sponsors/goland.svg"
+ bgcolor = "#f4f4f4"
</head>
<body
- class="ma0 sans-serif bg-primary-color-light{{ with getenv "HUGO_ENV" }}
- {{ . }}
- {{ end }} {{ if $hasMath }}{{ print " dn" }}{{ end }}">
+ class="ma0 sans-serif bg-primary-color-light{{ with getenv "HUGO_ENV" }} {{ . }}{{ end }}">
{{ partial "hooks/after-body-start.html" . }}
{{ block "nav" . }}{{ partial "site-nav.html" . }}{{ end }}
{{ block "header" . }}{{ end }}
{{ $query_params := .query_params | default "" }}
{{ $url := .link }}
{{ if not .no_query_params }}
- {{ $url = printf "%s?%s%s" .link $query_params (querify "utm_source" (.utm_source | default $utmSource ) "utm_medium" "banner" "utm_campaign" (.utm_campaign | default "hugosponsor") "utm_content" (.utm_content | default "gohugoio")) | safeURL }}
+ {{ $url = printf "%s?%s%s" .link $query_params (querify "utm_source" (.utm_source | default $utmSource ) "utm_medium" (.utm_medium | default "banner") "utm_campaign" (.utm_campaign | default "hugosponsor") "utm_content" (.utm_content | default "gohugoio")) | safeURL }}
{{ end }}
{{ $logo := resources.Get .logo }}
{{ $gtagID := printf "Sponsor %s %s" .name $gtag | title }}
<script>
MathJax = {
tex: {
- inlineMath: [['$', '$'], ['\\(', '\\)']], // inline
- displayMath: [['$$', '$$'], ['\\[', '\\]']] // block
- },
- startup: {
- pageReady: () => {
- return MathJax.startup.defaultPageReady().then(() => {
- document.body.classList.remove("dn");
- });
- }
+ displayMath: [['\\[', '\\]'], ['$$', '$$']], // block
+ inlineMath: [['\\(', '\\)']] // inline
}
};
</script>
-<a
- href="https://twitter.com/intent/follow?screen_name=gohugoiov2"
- title="Follow on Twitter"
- class="link-transition twitter link dib z-999 pt3 pt0-l mr2">
- {{ partial "svg/twitter.svg" (dict "size" "32px") }}
-</a>
<a
rel="me"
class="mstdn mr3"
For more information about Go Modules, see:
-* https://github.com/golang/go/wiki/Modules
+* https://go.dev/wiki/Modules
* https://blog.golang.org/using-go-modules
` }}
-Also see [Module Mounts Config](/hugo-modules/configuration/#module-configuration-mounts) for an alternative way to configure this directory (from Hugo 0.56).
+Also see [Module Mounts Config](/hugo-modules/configuration/#module-configuration-mounts) for an alternative way to configure this directory.
-# github.com/gohugoio/gohugoioTheme v0.0.0-20240815082608-66ccd383a90f
+# github.com/gohugoio/gohugoioTheme v0.0.0-20241105120803-6c6e5fb8f8af
---
## hugo
-hugo builds your site
+Build your site
### Synopsis
### SEE ALSO
+* [hugo build](/commands/hugo_build/) - Build your site
* [hugo completion](/commands/hugo_completion/) - Generate the autocompletion script for the specified shell
-* [hugo config](/commands/hugo_config/) - Print the site configuration
-* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
-* [hugo deploy](/commands/hugo_deploy/) - Deploy your site to a Cloud provider.
-* [hugo env](/commands/hugo_env/) - Print Hugo version and environment info
-* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
-* [hugo import](/commands/hugo_import/) - Import your site from others.
-* [hugo list](/commands/hugo_list/) - Listing out various types of content
-* [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers.
-* [hugo new](/commands/hugo_new/) - Create new content for your site
-* [hugo server](/commands/hugo_server/) - A high performance webserver
-* [hugo version](/commands/hugo_version/) - Print Hugo version and environment info
+* [hugo config](/commands/hugo_config/) - Display site configuration
+* [hugo convert](/commands/hugo_convert/) - Convert front matter to another format
+* [hugo deploy](/commands/hugo_deploy/) - Deploy your site to a cloud provider
+* [hugo env](/commands/hugo_env/) - Display version and environment info
+* [hugo gen](/commands/hugo_gen/) - Generate documentation and syntax highlighting styles
+* [hugo import](/commands/hugo_import/) - Import a site from another system
+* [hugo list](/commands/hugo_list/) - List content
+* [hugo mod](/commands/hugo_mod/) - Manage modules
+* [hugo new](/commands/hugo_new/) - Create new content
+* [hugo server](/commands/hugo_server/) - Start the embedded web server
+* [hugo version](/commands/hugo_version/) - Display version
--- /dev/null
+---
+title: "hugo build"
+slug: hugo_build
+url: /commands/hugo_build/
+---
+## hugo build
+
+Build your site
+
+### Synopsis
+
+build is the main command, used to build your Hugo site.
+
+Hugo is a Fast and Flexible Static Site Generator
+built with love by spf13 and friends in Go.
+
+Complete documentation is available at https://gohugo.io/.
+
+```
+hugo build [flags]
+```
+
+### Options
+
+```
+ -b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
+ -D, --buildDrafts include content marked as draft
+ -E, --buildExpired include expired content
+ -F, --buildFuture include content with publishdate in the future
+ --cacheDir string filesystem path to cache directory
+ --cleanDestinationDir remove files from destination not found in static directories
+ --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
+ --config string config file (default is hugo.yaml|json|toml)
+ --configDir string config dir (default "config")
+ -c, --contentDir string filesystem path to content directory
+ --debug debug output
+ -d, --destination string filesystem path to write files to
+ --disableKinds strings disable different kind of pages (home, RSS etc.)
+ --enableGitInfo add Git revision, date, author, and CODEOWNERS info to the pages
+ -e, --environment string build environment
+ --forceSyncStatic copy all files when static is changed.
+ --gc enable to run some cleanup tasks (remove unused cache files) after the build
+ -h, --help help for build
+ --ignoreCache ignores the cache directory
+ --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
+ -l, --layoutDir string filesystem path to layout directory
+ --logLevel string log level (debug|info|warn|error)
+ --minify minify any supported output format (HTML, XML etc.)
+ --noBuildLock don't create .hugo_build.lock file
+ --noChmod don't sync permission mode of files
+ --noTimes don't sync modification time of files
+ --panicOnWarning panic on first WARNING log
+ --poll string set this to a poll interval, e.g --poll 700ms, to use a poll based approach to watch for file system changes
+ --printI18nWarnings print missing translations
+ --printMemoryUsage print memory usage to screen at intervals
+ --printPathWarnings print warnings on duplicate target paths etc.
+ --printUnusedTemplates print warnings on unused templates.
+ --quiet build in quiet mode
+ --renderSegments strings named segments to render (configured in the segments config)
+ -M, --renderToMemory render to memory (mostly useful when running the server)
+ -s, --source string filesystem path to read files relative from
+ --templateMetrics display metrics about template executions
+ --templateMetricsHints calculate some improvement hints when combined with --templateMetrics
+ -t, --theme strings themes to use (located in /themes/THEMENAME/)
+ --themesDir string filesystem path to themes directory
+ --trace file write trace to file (not useful in general)
+ -v, --verbose verbose output
+ -w, --watch watch filesystem for changes and recreate as needed
+```
+
+### SEE ALSO
+
+* [hugo](/commands/hugo/) - Build your site
+
### SEE ALSO
-* [hugo](/commands/hugo/) - hugo builds your site
+* [hugo](/commands/hugo/) - Build your site
* [hugo completion bash](/commands/hugo_completion_bash/) - Generate the autocompletion script for bash
* [hugo completion fish](/commands/hugo_completion_fish/) - Generate the autocompletion script for fish
* [hugo completion powershell](/commands/hugo_completion_powershell/) - Generate the autocompletion script for powershell
---
## hugo config
-Print the site configuration
+Display site configuration
### Synopsis
-Print the site configuration, both default and custom settings.
+Display site configuration, both default and custom settings.
```
hugo config [command] [flags]
### SEE ALSO
-* [hugo](/commands/hugo/) - hugo builds your site
+* [hugo](/commands/hugo/) - Build your site
* [hugo config mounts](/commands/hugo_config_mounts/) - Print the configured file mounts
### SEE ALSO
-* [hugo config](/commands/hugo_config/) - Print the site configuration
+* [hugo config](/commands/hugo_config/) - Display site configuration
---
## hugo convert
-Convert your content to different formats
+Convert front matter to another format
### Synopsis
-Convert your content (e.g. front matter) to different formats.
+Convert front matter to another format.
See convert's subcommands toJSON, toTOML and toYAML for more information.
### SEE ALSO
-* [hugo](/commands/hugo/) - hugo builds your site
+* [hugo](/commands/hugo/) - Build your site
* [hugo convert toJSON](/commands/hugo_convert_tojson/) - Convert front matter to JSON
* [hugo convert toTOML](/commands/hugo_convert_totoml/) - Convert front matter to TOML
* [hugo convert toYAML](/commands/hugo_convert_toyaml/) - Convert front matter to YAML
### SEE ALSO
-* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
+* [hugo convert](/commands/hugo_convert/) - Convert front matter to another format
### SEE ALSO
-* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
+* [hugo convert](/commands/hugo_convert/) - Convert front matter to another format
### SEE ALSO
-* [hugo convert](/commands/hugo_convert/) - Convert your content to different formats
+* [hugo convert](/commands/hugo_convert/) - Convert front matter to another format
---
## hugo deploy
-Deploy your site to a Cloud provider.
+Deploy your site to a cloud provider
### Synopsis
-Deploy your site to a Cloud provider.
+Deploy your site to a cloud provider
See https://gohugo.io/hosting-and-deployment/hugo-deploy/ for detailed
documentation.
### SEE ALSO
-* [hugo](/commands/hugo/) - hugo builds your site
+* [hugo](/commands/hugo/) - Build your site
---
## hugo env
-Print Hugo version and environment info
+Display version and environment info
### Synopsis
-Print Hugo version and environment info. This is useful in Hugo bug reports
+Display version and environment info. This is useful in Hugo bug reports
```
hugo env [flags] [args]
### SEE ALSO
-* [hugo](/commands/hugo/) - hugo builds your site
+* [hugo](/commands/hugo/) - Build your site
---
## hugo gen
-A collection of several useful generators.
+Generate documentation and syntax highlighting styles
+
+### Synopsis
+
+Generate documentation for your project using Hugo's documentation engine, including syntax highlighting for various programming languages.
### Options
### SEE ALSO
-* [hugo](/commands/hugo/) - hugo builds your site
+* [hugo](/commands/hugo/) - Build your site
* [hugo gen chromastyles](/commands/hugo_gen_chromastyles/) - Generate CSS stylesheet for the Chroma code highlighter
* [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
### SEE ALSO
-* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
+* [hugo gen](/commands/hugo_gen/) - Generate documentation and syntax highlighting styles
### SEE ALSO
-* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
+* [hugo gen](/commands/hugo_gen/) - Generate documentation and syntax highlighting styles
### SEE ALSO
-* [hugo gen](/commands/hugo_gen/) - A collection of several useful generators.
+* [hugo gen](/commands/hugo_gen/) - Generate documentation and syntax highlighting styles
---
## hugo import
-Import your site from others.
+Import a site from another system
### Synopsis
-Import your site from other web site generators like Jekyll.
+Import a site from another system.
Import requires a subcommand, e.g. `hugo import jekyll jekyll_root_path target_path`.
### SEE ALSO
-* [hugo](/commands/hugo/) - hugo builds your site
+* [hugo](/commands/hugo/) - Build your site
* [hugo import jekyll](/commands/hugo_import_jekyll/) - hugo import from Jekyll
### SEE ALSO
-* [hugo import](/commands/hugo_import/) - Import your site from others.
+* [hugo import](/commands/hugo_import/) - Import a site from another system
---
## hugo list
-Listing out various types of content
+List content
### Synopsis
-Listing out various types of content.
+List content.
List requires a subcommand, e.g. hugo list drafts
### SEE ALSO
-* [hugo](/commands/hugo/) - hugo builds your site
+* [hugo](/commands/hugo/) - Build your site
* [hugo list all](/commands/hugo_list_all/) - List all content
* [hugo list drafts](/commands/hugo_list_drafts/) - List draft content
* [hugo list expired](/commands/hugo_list_expired/) - List expired content
### SEE ALSO
-* [hugo list](/commands/hugo_list/) - Listing out various types of content
+* [hugo list](/commands/hugo_list/) - List content
### SEE ALSO
-* [hugo list](/commands/hugo_list/) - Listing out various types of content
+* [hugo list](/commands/hugo_list/) - List content
### SEE ALSO
-* [hugo list](/commands/hugo_list/) - Listing out various types of content
+* [hugo list](/commands/hugo_list/) - List content
### SEE ALSO
-* [hugo list](/commands/hugo_list/) - Listing out various types of content
+* [hugo list](/commands/hugo_list/) - List content
### SEE ALSO
-* [hugo list](/commands/hugo_list/) - Listing out various types of content
+* [hugo list](/commands/hugo_list/) - List content
---
## hugo mod
-Various Hugo Modules helpers.
+Manage modules
### Synopsis
### SEE ALSO
-* [hugo](/commands/hugo/) - hugo builds your site
+* [hugo](/commands/hugo/) - Build your site
* [hugo mod clean](/commands/hugo_mod_clean/) - Delete the Hugo Module cache for the current project.
* [hugo mod get](/commands/hugo_mod_get/) - Resolves dependencies in your current Hugo Project.
* [hugo mod graph](/commands/hugo_mod_graph/) - Print a module dependency graph.
### SEE ALSO
-* [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers.
+* [hugo mod](/commands/hugo_mod/) - Manage modules
### SEE ALSO
-* [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers.
+* [hugo mod](/commands/hugo_mod/) - Manage modules
### SEE ALSO
-* [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers.
+* [hugo mod](/commands/hugo_mod/) - Manage modules
### SEE ALSO
-* [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers.
+* [hugo mod](/commands/hugo_mod/) - Manage modules
### SEE ALSO
-* [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers.
+* [hugo mod](/commands/hugo_mod/) - Manage modules
* [hugo mod npm pack](/commands/hugo_mod_npm_pack/) - Experimental: Prepares and writes a composite package.json file for your project.
### SEE ALSO
-* [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers.
+* [hugo mod](/commands/hugo_mod/) - Manage modules
### SEE ALSO
-* [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers.
+* [hugo mod](/commands/hugo_mod/) - Manage modules
### SEE ALSO
-* [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers.
+* [hugo mod](/commands/hugo_mod/) - Manage modules
---
## hugo new
-Create new content for your site
+Create new content
### Synopsis
### SEE ALSO
-* [hugo](/commands/hugo/) - hugo builds your site
-* [hugo new content](/commands/hugo_new_content/) - Create new content for your site
+* [hugo](/commands/hugo/) - Build your site
+* [hugo new content](/commands/hugo_new_content/) - Create new content
* [hugo new site](/commands/hugo_new_site/) - Create a new site (skeleton)
* [hugo new theme](/commands/hugo_new_theme/) - Create a new theme (skeleton)
---
## hugo new content
-Create new content for your site
+Create new content
### Synopsis
### SEE ALSO
-* [hugo new](/commands/hugo_new/) - Create new content for your site
+* [hugo new](/commands/hugo_new/) - Create new content
### SEE ALSO
-* [hugo new](/commands/hugo_new/) - Create new content for your site
+* [hugo new](/commands/hugo_new/) - Create new content
### SEE ALSO
-* [hugo new](/commands/hugo_new/) - Create new content for your site
+* [hugo new](/commands/hugo_new/) - Create new content
---
## hugo server
-A high performance webserver
+Start the embedded web server
### Synopsis
### SEE ALSO
-* [hugo](/commands/hugo/) - hugo builds your site
+* [hugo](/commands/hugo/) - Build your site
* [hugo server trust](/commands/hugo_server_trust/) - Install the local CA in the system trust store.
### SEE ALSO
-* [hugo server](/commands/hugo_server/) - A high performance webserver
+* [hugo server](/commands/hugo_server/) - Start the embedded web server
---
## hugo version
-Print Hugo version and environment info
+Display version
### Synopsis
-Print Hugo version and environment info. This is useful in Hugo bug reports.
+Display version and environment info. This is useful in Hugo bug reports.
```
hugo version [flags] [args]
### SEE ALSO
-* [hugo](/commands/hugo/) - hugo builds your site
+* [hugo](/commands/hugo/) - Build your site
{{ .Site.Title }}
{{< /code >}}
+{{% note %}}
+Note that the `Site` returned isn't fully built when invoked from the content adapters; if you try to call methods that depends on pages, e.g. `.Site.Pages`, you will get an error saying "this method cannot be called before the site is fully initialized".
+{{% /note %}}
+
###### Store
Returns a persistent “scratch pad” to store and manipulate data. The main use case for this is to transfer values between executions when [EnableAllLanguages](#enablealllanguages) is set. See [examples](/methods/page/store/).
### Emacs Org Mode
-Create your content in the [Emacs Org Mode] format preceded by front matter. You can use Org Mode keywords for front matter. See [details](/content-management/front-matter/#emacs-org-mode)).
+Create your content in the [Emacs Org Mode] format preceded by front matter. You can use Org Mode keywords for front matter. See [details](/content-management/front-matter/#emacs-org-mode).
### AsciiDoc
author = 'John Smith'
{{< /code-toggle >}}
-Front matter fields may be [scalar], [arrays], or [maps] containing [boolean], [integer], [float], or [string] values. Note that the TOML format also supports date/time values using unquoted strings.
+Front matter fields may be [boolean], [integer], [float], [string], [arrays], or [maps]. Note that the TOML format also supports unquoted date/time values.
[scalar]: /getting-started/glossary/#scalar
[arrays]: /getting-started/glossary/#array
###### date
-(`string`) The date associated with the page, typically the creation date. Note that the TOML format also supports date/time values using unquoted strings. Access this value from a template using the [`Date`] method on a `Page` object.
+(`string`) The date associated with the page, typically the creation date. Note that the TOML format also supports unquoted date/time values. See the [dates](#dates) section for examples. Access this value from a template using the [`Date`] method on a `Page` object.
+
[`date`]: /methods/page/date/
###### expiryDate
-(`string`) The page expiration date. On or after the expiration date, the page will not be rendered unless you pass the `--buildExpired` flag to the `hugo` command. Note that the TOML format also supports date/time values using unquoted strings. Access this value from a template using the [`ExpiryDate`] method on a `Page` object.
+(`string`) The page expiration date. On or after the expiration date, the page will not be rendered unless you pass the `--buildExpired` flag to the `hugo` command. Note that the TOML format also supports unquoted date/time values. See the [dates](#dates) section for examples. Access this value from a template using the [`ExpiryDate`] method on a `Page` object.
[`expirydate`]: /methods/page/expirydate/
[`keywords`]: /methods/page/keywords/
[taxonomy]: /getting-started/glossary/#taxonomy
+{{% comment %}}
<!-- Added in v0.123.0 but purposefully omitted from documentation. -->
<!--
kind
lang
: The language code for this page. This is usually derived from the module mount or filename.
-->
+{{% /comment %}}
###### lastmod
-(`string`) The date that the page was last modified. Note that the TOML format also supports date/time values using unquoted strings. Access this value from a template using the [`Lastmod`] method on a `Page` object.
+(`string`) The date that the page was last modified. Note that the TOML format also supports unquoted date/time values. See the [dates](#dates) section for examples. Access this value from a template using the [`Lastmod`] method on a `Page` object.
[`lastmod`]: /methods/page/date/
###### menus
-(`string`,`string array`, or `map`) If set, Hugo adds the page to the given menu or menus. See the [menus] page for details.
+(`string`, `string array`, or `map`) If set, Hugo adds the page to the given menu or menus. See the [menus] page for details.
[menus]: /content-management/menus/#define-in-front-matter
+###### modified
+
+Alias to [lastmod](#lastmod).
+
###### outputs
(`string array`) The [output formats] to render.
[output formats]: /templates/output-formats/
+{{% comment %}}
<!-- Added in v0.123.0 but purposefully omitted from documentation. -->
<!--
path
: The canonical page path.
-->
+{{% /comment %}}
###### params
[page parameters]: #parameters
+###### pubdate
+
+Alias to [publishDate](#publishdate).
+
###### publishDate
-(`string`) The page publication date. Before the publication date, the page will not be rendered unless you pass the `--buildFuture` flag to the `hugo` command. Note that the TOML format also supports date/time values using unquoted strings. Access this value from a template using the [`PublishDate`] method on a `Page` object.
+(`string`) The page publication date. Before the publication date, the page will not be rendered unless you pass the `--buildFuture` flag to the `hugo` command. Note that the TOML format also supports unquoted date/time values. See the [dates](#dates) section for examples. Access this value from a template using the [`PublishDate`] method on a `Page` object.
[`publishdate`]: /methods/page/publishdate/
+###### published
+
+Alias to [publishDate](#publishdate).
+
###### resources
(`map array`) An array of maps to provide metadata for [page resources].
[content type]: /getting-started/glossary/#content-type
[`type`]: /methods/page/type/
+###### unpublishdate
+
+Alias to [expirydate](#expirydate).
+
###### url
(`string`) Overrides the entire URL path. Applicable to regular pages and section pages. See the [URL management] page for details.
[content format]: /content-management/formats/
[emacs org mode]: https://orgmode.org/
+
+## Dates
+
+When populating a date field, whether a [custom page parameter](#parameters) or one of the four predefined fields ([`date`](#date), [`expiryDate`](#expirydate), [`lastmod`](#lastmod), [`publishDate`](#publishdate)), use one of these parsable formats:
+
+{{% include "functions/time/_common/parsable-date-time-strings.md" %}}
+
+To override the default time zone, set the [`timeZone`](https://gohugo.io/getting-started/configuration/#timezone) in your site configuration. The order of precedence for determining the time zone is:
+
+1. The time zone offset in the date/time string
+2. The time zone specified in your site configuration
+3. The `Etc/UTC` time zone
### Colors
-{{< new-in 0.104.0 >}}
-
`.Colors` returns a slice of hex strings with the dominant colors in the image using a simple histogram method.
```go-html-template
{{< code-toggle file=content/products/software.md fm=true >}}
title = 'Software'
-[[menus.main]]
+[menus.main]
parent = 'Products'
weight = 20
pre = '<i class="fa-solid fa-code"></i>'
```go-html-template
{{ site.Title }}
-{{ site.LanguageCode }}
+{{ site.Language.LanguageCode }}
{{ site.Params.color }}
```
Use these embedded shortcodes as needed.
+### comment
+
+{{< new-in "0.137.1" >}}
+
+{{% note %}}
+To override Hugo's embedded `comment` shortcode, copy the [source code] to a file with the same name in the layouts/shortcodes directory.
+
+[source code]: {{% eturl comment %}}
+{{% /note %}}
+
+Use the `comment` shortcode to include comments in your Markdown. Hugo excludes the encapsulated text when rendering your site.
+
+Example usage:
+
+```text
+{{%/* comment */%}} TODO: rewrite the paragraph below. {{%/* /comment */%}}
+```
+
+Although you can call this shortcode using the `{{</* */>}}` notation, computationally it is more efficient to call it using the `{{%/* */%}}` notation as shown above.
+
### figure
{{% note %}}
toc: true
aliases: [/content/summaries/,/content-management/content-summaries/]
---
-
+{{% comment %}}
<!-- Do not remove the manual summary divider below. -->
<!-- If you do, you will break its first literal usage on this page. -->
+{{% /comment %}}
<!--more-->
-You can define a content summary manually, in front matter, or automatically. A manual content summary takes precedence over a front matter summary, and a front matter summary takes precedence over an automatic summary.
+You can define a summary manually, in front matter, or automatically. A manual summary takes precedence over a front matter summary, and a front matter summary takes precedence over an automatic summary.
Review the [comparison table](#comparison) below to understand the characteristics of each summary type.
## Manual summary
-Use a `<!--more-->` divider to indicate the end of the content summary. Hugo will not render the summary divider itself.
+Use a `<!--more-->` divider to indicate the end of the summary. Hugo will not render the summary divider itself.
-{{< code file=content/sample.md >}}
+{{< code file=content/example.md >}}
+++
title: 'Example'
date: 2024-05-26T09:10:33-07:00
+++
-Thénardier was not mistaken. The man was sitting there, and letting
-Cosette get somewhat rested.
+This is the first paragraph.
<!--more-->
-The inn-keeper walked round the brushwood and presented himself
-abruptly to the eyes of those whom he was in search of.
+This is the second paragraph.
{{< /code >}}
-When using the Emacs Org Mode [content format], use a `# more` divider to indicate the end of the content summary.
+When using the Emacs Org Mode [content format], use a `# more` divider to indicate the end of the summary.
[content format]: /content-management/formats/
Use front matter to define a summary independent of content.
-{{< code file=content/sample.md >}}
+{{< code file=content/example.md >}}
+++
title: 'Example'
date: 2024-05-26T09:10:33-07:00
-summary: 'Learn more about _Les Misérables_ by Victor Hugo.'
+summary: 'This summary is independent of the content.'
+++
-Thénardier was not mistaken. The man was sitting there, and letting
-Cosette get somewhat rested. The inn-keeper walked round the
-brushwood and presented himself abruptly to the eyes of those whom
-he was in search of.
+This is the first paragraph.
+
+This is the second paragraph.
{{< /code >}}
## Automatic summary
-If you have not defined the summary manually or in front matter, Hugo automatically defines the summary based on the [`summaryLength`] in your site configuration.
+If you do not define the summary manually or in front matter, Hugo automatically defines the summary based on the [`summaryLength`] in your site configuration.
[`summaryLength`]: /getting-started/configuration/#summarylength
-{{< code file=content/sample.md >}}
+{{< code file=content/example.md >}}
+++
title: 'Example'
date: 2024-05-26T09:10:33-07:00
+++
-Thénardier was not mistaken. The man was sitting there, and letting
-Cosette get somewhat rested. The inn-keeper walked round the
-brushwood and presented himself abruptly to the eyes of those whom
-he was in search of.
+This is the first paragraph.
+
+This is the second paragraph.
+
+This is the third paragraph.
{{< /code >}}
-For example, with a `summaryLength` of 10, the automatic summary will be:
+For example, with a `summaryLength` of 7, the automatic summary will be:
-```text
-Thénardier was not mistaken. The man was sitting there, and letting
-Cosette get somewhat rested.
+```html
+<p>This is the first paragraph.</p>
+<p>This is the second paragraph.</p>
```
-Note that the `summaryLength` is an approximate number of words.
-
## Comparison
Each summary type has different characteristics:
</div>
{{ end }}
```
+
+## Alternative
+
+Instead of calling the `Summary` method on a `Page` object, use the [`strings.Truncate`] function for granular control of the summary length. For example:
+
+[`strings.Truncate`]: /functions/strings/truncate/
+
+```go-html-template
+{{ range site.RegularPages }}
+ <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
+ <div class="summary">
+ {{ .Content | strings.Truncate 42 }}
+ </div>
+{{ end }}
+```
Set the `url` in front matter to override the entire path. Use this with either regular pages or section pages.
+{{% note %}}
+Hugo does not sanitize the `url` front matter field, allowing you to generate:
+
+- File paths that contain characters reserved by the operating system. For example, file paths on Windows may not contain any of these [reserved characters]. Hugo throws an error if a file path includes a character reserved by the current operating system.
+- URLs that contain disallowed characters. For example, the less than sign (`<`) is not allowed in a URL.
+
+[reserved characters]: https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions
+{{% /note %}}
+
+If you set both `slug` and `url` in front matter, the `url` value takes precedence.
+
+#### Include a colon
+
+{{< new-in 0.136.0 >}}
+
+If you need to include a colon in the `url` front matter field, escape it with backslash characters. Use one backslash if you wrap the string within single quotes, or use two backslashes if you wrap the string within double quotes. With YAML front matter, use a single backslash if you omit quotation marks.
+
+For example, with this front matter:
+
+{{< code-toggle file=content/example.md fm=true >}}
+title: Example
+url: "my\\:example"
+{{< /code-toggle >}}
+
+The resulting URL will be:
+
+```text
+https://example.org/my:example/
+```
+
+As described above, this will fail on Windows because the colon (`:`) is a reserved character.
+
+#### File extensions
+
With this front matter:
{{< code-toggle file=content/posts/post-1.md fm=true >}}
title = 'My First Article'
-url = '/articles/my-first-article'
+url = 'articles/my-first-article'
{{< /code-toggle >}}
The resulting URL will be:
{{< code-toggle file=content/posts/post-1.md fm=true >}}
title = 'My First Article'
-url = '/articles/my-first-article.html'
+url = 'articles/my-first-article.html'
{{< /code-toggle >}}
The resulting URL will be:
https://example.org/articles/my-first-article.html
```
-In a monolingual site, a `url` value with or without a leading slash is relative to the `baseURL`.
+#### Leading slashes
-In a multilingual site:
+With monolingual sites, `url` values with or without a leading slash are relative to the [`baseURL`]. With multilingual sites, `url` values with a leading slash are relative to the `baseURL`, and `url` values without a leading slash are relative to the `baseURL` plus the language prefix.
-- A `url` value with a leading slash is relative to the `baseURL`.
-- A `url` value without a leading slash is relative to the `baseURL` plus the language prefix.
+[`baseURL`]: /getting-started/configuration/#baseurl
Site type|Front matter `url`|Resulting URL
:--|:--|:--
multilingual|`/about`|`https://example.org/about/`
multilingual|`about`|`https://example.org/de/about/`
-If you set both `slug` and `url` in front matter, the `url` value takes precedence.
-
#### Permalinks tokens in front matter
{{< new-in "0.131.0" >}}
-You can also use [Permalinks tokens](#tokens) in the `url` front matter. This is typically used in `cascade` sections:
+You can also use [tokens](#tokens) when setting the `url` value. This is typically used in `cascade` sections:
{{< code-toggle file=content/foo/bar/_index.md fm=true >}}
title ="Bar"
#### Tokens
-Use these tokens when defining the URL pattern. These can both be used in the `permalinks` configuration and in the front matter [url](#permalinks-tokens-in-front-matter).
-
-`:filename`
+Use these tokens when defining the URL pattern. You can also use these tokens when setting the [`url`](#permalinks-tokens-in-front-matter) value in front matter.
`:year`
: The 4-digit year as defined in the front matter `date` field.
uglyURLs = true
{{< /code-toggle >}}
+You can also enable uglyURLs by section. For example, with a site that contains sections for books and films:
+
+{{< code-toggle file=hugo >}}
+[uglyURLs]
+books = true
+films = false
+{{< /code-toggle >}}
+
### Post-processing
Hugo provides two mutually exclusive configuration options to alter URLs _after_ it renders a page.
## Prerequisites
-To build the extended edition of Hugo from source you must:
+To build the extended or extended/deploy edition from source you must:
1. Install [Git]
1. Install [Go] version 1.23.0 or later
: Make changes.
Step 5
-: Compile and install:
+: Compile and install.
+
+To compile and install the standard edition:
+
+```text
+go install
+```
+
+To compile and install the extended edition:
```text
CGO_ENABLED=1 go install -tags extended
```
+To compile and install the extended/deploy edition:
+
+```text
+CGO_ENABLED=1 go install -tags extended,withdeploy
+```
+
Step 6
: Test your changes:
To build and install a specific release:
```sh
-CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@v0.128.0
+CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@v0.137.1
```
To build and install at the latest commit on the master branch:
"It's an adverb, Sam. It's a lazy tool of a weak mind." (Outbreak, 1995).
{{% /note %}}
+#### Level 6 headings
+
+Level 6 headings are styled as `dt` elements. This was implemented to support a [glossary] with linkable terms.
+
+[glossary]: /getting-started/glossary/
+
+#### Function and method descriptions
+
+When adding a page to the [functions] or [methods] section, begin the description with the word "Returns". With functions and methods that return a boolean value, begin the description with the phrase "Reports whether".
+
+For example:
+
+- `Returns the URL aliases as defined in front matter.`
+- `Reports whether the given page is in the given section.`
+
+[functions]: /functions
+[methods]: /methods
+
#### Miscellaneous
Other guidelines to consider:
- When including code samples, use short snippets that demonstrate the concept.
- The Hugo user community is global; use [basic english](https://simple.wikipedia.org/wiki/Basic_English) when possible.
-#### Level 6 headings
-
-Level 6 headings are styled as `dt` elements. This was implemented to support a [glossary] with linkable terms.
-
-[glossary]: /getting-started/glossary/
-
## Code examples
Indent code by two spaces. With examples of template code, include a space after opening action delimiters, and include a space before closing action delimiters.
aliases: [/functions/cond]
---
-The CONTROL argument is a boolean value that indicates whether the function should return ARG1 or ARG2. If CONTROL is `true`, the function returns ARG1. Otherwise, the function returns ARG2.
+If CONTROL is truthy the function returns ARG1, otherwise it returns ARG2.
```go-html-template
{{ $qty := 42 }}
{{ cond (le $qty 3) "few" "many" }} → many
```
-The CONTROL argument must be either `true` or `false`. To cast a non-boolean value to boolean, pass it through the `not` operator twice.
-
-```go-html-template
-{{ cond (42 | not | not) "truthy" "falsy" }} → truthy
-{{ cond ("" | not | not) "truthy" "falsy" }} → falsy
-```
-
-{{% note %}}
-Unlike [ternary operators] in other languages, the `cond` function does not perform [short-circuit evaluation]. The function evaluates both ARG1 and ARG2, regardless of the CONTROL value.
+Unlike [ternary operators] in other languages, the `compare.Conditional` function does not perform [short-circuit evaluation]. It evaluates both ARG1 and ARG2 regardless of the CONTROL value.
[short-circuit evaluation]: https://en.wikipedia.org/wiki/Short-circuit_evaluation
[ternary operators]: https://en.wikipedia.org/wiki/Ternary_conditional_operator
-{{% /note %}}
Due to the absence of short-circuit evaluation, these examples throw an error:
{{ end }}
```
-Transpile Sass to CSS using the LibSass transpiler included in Hugo's extended edition, or [install Dart Sass](#dart-sass) to use the latest features of the Sass language.
+Transpile Sass to CSS using the LibSass transpiler included in Hugo's extended and extended/deploy editions, or [install Dart Sass](#dart-sass) to use the latest features of the Sass language.
Sass has two forms of syntax: [SCSS] and [indented]. Hugo supports both.
## Options
transpiler
-: (`string`) The transpiler to use, either `libsass` (default) or `dartsass`. Hugo's extended edition includes the LibSass transpiler. To use the Dart Sass transpiler, see the [installation instructions](#dart-sass) below.
+: (`string`) The transpiler to use, either `libsass` (default) or `dartsass`. Hugo's extended and extended/deploy editions include the LibSass transpiler. To use the Dart Sass transpiler, see the [installation instructions](#dart-sass) below.
targetPath
: (`string`) If not set, the transformed resource's target path will be the original path of the asset file with its extension replaced by `.css`.
```yaml
variables:
- HUGO_VERSION: 0.128.0
- DART_SASS_VERSION: 1.77.5
+ HUGO_VERSION: 0.137.1
+ DART_SASS_VERSION: 1.80.6
GIT_DEPTH: 0
GIT_STRATEGY: clone
GIT_SUBMODULE_STRATEGY: recursive
```toml
[build.environment]
-HUGO_VERSION = "0.128.0"
-DART_SASS_VERSION = "1.77.5"
+HUGO_VERSION = "0.137.1"
+DART_SASS_VERSION = "1.80.6"
TZ = "America/Los_Angeles"
[build]
{{< new-in 0.128.0 >}}
-<!-- TODO remove this admonition when feature is stable. -->
+{{% todo %}}remove this admonition when feature is stable.{{% /todo %}}
{{% note %}}
This is an experimental feature pending the release of TailwindCSS v4.0.
[Tailwind CSS documentation]: https://tailwindcss.com/docs/installation
{{% note %}}
-Use npm to install the CLI prior to the v4.0 release of Tailwind CSS.
+Prior to the release of Tailwind CSS v4.0 you must install [v4.0.0-alpha.26](https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0-alpha.26) or later.
`npm install --save-dev tailwindcss@next @tailwindcss/cli@next`
+
{{% /note %}}
## Options
Define a [cache buster] in your site configuration:
-[cache buster]: /getting-started/configuration/#configure-cache-busters
+[cache buster]: /getting-started/configuration-build/#configure-cache-busters
{{< code-toggle file=hugo >}}
[[build.cachebusters]]
---
```go-html-template
-{{ hugo.Generator }} → <meta name="generator" content="Hugo 0.128.0">
+{{ hugo.Generator }} → <meta name="generator" content="Hugo 0.137.1">
```
---
```go-html-template
-{{ hugo.Version }} → 0.128.0
+{{ hugo.Version }} → 0.137.1
```
---
{{% deprecated-in 0.128.0 %}}
-Use [js.Babel] instead.
+Use [`js.Babel`] instead.
-[js.Babel]: /functions/js/babel/
+[`js.Babel`]: /functions/js/babel/
{{% /deprecated-in %}}
```go-html-template
```json
{
"build_date": "2024-02-19T12:27:05-08:00",
- "hugo_version": "0.128.0",
+ "hugo_version": "0.137.1",
"last_modified": "2024-02-19T12:01:42-08:00"
}
```
[`Err`]: /methods/resource/err/
+{{% note %}}
+Hugo does not classify an HTTP response with status code 404 as an error. In this case the function returns nil.
+{{% /note %}}
+
```go-html-template
{{ $url := "https://broken-example.org/images/a.jpg" }}
{{ with resources.GetRemote $url }}
---
{{% deprecated-in 0.128.0 %}}
-Use [css.PostCSS] instead.
+Use [`css.PostCSS`] instead.
-[css.PostCSS]: /functions/css/postcss/
+[`css.PostCSS`]: /functions/css/postcss/
{{% /deprecated-in %}}
```go-html-template
---
{{% deprecated-in 0.128.0 %}}
-Use [css.Sass] instead.
+Use [`css.Sass`] instead.
-[css.Sass]: /functions/css/sass/
+[`css.Sass`]: /functions/css/sass/
{{% /deprecated-in %}}
```go-html-template
{{ end }}
```
-Transpile Sass to CSS using the LibSass transpiler included in Hugo's extended edition, or [install Dart Sass](#dart-sass) to use the latest features of the Sass language.
+Transpile Sass to CSS using the LibSass transpiler included in Hugo's extended and extended/deploy editions, or [install Dart Sass](#dart-sass) to use the latest features of the Sass language.
Sass has two forms of syntax: [SCSS] and [indented]. Hugo supports both.
## Options
transpiler
-: (`string`) The transpiler to use, either `libsass` (default) or `dartsass`. Hugo's extended edition includes the LibSass transpiler. To use the Dart Sass transpiler, see the [installation instructions](#dart-sass) below.
+: (`string`) The transpiler to use, either `libsass` (default) or `dartsass`. Hugo's extended and extended/deploy editions include the LibSass transpiler. To use the Dart Sass transpiler, see the [installation instructions](#dart-sass) below.
targetPath
: (`string`) If not set, the transformed resource's target path will be the original path of the asset file with its extension replaced by `.css`.
```yaml
variables:
- HUGO_VERSION: 0.128.0
- DART_SASS_VERSION: 1.77.5
+ HUGO_VERSION: 0.137.1
+ DART_SASS_VERSION: 1.80.6
GIT_DEPTH: 0
GIT_STRATEGY: clone
GIT_SUBMODULE_STRATEGY: recursive
```toml
[build.environment]
-HUGO_VERSION = "0.128.0"
-DART_SASS_VERSION = "1.77.5"
+HUGO_VERSION = "0.137.1"
+DART_SASS_VERSION = "1.80.6"
TZ = "America/Los_Angeles"
[build]
aliases: [chomp]
related:
- functions/strings/Trim
+ - functions/strings/TrimSpace
- functions/strings/TrimLeft
- functions/strings/TrimPrefix
- functions/strings/TrimRight
If the argument is of type `template.HTML`, returns `template.HTML`, else returns a `string`.
```go-html-template
-{{ chomp | "foo\n" }} → foo
-{{ chomp | "foo\n\n" }} → foo
+{{ chomp "foo\n" }} → foo
+{{ chomp "foo\n\n" }} → foo
-{{ chomp | "foo\r\n" }} → foo
-{{ chomp | "foo\r\n\r\n" }} → foo
+{{ chomp "foo\r\n" }} → foo
+{{ chomp "foo\r\n\r\n" }} → foo
```
---
title: strings.ContainsNonSpace
-description: Reports whether the given string contains any non-space characters as defined by Unicode's White Space property.
+description: Reports whether the given string contains any non-space characters as defined by Unicode.
categories: []
keywords: []
action:
{{< new-in 0.111.0 >}}
+Whitespace characters include `\t`, `\n`, `\v`, `\f`, `\r`, and characters in the [Unicode Space Separator] category.
+
+[Unicode Space Separator]: https://www.compart.com/en/unicode/category/Zs
+
```go-html-template
{{ strings.ContainsNonSpace "\n" }} → false
{{ strings.ContainsNonSpace " " }} → false
{{ strings.ContainsNonSpace "\n abc" }} → true
```
-
-Common whitespace characters include:
-
-```text
-'\t', '\n', '\v', '\f', '\r', ' '
-```
-
-See the [Unicode Character Database] for a complete list.
-
-[Unicode Character Database]: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt
aliases: [trim]
related:
- functions/strings/Chomp
+ - functions/strings/TrimSpace
- functions/strings/TrimLeft
- functions/strings/TrimPrefix
- functions/strings/TrimRight
```go-html-template
{{ trim "++foo--" "+-" }} → foo
```
-
-To remove leading and trailing newline characters and carriage returns:
-
-```go-html-template
-{{ trim "\nfoo\n" "\n\r" }} → foo
-{{ trim "\n\nfoo\n\n" "\n\r" }} → foo
-
-{{ trim "\r\nfoo\r\n" "\n\r" }} → foo
-{{ trim "\r\n\r\nfoo\r\n\r\n" "\n\r" }} → foo
-```
-
-The `strings.Trim` function is commonly used in shortcodes to remove leading and trailing newlines characters and carriage returns from the content within the opening and closing shortcode tags.
-
-For example, with this Markdown:
-
-```text
-{{</* my-shortcode */>}}
-Able was I ere I saw Elba.
-{{</* /my-shortcode */>}}
-```
-
-The value of `.Inner` in the shortcode template is:
-
-```text
-\nAble was I ere I saw Elba.\n
-```
-
-If authored on a Windows system the value of `.Inner` might, depending on the editor configuration, be:
-
-```text
-\r\nAble was I ere I saw Elba.\r\n
-```
-
-This construct is common in shortcode templates:
-
-```go-html-template
-{{ trim .Inner "\n\r" }}
-```
related:
- functions/strings/Chomp
- functions/strings/Trim
+ - functions/strings/TrimSpace
- functions/strings/TrimPrefix
- functions/strings/TrimRight
- functions/strings/TrimSuffix
related:
- functions/strings/Chomp
- functions/strings/Trim
+ - functions/strings/TrimSpace
- functions/strings/TrimLeft
- functions/strings/TrimRight
- functions/strings/TrimSuffix
related:
- functions/strings/Chomp
- functions/strings/Trim
+ - functions/strings/TrimSpace
- functions/strings/TrimLeft
- functions/strings/TrimPrefix
- functions/strings/TrimSuffix
--- /dev/null
+---
+title: strings.TrimSpace
+description: Returns the given string, removing leading and trailing whitespace as defined by Unicode.
+categories: []
+keywords: []
+action:
+ related:
+ - functions/strings/Chomp
+ - functions/strings/Trim
+ - functions/strings/TrimLeft
+ - functions/strings/TrimPrefix
+ - functions/strings/TrimRight
+ - functions/strings/TrimSuffix
+ returnType: string
+ signatures: [strings.TrimSpace INPUT]
+---
+
+{{< new-in 0.136.3 >}}
+
+Whitespace characters include `\t`, `\n`, `\v`, `\f`, `\r`, and characters in the [Unicode Space Separator] category.
+
+[Unicode Space Separator]: https://www.compart.com/en/unicode/category/Zs
+
+```go-html-template
+{{ strings.TrimSpace "\n\r\t foo \n\r\t" }} → foo
+```
related:
- functions/strings/Chomp
- functions/strings/Trim
+ - functions/strings/TrimSpace
- functions/strings/TrimLeft
- functions/strings/TrimPrefix
- functions/strings/TrimRight
Hugo provides [functions] and [methods] to format, localize, parse, compare, and manipulate date/time values. Before you can do any of these with string representations of date/time values, you must first convert them to [`time.Time`] values using the `time.AsTime` function.
```go-html-template
-{{ $t := "2023-10-15T14:20:28-07:00" }}
-{{ time.AsTime $t }} → 2023-10-15 14:20:28 -0700 PDT (time.Time)
+{{ $t := "2023-10-15T13:18:50-07:00" }}
+{{ time.AsTime $t }} → 2023-10-15 13:18:50 -0700 PDT (time.Time)
```
## Parsable strings
-As shown above, the first argument must be a *parsable* string representation of a date/time value. For example:
+As shown above, the first argument must be a parsable string representation of a date/time value. For example:
{{% include "functions/time/_common/parsable-date-time-strings.md" %}}
-## Time zones
+To override the default time zone, set the [`timeZone`] in your site configuration or provide a second argument to the `time.AsTime` function. For example:
-When the parsable string does not contain a time zone offset, you can do either of the following to assign a time zone other than Etc/UTC:
-
-- Provide a second argument to the `time.AsTime` function
-
- ```go-html-template
- {{ time.AsTime "15 Oct 2023" "America/Chicago" }}
- ```
-
-- Set the default time zone in your site configuration
+```go-html-template
+{{ time.AsTime "15 Oct 2023" "America/Los_Angeles" }}
+```
- {{< code-toggle file=hugo >}}
- timeZone = 'America/New_York'
- {{< /code-toggle >}}
+The list of valid time zones may be system dependent, but should include `UTC`, `Local`, or any location in the [IANA Time Zone database].
The order of precedence for determining the time zone is:
1. The time zone offset in the date/time string
-2. The time zone provide as the second argument to the `time.AsTime` function
+2. The time zone provided as the second argument to the `time.AsTime` function
3. The time zone specified in your site configuration
+4. The `Etc/UTC` time zone
-The list of valid time zones may be system dependent, but should include `UTC`, `Local`, or any location in the [IANA Time Zone database].
+[IANA Time Zone database]: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
[`time.Time`]: https://pkg.go.dev/time#Time
+[`timeZone`]: https://gohugo.io/getting-started/configuration/#timezone
[functions]: /functions/time/
-[iana time zone database]: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
[methods]: /methods/time/
Use the `time.Format` function with `time.Time` values:
```go-html-template
-{{ $t := time.AsTime "2023-02-27T23:44:58-08:00" }}
-{{ time.Format "2 Jan 2006" $t }} → 27 Feb 2023
+{{ $t := time.AsTime "2023-10-15T13:18:50-07:00" }}
+{{ time.Format "2 Jan 2006" $t }} → 15 Oct 2023
```
-Or use `time.Format` with a *parsable* string representation of a date/time value:
+Or use `time.Format` with a parsable string representation of a date/time value:
```go-html-template
-{{ $t := "27 Feb 2023" }}
-{{ time.Format "January 2, 2006" $t }} → February 27, 2023
+{{ $t := "15 Oct 2023" }}
+{{ time.Format "January 2, 2006" $t }} → October 15, 2023
```
Examples of parsable string representations:
{{% include "functions/time/_common/parsable-date-time-strings.md" %}}
+To override the default time zone, set the [`timeZone`] in your site configuration. The order of precedence for determining the time zone is:
+
+1. The time zone offset in the date/time string
+2. The time zone specified in your site configuration
+3. The `Etc/UTC` time zone
+
+[`timeZone`]: https://gohugo.io/getting-started/configuration/#timezone
+
## Layout string
{{% include "functions/_common/time-layout-string.md" %}}
# Do not remove front matter.
---
-String representation|Time zone
+Format|Time zone
:--|:--
-2023-10-15T14:20:28-07:00|America/Los_Angeles
-2023-10-15T13:18:50-0700|America/Los_Angeles
-2023-10-15T13:18:50Z|Etc/UTC
-2023-10-15T13:18:50|Etc/UTC
-2023-10-15|Etc/UTC
-15 Oct 2023|Etc/UTC
+`2023-10-15T13:18:50-07:00`|`America/Los_Angeles`
+`2023-10-15T13:18:50-0700`|`America/Los_Angeles`
+`2023-10-15T13:18:50Z`|`Etc/UTC`
+`2023-10-15T13:18:50`|Default is `Etc/UTC`
+`2023-10-15`|Default is `Etc/UTC`
+`15 Oct 2023`|Default is `Etc/UTC`
-The last four examples are not fully qualified. Without a time zone offset, the time zone is set to Etc/UTC (Coordinated Universal Time).
+The last three examples are not fully qualified, and default to the `Etc/UTC` time zone.
title: transform.ToMath
description: Renders a math expression using KaTeX.
categories: []
-keywords: []
+keywords: [math,katex]
action:
aliases: []
related:
output
: (`string`). Determines the markup language of the output. One of `html`, `mathml`, or `htmlAndMathml`. Default is `mathml`.
- <!-- Indent to prevent spliting the description list. -->
+ {{% comment %}}Indent to prevent splitting the description list.{{% / comment %}}
With `html` and `htmlAndMathml` you must include KaTeX CSS within the `head` element of your base template. For example:
1. Let KaTeX throw an error and make the build fail. This is the default behavior.
1. Handle the error in your template. See the render hook example below.
-1. Set the `throwOnError` option to `false` to make KaTeX render the expression as an error instead of throwing an error. See [options].
+1. Set the `throwOnError` option to `false` to make KaTeX render the expression as an error instead of throwing an error. See [options](#options).
{{< code file=layouts/_default/_markup/render-passthrough-inline.html copy=true >}}
{{ with transform.ToMath .Inner }}
--- /dev/null
+---
+title: Configure build
+description: Configure global build options.
+categories: [getting started,fundamentals]
+keywords: [build,buildStats,cache]
+menu:
+ docs:
+ parent: getting-started
+ weight: 60
+weight: 60
+slug: configuration-build
+toc: true
+---
+
+The `build` configuration section contains global build-related configuration options.
+
+{{< code-toggle config=build />}}
+
+#### buildStats
+
+See [Configure buildStats](#configure-build-stats).
+
+#### cachebusters
+
+See [Configure Cache Busters](#configure-cache-busters).
+
+#### noJSConfigInAssets
+
+(`bool`) If `true`, turns off writing a `jsconfig.json` into your `/assets` folder with mapping of imports from running [js.Build](/hugo-pipes/js). This file is intended to help with intellisense/navigation inside code editors such as [VS Code](https://code.visualstudio.com/). Note that if you do not use `js.Build`, no file will be written.
+
+#### useResourceCacheWhen
+
+(`string`) When to use the cached resources in `/resources/_gen` for PostCSS and ToCSS. Valid values are `never`, `always` and `fallback`. The last value means that the cache will be tried if PostCSS/extended version is not available.
+
+
+## Configure cache busters
+
+{{< new-in 0.112.0 >}}
+
+The `build.cachebusters` configuration option was added to support development using Tailwind 3.x's JIT compiler where a `build` configuration may look like this:
+
+{{< code-toggle file=hugo >}}
+[build]
+ [build.buildStats]
+ enable = true
+ [[build.cachebusters]]
+ source = "assets/watching/hugo_stats\\.json"
+ target = "styles\\.css"
+ [[build.cachebusters]]
+ source = "(postcss|tailwind)\\.config\\.js"
+ target = "css"
+ [[build.cachebusters]]
+ source = "assets/.*\\.(js|ts|jsx|tsx)"
+ target = "js"
+ [[build.cachebusters]]
+ source = "assets/.*\\.(.*)$"
+ target = "$1"
+{{< /code-toggle >}}
+
+When `buildStats` {{< new-in 0.115.1 >}} is enabled, Hugo writes a `hugo_stats.json` file on each build with HTML classes etc. that's used in the rendered output. Changes to this file will trigger a rebuild of the `styles.css` file. You also need to add `hugo_stats.json` to Hugo's server watcher. See [Hugo Starter Tailwind Basic](https://github.com/bep/hugo-starter-tailwind-basic) for a running example.
+
+source
+: A regexp matching file(s) relative to one of the virtual component directories in Hugo, typically `assets/...`.
+
+target
+: A regexp matching the keys in the resource cache that should be expired when `source` changes. You can use the matching regexp groups from `source` in the expression, e.g. `$1`.
+
+## Configure build stats
+
+{{< code-toggle config=build.buildStats />}}
+
+{{< new-in 0.115.1 >}}
+
+If `enable` is set to `true`, creates a `hugo_stats.json` file in the root of your project. This file contains arrays of the `class` attributes, `id` attributes, and tags of every HTML element within your published site. Use this file as data source when [removing unused CSS] from your site. This process is also known as pruning, purging, or tree shaking.
+
+[removing unused CSS]: /hugo-pipes/postprocess/#css-purging-with-postcss
+
+Exclude `class` attributes, `id` attributes, or tags from `hugo_stats.json` with the `disableClasses`, `disableIDs`, and `disableTags` keys.
+
+{{% note %}}
+Given that CSS purging is typically limited to production builds, place the `buildStats` object below [config/production].
+
+[config/production]: /getting-started/configuration/#configuration-directory
+
+Built for speed, there may be "false positive" detections (e.g., HTML elements that are not HTML elements) while parsing the published site. These "false positives" are infrequent and inconsequential.
+{{% /note %}}
+
+Due to the nature of partial server builds, new HTML entities are added while the server is running, but old values will not be removed until you restart the server or run a regular `hugo` build.
\ No newline at end of file
###### attributes
-(`map`) A map of key-value pairs, each a document attributes. See Asciidoctor’s [attributes].
+(`map`) A map of key-value pairs, each a document attribute. See Asciidoctor’s [attributes].
[attributes]: https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#attributes-and-substitutions
See [Configure File Caches](#configure-file-caches).
+###### canonifyURLs
+
+(`bool`) See [details](/content-management/urls/#canonical-urls) before enabling this feature. Default is `false`.
+
###### capitalizeListTitles
{{< new-in 0.123.3 >}}
To remain consistent and prevent unexpected behavior, do not mix these strategies.
{{% /note %}}
-###### canonifyURLs
-
-(`bool`) See [details](/content-management/urls/#canonical-urls) before enabling this feature. Default is `false`.
-
###### cleanDestinationDir
(`bool`) When building, removes files from destination not found in static directories. Default is `false`.
[kinds]: /getting-started/glossary/#page-kind
+###### disableLanguages
+
+See [disable a language](/content-management/multilingual/#disable-a-language).
+
###### disableLiveReload
(`bool`) Disable automatic live reloading of browser window. Default is `false`.
(`bool`) Enable generation of `robots.txt` file. Default is `false`.
+###### environment
+
+(`string`) Build environment. Default is `production` when running `hugo` and `development` when running `hugo server`. See [Configuration directory](https://gohugo.io/getting-started/configuration/#configuration-directory).
###### frontmatter
See [Front matter Configuration](#configure-front-matter).
(`bool`) If true, auto-detect Chinese/Japanese/Korean Languages in the content. This will make `.Summary` and `.WordCount` behave correctly for CJK languages. Default is `false`.
+###### ignoreCache
+
+(`bool`) Ignore the cache directory. Default is `false`.
+
+###### ignoreLogs
+(`string slice`) A slice of message identifiers corresponding to warnings and errors you wish to suppress. See [`erroridf`] and [`warnidf`].
+
+[`erroridf`]: /functions/fmt/erroridf/
+[`warnidf`]: /functions/fmt/warnidf/
+
+###### ignoreVendorPaths
+
+(`string`) Ignore vendored modules that match the given [Glob] pattern within the `_vendor` directory.
+
+[Glob]: https://github.com/gobwas/glob?tab=readme-ov-file#example]
+
###### imaging
See [image processing configuration](/content-management/image-processing/#imaging-configuration).
See [Configure Languages](/content-management/multilingual/#configure-languages).
-###### disableLanguages
+###### layoutDir
-See [Disable a Language](/content-management/multilingual/#disable-a-language)
+(`string`) The directory that contains templates. Default is `layouts`.
###### markup
(`string`) The editor to use when creating new content.
+###### noBuildLock
+
+(`bool`) Don't create `.hugo_build.lock` file. Default is `false`.
+
###### noChmod
(`bool`) Don't sync permission mode of files. Default is `false`.
See [configure pagination](/templates/pagination/#configuration).
+###### panicOnWarning
+
+(`bool`) Whether to panic on first WARNING. Default is `false`.
+
###### permalinks
See [Content Management](/content-management/urls/#permalinks).
(`bool`) Whether to pluralize automatic list titles. Applicable to section pages. Default is `true`.
+###### printI18nWarnings
+
+(`bool`) Whether to log WARNINGs for each missing translation. Default is `false`.
+
+###### printPathWarnings
+
+(`bool`) Whether to log WARNINGs when Hugo publishes two or more files to the same path. Default is `false`.
+
+###### printUnusedTemplates
+
+(`bool`) Whether to log WARNINGs for each unused template. Default is `false`.
+
###### publishDir
(`string`) The directory to where Hugo will write the final static site (the HTML files etc.). Default is `public`.
(`bool`) See [details](/content-management/urls/#relative-urls) before enabling this feature. Default is `false`.
-###### renderSegments
-
-{{< new-in 0.124.0 >}}
-
-(`string slice`) A list of segments to render. If not set, everything will be rendered. This is more commonly set in a CLI flag, e.g. `hugo --renderSegments segment1,segment2`. The segment names must match the names in the [segments](#configure-segments) configuration.
-
###### removePathAccents
(`bool`) Removes [non-spacing marks](https://www.compart.com/en/unicode/category/Mn) from [composite characters](https://en.wikipedia.org/wiki/Precomposed_character) in content paths. Default is `false`.
content/post/hügó.md → https://example.org/post/hugo/
```
+###### renderSegments
+
+{{< new-in 0.124.0 >}}
+
+(`string slice`) A list of segments to render. If not set, everything will be rendered. This is more commonly set in a CLI flag, e.g. `hugo --renderSegments segment1,segment2`. The segment names must match the names in the [segments](#configure-segments) configuration.
+
###### sectionPagesMenu
See [Menus](/content-management/menus/#define-automatically).
###### summaryLength
-(`int`) Applicable to automatic summaries, the approximate number of words to render when calling the [`Summary`] method on a `Page` object. Default is `70`.
+(`int`) Applicable to [automatic summaries], the minimum number of words to render when calling the [`Summary`] method on a `Page` object. In this case the `Summary` method returns the content, truncated to the paragraph closest to the `summaryLength`.
+[automatic summaries]: /content-management/summaries/#automatic-summary
[`Summary`]: /methods/page/summary/
###### taxonomies
See [Configure Taxonomies](/content-management/taxonomies#configure-taxonomies).
+###### templateMetrics
+
+(`bool`) Whether to print template execution metrics to the console. Default is `false`. See [Template metrics](/troubleshooting/performance/#template-metrics).
+
+###### templateMetricsHints
+
+(`bool`) Whether to print template execution improvement hints to the console. Applicable when `templateMetrics` is `true`. Default is `false`. See [Template metrics](/troubleshooting/performance/#template-metrics).
+
###### theme
See [module configuration](/hugo-modules/configuration/#module-configuration-imports) for how to import a theme.
###### timeZone
-(`string`) The time zone (or location), e.g. `Europe/Oslo`, used to parse front matter dates without such information and in the [`time`] function. The list of valid values may be system dependent, but should include `UTC`, `Local`, and any location in the [IANA Time Zone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
+(`string`) The time zone used to parse dates without time zone offsets, including front matter date fields and values passed to the [`time.AsTime`] and [`time.Format`] template functions. The list of valid values may be system dependent, but should include `UTC`, `Local`, and any location in the [IANA Time Zone Database]. For example, `America/Los_Angeles` and `Europe/Oslo` are valid time zones.
+
+[`time.AsTime`]: /functions/time/astime/
+[`time.Format`]: /functions/time/format/
+[IANA Time Zone Database]: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
###### title
###### uglyURLs
-(`bool`) When enabled, creates URL of the form `/filename.html` instead of `/filename/`. Default is `false`.
+(`bool` or `map`) Whether to generate uglyURLs. Default is `false`. See [details](/content-management/urls/#appearance).
###### watch
## Configure build
-The `build` configuration section contains global build-related configuration options.
-
-{{< code-toggle config=build />}}
-
-buildStats {{< new-in 0.115.1 >}}
-: When enabled, creates a `hugo_stats.json` file in the root of your project. This file contains arrays of the `class` attributes, `id` attributes, and tags of every HTML element within your published site. Use this file as data source when [removing unused CSS] from your site. This process is also known as pruning, purging, or tree shaking.
-
-[removing unused CSS]: /hugo-pipes/postprocess/#css-purging-with-postcss
-
-Exclude `class` attributes, `id` attributes, or tags from `hugo_stats.json` with the `disableClasses`, `disableIDs`, and `disableTags` keys.
-
-{{% note %}}
-With v0.115.0 and earlier this feature was enabled by setting `writeStats` to `true`. Although still functional, the `writeStats` key will be deprecated in a future release.
-
-Given that CSS purging is typically limited to production builds, place the `buildStats` object below [config/production].
-
-[config/production]: /getting-started/configuration/#configuration-directory
-
-Built for speed, there may be "false positive" detections (e.g., HTML elements that are not HTML elements) while parsing the published site. These "false positives" are infrequent and inconsequential.
-{{% /note %}}
-
-Due to the nature of partial server builds, new HTML entities are added while the server is running, but old values will not be removed until you restart the server or run a regular `hugo` build.
-
-cachebusters
-: See [Configure Cache Busters](#configure-cache-busters)
-
-noJSConfigInAssets
-: Turn off writing a `jsconfig.json` into your `/assets` folder with mapping of imports from running [js.Build](/hugo-pipes/js). This file is intended to help with intellisense/navigation inside code editors such as [VS Code](https://code.visualstudio.com/). Note that if you do not use `js.Build`, no file will be written.
-
-useResourceCacheWhen
-: When to use the cached resources in `/resources/_gen` for PostCSS and ToCSS. Valid values are `never`, `always` and `fallback`. The last value means that the cache will be tried if PostCSS/extended version is not available.
-
-## Configure cache busters
-
-{{< new-in 0.112.0 >}}
-
-The `build.cachebusters` configuration option was added to support development using Tailwind 3.x's JIT compiler where a `build` configuration may look like this:
-
-{{< code-toggle file=hugo >}}
-[build]
- [build.buildStats]
- enable = true
- [[build.cachebusters]]
- source = "assets/watching/hugo_stats\\.json"
- target = "styles\\.css"
- [[build.cachebusters]]
- source = "(postcss|tailwind)\\.config\\.js"
- target = "css"
- [[build.cachebusters]]
- source = "assets/.*\\.(js|ts|jsx|tsx)"
- target = "js"
- [[build.cachebusters]]
- source = "assets/.*\\.(.*)$"
- target = "$1"
-{{< /code-toggle >}}
-
-When `buildStats` {{< new-in 0.115.1 >}} is enabled, Hugo writes a `hugo_stats.json` file on each build with HTML classes etc. that's used in the rendered output. Changes to this file will trigger a rebuild of the `styles.css` file. You also need to add `hugo_stats.json` to Hugo's server watcher. See [Hugo Starter Tailwind Basic](https://github.com/bep/hugo-starter-tailwind-basic) for a running example.
-
-source
-: A regexp matching file(s) relative to one of the virtual component directories in Hugo, typically `assets/...`.
+See [Configure Build](/getting-started/configuration-build/).
-target
-: A regexp matching the keys in the resource cache that should be expired when `source` changes. You can use the matching regexp groups from `source` in the expression, e.g. `$1`.
## Configure server
## Configure with environment variables
-In addition to the 3 configuration options already mentioned, configuration key-values can be defined through operating system environment variables.
+Configuration key-values can be defined through operating system environment variables.
For example, the following command will effectively set a website's title on Unix-like systems:
If you want to know the current value of `cacheDir`, you can run `hugo config`, e.g: `hugo config | grep cachedir`.
-[`time`]: /functions/time/astime/
[`.Site.Params`]: /method/site/params/
[directory structure]: /getting-started/directory-structure/
[lookup order]: /templates/lookup-order/
```
Dynacache
-: A in memory LRU cache that gets evicted on changes, [Cache Buster](#configure-cache-busters) matches and in low memory situations.
+: A in memory LRU cache that gets evicted on changes, [Cache Buster](/getting-started/configuration-build/#configure-cache-busters) matches and in low memory situations.
HTTP Cache
: Enables HTTP cache behavior (RFC 9111) for remote resources. This works best for resources with properly set up HTTP cache headers. The HTTP cache uses the [file cache] to store and serve cached resources.
{{< new-in 0.123.0 >}}
-A page or page resource identifier derived from the file path, excluding its extension and language identifier. This value is neither a file path nor a URL. Starting with a file path relative to the content directory, Hugo determines the logical path by stripping the file extension and language identifier, converting to lower case, then replacing spaces with hyphens. <!-- You may also set this value using the `path` front matter field. --> See [examples](/methods/page/path/#examples).
+A page or page resource identifier derived from the file path, excluding its extension and language identifier. This value is neither a file path nor a URL. Starting with a file path relative to the content directory, Hugo determines the logical path by stripping the file extension and language identifier, converting to lower case, then replacing spaces with hyphens. {{% comment %}}<!-- You may also set this value using the `path` front matter field. -->{{% /comment %}} See [examples](/methods/page/path/#examples).
###### map
weight: 20
toc: true
aliases: [/quickstart/,/overview/quickstart/]
-minVersion: v0.112.0
+minVersion: v0.128.0
---
In this tutorial you will:
Before you begin this tutorial you must:
-1. [Install Hugo] (extended edition, {{% param "minVersion" %}} or later)
+1. [Install Hugo] (extended or extended/deploy edition, {{% param "minVersion" %}} or later)
1. [Install Git]
You must also be comfortable working from the command line.
build:
runs-on: ubuntu-latest
env:
- HUGO_VERSION: 0.128.0
+ HUGO_VERSION: 0.137.1
steps:
- name: Install Hugo CLI
run: |
{{< code file=.gitlab-ci.yml copy=true >}}
variables:
- DART_SASS_VERSION: 1.77.5
- HUGO_VERSION: 0.128.0
+ DART_SASS_VERSION: 1.80.6
+ HUGO_VERSION: 0.137.1
NODE_VERSION: 20.x
GIT_DEPTH: 0
GIT_STRATEGY: clone
{{< code file=netlify.toml >}}
[build.environment]
-HUGO_VERSION = "0.128.0"
+HUGO_VERSION = "0.137.1"
TZ = "America/Los_Angeles"
[build]
{{< code file=netlify.toml >}}
[build.environment]
-HUGO_VERSION = "0.128.0"
-DART_SASS_VERSION = "1.77.5"
+HUGO_VERSION = "0.137.1"
+DART_SASS_VERSION = "1.80.6"
TZ = "America/Los_Angeles"
[build]
---
title: Hugo Deploy
-description: Upload your site to GCS, S3, or Azure
+description: Deploy your site directly to a Google Cloud Storage bucket, an AWS S3 bucket, or an Azure Storage container.
categories: [hosting and deployment]
keywords: [deployment,s3,gcs,azure]
menu:
toc: true
---
-You can use the "hugo deploy" command to upload your site directly to a Google Cloud Storage (GCS) bucket, an AWS S3 bucket, and/or an Azure Storage container.
+Use the `hugo deploy` command to deploy your site directly to a Google Cloud Storage bucket, an AWS S3 bucket, or an Azure Storage container
+{{% note %}}
+This feature requires the Hugo extended/deploy edition. See the [installation] section for details.
+
+[installation]: /installation/
+{{% /note %}}
## Assumptions
## Usage
-Transpile Sass to CSS using the LibSass transpiler included in Hugo's extended edition, or [install Dart Sass](#dart-sass) to use the latest features of the Sass language.
+Transpile Sass to CSS using the LibSass transpiler included in Hugo's extended and extended/deploy editions, or [install Dart Sass](#dart-sass) to use the latest features of the Sass language.
```go-html-template
{{ $opts := dict "transpiler" "libsass" "targetPath" "css/style.css" }}
## Options
transpiler
-: (`string`) The transpiler to use, either `libsass` (default) or `dartsass`. Hugo's extended edition includes the LibSass transpiler. To use the Dart Sass transpiler, see the [installation instructions](#dart-sass) below.
+: (`string`) The transpiler to use, either `libsass` (default) or `dartsass`. Hugo's extended and extended/deploy editions include the LibSass transpiler. To use the Dart Sass transpiler, see the [installation instructions](#dart-sass) below.
targetPath
: (`string`) If not set, the transformed resource's target path will be the original path of the asset file with its extension replaced by `.css`.
```yaml
variables:
- HUGO_VERSION: 0.128.0
- DART_SASS_VERSION: 1.77.5
+ HUGO_VERSION: 0.137.1
+ DART_SASS_VERSION: 1.80.6
GIT_DEPTH: 0
GIT_STRATEGY: clone
GIT_SUBMODULE_STRATEGY: recursive
```toml
[build.environment]
-HUGO_VERSION = "0.128.0"
-DART_SASS_VERSION = "1.77.5"
+HUGO_VERSION = "0.137.1"
+DART_SASS_VERSION = "1.80.6"
TZ = "America/Los_Angeles"
[build]
# Do not remove front matter.
---
-## Editions
+Hugo is available in three editions: standard, extended, and extended/deploy. While the standard edition provides core functionality, the extended and extended/deploy editions offer advanced features.
-Hugo is available in two editions: standard and extended. With the extended edition you can:
-
-- Encode to the WebP format when [processing images]. You can decode WebP images with either edition.
-- [Transpile Sass to CSS] using the embedded LibSass transpiler. The extended edition is not required to use the [Dart Sass] transpiler.
-
-We recommend that you install the extended edition.
+Feature|extended edition|extended/deploy edition
+:--|:-:|:-:
+Encode to the WebP format when [processing images]. You can decode WebP images with any edition.|:heavy_check_mark:|:heavy_check_mark:
+[Transpile Sass to CSS] using the embedded LibSass transpiler. You can use the [Dart Sass] transpiler with any edition.|:heavy_check_mark:|:heavy_check_mark:
+Deploy your site directly to a Google Cloud Storage bucket, an AWS S3 bucket, or an Azure Storage container. See [details].|:x:|:heavy_check_mark:
[dart sass]: /hugo-pipes/transpile-sass-to-css/#dart-sass
[processing images]: /content-management/image-processing/
[transpile sass to css]: /hugo-pipes/transpile-sass-to-css/
+[details]: /hosting-and-deployment/hugo-deploy/
## Build from source
-To build the extended edition of Hugo from source you must:
+To build the extended or extended/deploy edition from source you must:
1. Install [Git]
1. Install [Go] version 1.20 or later
> The install directory is controlled by the `GOPATH` and `GOBIN` environment variables. If `GOBIN` is set, binaries are installed to that directory. If `GOPATH` is set, binaries are installed to the bin subdirectory of the first directory in the `GOPATH` list. Otherwise, binaries are installed to the bin subdirectory of the default `GOPATH` (`$HOME/go` or `%USERPROFILE%\go`).
-Then build and test:
+To build the standard edition:
+
+```sh
+go install github.com/gohugoio/hugo@latest
+```
+
+To build the extended edition:
```sh
CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@latest
-hugo version
+```
+
+To build the extended/deploy edition:
+
+```sh
+CGO_ENABLED=1 go install -tags extended,withdeploy github.com/gohugoio/hugo@latest
```
[Clang]: https://clang.llvm.org/
weight: 50
toc: true
---
+
+## Editions
+
{{% include "installation/_common/01-editions.md" %}}
+Unless your specific deployment needs require the extended/deploy edition, we recommend the extended edition.
+
{{% include "installation/_common/02-prerequisites.md" %}}
{{% include "installation/_common/03-prebuilt-binaries.md" %}}
weight: 30
toc: true
---
+
+## Editions
+
{{% include "installation/_common/01-editions.md" %}}
+Unless your specific deployment needs require the extended/deploy edition, we recommend the extended edition.
+
{{% include "installation/_common/02-prerequisites.md" %}}
{{% include "installation/_common/03-prebuilt-binaries.md" %}}
[Gentoo]: https://www.gentoo.org/
[USE]: https://packages.gentoo.org/packages/www-apps/hugo
+### NixOS
+
+The NixOS distribution of Linux includes Hugo in its package repository. To install the extended edition of Hugo:
+
+```sh
+nix-env -iA nixos.hugo
+```
+
### openSUSE
Derivatives of the [openSUSE] distribution of Linux include [GeckoLinux], [Linux Karmada], and others. To install the extended edition of Hugo:
weight: 20
toc: true
---
+
+## Editions
+
{{% include "installation/_common/01-editions.md" %}}
+Unless your specific deployment needs require the extended/deploy edition, we recommend the extended edition.
+
{{% include "installation/_common/02-prerequisites.md" %}}
{{% include "installation/_common/03-prebuilt-binaries.md" %}}
Hugo v0.121.1 and later require at least Windows 10 or Windows Server 2016.
{{% /note %}}
+## Editions
+
{{% include "installation/_common/01-editions.md" %}}
+Unless your specific deployment needs require the extended/deploy edition, we recommend the extended edition.
+
{{% include "installation/_common/02-prerequisites.md" %}}
{{% include "installation/_common/03-prebuilt-binaries.md" %}}
{{ .ContentWithoutSummary }}
```
-The `ContentWithoutSummary` method returns an empty string if you define the content summary in front matter.
+The `ContentWithoutSummary` method returns the same as `Content` if you define the content summary in front matter.
weight = 2
{{< /code-toggle >}}
-Lang
-: (`string`) The language tag as defined by [RFC 5646].
+###### Lang
+
+(`string`) The language tag as defined by [RFC 5646].
```go-html-template
{{ .Language.Lang }} → de
```
-LanguageCode
-: (`string`) The language code from the site configuration. Falls back to `Lang` if not defined.
+###### LanguageCode
+
+(`string`) The language code from the site configuration. Falls back to `Lang` if not defined.
```go-html-template
{{ .Language.LanguageCode }} → de-DE
```
-LanguageDirection
-: (`string`) The language direction from the site configuration, either `ltr` or `rtl`.
+###### LanguageDirection
+
+(`string`) The language direction from the site configuration, either `ltr` or `rtl`.
```go-html-template
{{ .Language.LanguageDirection }} → ltr
```
-LanguageName
-: (`string`) The language name from the site configuration.
+###### LanguageName
+
+(`string`) The language name from the site configuration.
```go-html-template
{{ .Language.LanguageName }} → Deutsch
```
-Weight
-: (`int`) The language weight from the site configuration which determines its order in the slice of languages returned by the `Languages` method on a `Site` object.
+###### Weight
+
+(`int`) The language weight from the site configuration which determines its order in the slice of languages returned by the `Languages` method on a `Site` object.
```go-html-template
{{ .Language.Weight }} → 2
signatures: ['PAGE.Paginate COLLECTION [N]']
---
-[Pagination] is the process of splitting a list page into two or more pagers, where each pager contains a subset of the page collection and navigation links to other pagers.
+Pagination is the process of splitting a list page into two or more pagers, where each pager contains a subset of the page collection and navigation links to other pagers.
By default, the number of elements on each pager is determined by your [site configuration]. The default is `10`. Override that value by providing a second argument, an integer, when calling the `Paginate` method.
signatures: [PAGE.Paginator]
---
-[Pagination] is the process of splitting a list page into two or more pagers, where each pager contains a subset of the page collection and navigation links to other pagers.
+Pagination is the process of splitting a list page into two or more pagers, where each pager contains a subset of the page collection and navigation links to other pagers.
The number of elements on each pager is determined by your [site configuration]. The default is `10`.
Then call the shortcode in your Markdown:
{{< code file=content/about.md lang=md >}}
-{{%/* include "/snippets/services.md" */%}}
-{{%/* include "/snippets/values.md" */%}}
-{{%/* include "/snippets/leadership.md" */%}}
+{{%/* include "/snippets/services" */%}}
+{{%/* include "/snippets/values" */%}}
+{{%/* include "/snippets/leadership" */%}}
{{< /code >}}
Each of the included Markdown files can contain calls to other shortcodes.
```
Note that the shortcode within the content file was rendered, but the surrounding Markdown was preserved.
+
+
+## Limitations
+
+The primary use case for `.RenderShortcodes` is inclusion of Markdown content. If you try to use `.RenderShortcodes` inside `HTML` blocks when inside Markdown, you will get a warning similar to this:
+
+```
+WARN .RenderShortcodes detected inside HTML block in "/content/mypost.md"; this may not be what you intended ...
+```
+
+The above warning can be turned off is this is what you really want.
aliases: [/extras/scratch/,/doc/scratch/,/functions/scratch]
---
+{{% deprecated-in 0.138.0 %}}
+Use the [`PAGE.Store`] method instead.
+
+This is a soft deprecation. This method will be removed in a future release, but the removal date has not been established. Although Hugo will not emit a warning if you continue to use this method, you should begin using `PAGE.Store` as soon as possible.
+
+Beginning with v0.138.0 the `PAGE.Scratch` method is aliased to `PAGE.Store`.
+
+[`PAGE.Store`]: /methods/page/store/
+{{% /deprecated-in %}}
+
The `Scratch` method on a `Page` object creates a [scratch pad] to store and manipulate data. To create a scratch pad that is not reset on server rebuilds, use the [`Store`] method instead.
To create a locally scoped scratch pad that is not attached to a `Page` object, use the [`newScratch`] function.
## Determinate values
-The `Scratch` method is often used to set scratch pad values within a shortcode, a partial template called by a shortcode, or by a Markdown render hook. In all three cases, the scratch pad values are not determinate until Hugo renders the page content.
+The `Scratch` method is often used to set scratch pad values within a shortcode, a partial template called by a shortcode, or by a Markdown render hook. In all three cases, the scratch pad values are indeterminate until Hugo renders the page content.
If you need to access a scratch pad value from a parent template, and the parent template has not yet rendered the page content, you can trigger content rendering by assigning the returned value to a [noop] variable:
{{ .Store.Get "mykey" }}
```
-You can also trigger content rendering with the `FuzzyWordCount`, `Len`, `Plain`, `PlainWords`, `ReadingTime`, `Summary`, `Truncated`, and `WordCount` methods. For example:
+You can also trigger content rendering with the `ContentWithoutSummary`, `FuzzyWordCount`, `Len`, `Plain`, `PlainWords`, `ReadingTime`, `Summary`, `Truncated`, and `WordCount` methods. For example:
```go-html-template
{{ $noop := .WordCount }}
aliases: [/functions/store]
---
-The `Store` method on a `Page` object creates a persistent [scratch pad] to store and manipulate data. In contrast with the [`Scratch`] method, the scratch pad created by the `Store` method is not reset on server rebuilds.
-
-To create a locally scoped scratch pad that is not attached to a `Page` object, use the [`newScratch`] function.
+The `Store` method on a `Page` object creates a persistent [scratch pad] to store and manipulate data. To create a locally scoped scratch pad that is not attached to a `Page` object, use the [`newScratch`] function.
[`Scratch`]: /methods/page/scratch/
[`newScratch`]: /functions/collections/newscratch/
## Determinate values
-The `Store` method is often used to set scratch pad values within a shortcode, a partial template called by a shortcode, or by a Markdown render hook. In all three cases, the scratch pad values are not determinate until Hugo renders the page content.
+The `Store` method is often used to set scratch pad values within a shortcode, a partial template called by a shortcode, or by a Markdown render hook. In all three cases, the scratch pad values are indeterminate until Hugo renders the page content.
If you need to access a scratch pad value from a parent template, and the parent template has not yet rendered the page content, you can trigger content rendering by assigning the returned value to a [noop] variable:
{{ .Store.Get "mykey" }}
```
-You can also trigger content rendering with the `FuzzyWordCount`, `Len`, `Plain`, `PlainWords`, `ReadingTime`, `Summary`, `Truncated`, and `WordCount` methods. For example:
+You can also trigger content rendering with the `ContentWithoutSummary`, `FuzzyWordCount`, `Len`, `Plain`, `PlainWords`, `ReadingTime`, `Summary`, `Truncated`, and `WordCount` methods. For example:
```go-html-template
{{ $noop := .WordCount }}
---
title: Summary
-description: Returns the content summary of the given page.
+description: Returns the summary of the given page.
categories: []
keywords: []
action:
related:
- methods/page/Truncated
+ - methods/page/Content
+ - methods/page/ContentWithoutSummary
- methods/page/Description
returnType: template.HTML
signatures: [PAGE.Summary]
---
-<!-- Do not remove the manual summary divider below. -->
-<!-- If you do, you will break its first literal usage on this page. -->
+{{% comment %}}
+Do not remove the manual summary divider below.
+If you do, you will break its first literal usage on this page.
+{{% /comment %}}
<!--more-->
-There are three ways to define the [content summary]:
+You can define a [summary] manually, in front matter, or automatically. A manual summary takes precedence over a front matter summary, and a front matter summary takes precedence over an automatic summary.
-1. Let Hugo create the summary based on the first 70 words. You can change the number of words by setting the `summaryLength` in your site configuration.
-2. Manually split the content with a `<!--more-->` tag in Markdown. Everything before the tag is included in the summary.
-3. Create a `summary` field in front matter.
+[summary]: /content-management/summaries/
To list the pages in a section with a summary beneath each link:
{{ end }}
```
-[content summary]: /content-management/summaries/
+Depending on content length and how you define the summary, the summary may be equivalent to the content itself. To determine whether the content length exceeds the summary length, use the [`Truncated`] method on a `Page` object. This is useful for conditionally rendering a “read more” link:
+
+[`Truncated`]: /methods/page/truncated
+
+```go-html-template
+{{ range .Pages }}
+ <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
+ {{ .Summary }}
+ {{ if .Truncated }}
+ <a href="{{ .RelPermalink }}">Read more...</a>
+ {{ end }}
+{{ end }}
+```
+
+{{% note %}}
+The `Truncated` method returns `false` if you define the summary in front matter.
+{{% /note %}}
signatures: [PAGE.Truncated]
---
-There are three ways to define the [content summary]:
+You can define a [summary] manually, in front matter, or automatically. A manual summary takes precedence over a front matter summary, and a front matter summary takes precedence over an automatic summary.
-1. Let Hugo create the summary based on the first 70 words. You can change the number of words by setting the `summaryLength` in your site configuration.
-2. Manually split the content with a `<--more-->` tag in Markdown. Everything before the tag is included in the summary.
-3. Create a `summary` field in front matter.
+[summary]: /content-management/summaries/
-{{% note %}}
-The `Truncated` method returns `false` if you define the summary in front matter.
-{{% /note %}}
-
-The `Truncated` method returns `true` if the content length exceeds the summary length. This is useful for rendering a "read more" link:
+The `Truncated` method returns `true` if the content length exceeds the summary length. This is useful for conditionally rendering a "read more" link:
```go-html-template
{{ range .Pages }}
{{ end }}
```
-[content summary]: /content-management/summaries/
+{{% note %}}
+The `Truncated` method returns `false` if you define the summary in front matter.
+{{% /note %}}
---
# Do not remove front matter.
---
-
Hugo generates one or more files per page when building a site. For example, when rendering home, [section], [taxonomy], and [term] pages, Hugo generates an HTML file and an RSS file. Both HTML and RSS are built-in _output formats_. Create multiple output formats, and control generation based on [page kind], or by enabling one or more output formats for one or more pages. See [details].
[section]: /getting-started/glossary/#section
math: true
---
-{{< new-in 0.104.0 >}}
-
The `Resources.Colors` method returns a slice of the most dominant colors in an image, ordered from most dominant to least dominant. This method is fast, but if you also downsize your image you can improve performance by extracting the colors from the scaled image.
{{% include "methods/resource/_common/global-page-remote-resources.md" %}}
<div class="card-title">{{ . }}</div>
{{ end }}
<div class="card-content">
- {{ trim .Inner "\r\n" }}
+ {{ .Inner | strings.TrimSpace }}
</div>
</div>
{{< /code >}}
```
{{% note %}}
-Content between opening and closing shortcode tags may include leading and/or trailing newlines, depending on placement within the Markdown. Use the [`trim`] function as shown above to remove both carriage returns and newlines.
+Content between opening and closing shortcode tags may include leading and/or trailing newlines, depending on placement within the Markdown. Use the [`strings.TrimSpace`] function as shown above to remove both carriage returns and newlines.
-[`trim`]: /functions/strings/trim/
+[`strings.TrimSpace`]: /functions/strings/trimspace/
{{% /note %}}
{{% note %}}
<div class="card-title">{{ . }}</div>
{{ end }}
<div class="card-content">
- {{ trim .Inner "\r\n" | .Page.RenderString }}
+ {{ .Inner | strings.TrimSpace | .Page.RenderString }}
</div>
</div>
{{< /code >}}
{{ end }}
<div class="card-content">
- {{ trim .Inner "\r\n" }}
+ {{ .Inner | strings.TrimSpace }}
</div>
</div>
{{< /code >}}
+ <div class="card-title">{{ . }}</div>
{{ end }}
<div class="card-content">
-- {{ trim .Inner "\r\n" | .Page.RenderString }}
+- {{ .Inner | strings.TrimSpace | .Page.RenderString }}
+
-+ {{ trim .Inner "\r\n" }}
++ {{ .Inner | strings.TrimSpace }}
</div>
</div>
```
{{< code file=layouts/shortcodes/gallery.html >}}
<div class="gallery">
- {{ trim .Inner "\r\n" | .Page.RenderString }}
+ {{ .Inner | strings.TrimSpace | .Page.RenderString }}
</div>
{{< /code >}}
{{< code file=layouts/shortcodes/gallery.html >}}
<div class="gallery">
- {{ trim .InnerDeindent "\r\n" | .Page.RenderString }}
+ {{ .InnerDeindent | strings.TrimSpace | .Page.RenderString }}
</div>
{{< /code >}}
{{< code file=layouts/shortcodes/greeting.html >}}
<div class="greeting">
- {{ trim .Inner "\r\n" | .Page.RenderString }}
+ {{ .Inner | strings.TrimSpace | .Page.RenderString }}
</div>
{{< /code >}}
weight = 1
{{< /code-toggle >}}
-Lang
-: (`string`) The language tag as defined by [RFC 5646].
+###### Lang
+
+(`string`) The language tag as defined by [RFC 5646].
```go-html-template
{{ .Site.Language.Lang }} → de
```
-LanguageCode
-: (`string`) The language code from the site configuration. Falls back to `Lang` if not defined.
+###### LanguageCode
+
+(`string`) The language code from the site configuration. Falls back to `Lang` if not defined.
```go-html-template
{{ .Site.Language.LanguageCode }} → de-DE
```
-LanguageDirection
-: (`string`) The language direction from the site configuration, either `ltr` or `rtl`.
+###### LanguageDirection
+
+(`string`) The language direction from the site configuration, either `ltr` or `rtl`.
```go-html-template
{{ .Site.Language.LanguageDirection }} → ltr
```
-LanguageName
-: (`string`) The language name from the site configuration.
+###### LanguageName
+
+(`string`) The language name from the site configuration.
```go-html-template
{{ .Site.Language.LanguageName }} → Deutsch
```
-Weight
-: (`int`) The language weight from the site configuration which determines its order in the slice of languages returned by the `Languages` method on a `Site` object.
+###### Weight
+
+(`int`) The language weight from the site configuration which determines its order in the slice of languages returned by the `Languages` method on a `Site` object.
```go-html-template
{{ .Site.Language.Weight }} → 1
signatures: [SITE.Taxonomies]
---
-<!-- TODO
+{{% comment %}}
Show template example: GetTerms
-
-
-
--->
+{{% /comment %}}
Conceptually, the `Taxonomies` method on a `Site` object returns a data structure such as:
[`emojify`]: /functions/transform/emojify/
[`RenderString`]: /methods/page/renderstring/
-<!--
+{{% comment %}}
To generate the sections below:
git clone https://github.com/ikatyang/emoji-cheat-sheet
1. Copy and paste from README.md
2. Search/replace (regex) "^###\s" with "## "
3. Search/replace "^####\s " with "### "
--->
+ 4. Search/replace (regex) "<br />" ""
+{{% /comment %}}
## Table of Contents
| - | :-: | - | :-: | - | - |
| [top](#smileys--emotion) | :grinning: | `:grinning:` | :smiley: | `:smiley:` | [top](#table-of-contents) |
| [top](#smileys--emotion) | :smile: | `:smile:` | :grin: | `:grin:` | [top](#table-of-contents) |
-| [top](#smileys--emotion) | :laughing: | `:laughing:` <br /> `:satisfied:` | :sweat_smile: | `:sweat_smile:` | [top](#table-of-contents) |
+| [top](#smileys--emotion) | :laughing: | `:laughing:` `:satisfied:` | :sweat_smile: | `:sweat_smile:` | [top](#table-of-contents) |
| [top](#smileys--emotion) | :rofl: | `:rofl:` | :joy: | `:joy:` | [top](#table-of-contents) |
| [top](#smileys--emotion) | :slightly_smiling_face: | `:slightly_smiling_face:` | :upside_down_face: | `:upside_down_face:` | [top](#table-of-contents) |
| [top](#smileys--emotion) | :melting_face: | `:melting_face:` | :wink: | `:wink:` | [top](#table-of-contents) |
| | ico | shortcode | ico | shortcode | |
| - | :-: | - | :-: | - | - |
-| [top](#smileys--emotion) | :triumph: | `:triumph:` | :pout: | `:pout:` <br /> `:rage:` | [top](#table-of-contents) |
+| [top](#smileys--emotion) | :triumph: | `:triumph:` | :pout: | `:pout:` `:rage:` | [top](#table-of-contents) |
| [top](#smileys--emotion) | :angry: | `:angry:` | :cursing_face: | `:cursing_face:` | [top](#table-of-contents) |
| [top](#smileys--emotion) | :smiling_imp: | `:smiling_imp:` | :imp: | `:imp:` | [top](#table-of-contents) |
| [top](#smileys--emotion) | :skull: | `:skull:` | :skull_and_crossbones: | `:skull_and_crossbones:` | [top](#table-of-contents) |
| | ico | shortcode | ico | shortcode | |
| - | :-: | - | :-: | - | - |
-| [top](#smileys--emotion) | :hankey: | `:hankey:` <br /> `:poop:` <br /> `:shit:` | :clown_face: | `:clown_face:` | [top](#table-of-contents) |
+| [top](#smileys--emotion) | :hankey: | `:hankey:` `:poop:` `:shit:` | :clown_face: | `:clown_face:` | [top](#table-of-contents) |
| [top](#smileys--emotion) | :japanese_ogre: | `:japanese_ogre:` | :japanese_goblin: | `:japanese_goblin:` | [top](#table-of-contents) |
| [top](#smileys--emotion) | :ghost: | `:ghost:` | :alien: | `:alien:` | [top](#table-of-contents) |
| [top](#smileys--emotion) | :space_invader: | `:space_invader:` | :robot: | `:robot:` | [top](#table-of-contents) |
| | ico | shortcode | ico | shortcode | |
| - | :-: | - | :-: | - | - |
| [top](#smileys--emotion) | :kiss: | `:kiss:` | :100: | `:100:` | [top](#table-of-contents) |
-| [top](#smileys--emotion) | :anger: | `:anger:` | :boom: | `:boom:` <br /> `:collision:` | [top](#table-of-contents) |
+| [top](#smileys--emotion) | :anger: | `:anger:` | :boom: | `:boom:` `:collision:` | [top](#table-of-contents) |
| [top](#smileys--emotion) | :dizzy: | `:dizzy:` | :sweat_drops: | `:sweat_drops:` | [top](#table-of-contents) |
| [top](#smileys--emotion) | :dash: | `:dash:` | :hole: | `:hole:` | [top](#table-of-contents) |
| [top](#smileys--emotion) | :speech_balloon: | `:speech_balloon:` | :eye_speech_bubble: | `:eye_speech_bubble:` | [top](#table-of-contents) |
| | ico | shortcode | ico | shortcode | |
| - | :-: | - | :-: | - | - |
| [top](#people--body) | :wave: | `:wave:` | :raised_back_of_hand: | `:raised_back_of_hand:` | [top](#table-of-contents) |
-| [top](#people--body) | :raised_hand_with_fingers_splayed: | `:raised_hand_with_fingers_splayed:` | :hand: | `:hand:` <br /> `:raised_hand:` | [top](#table-of-contents) |
+| [top](#people--body) | :raised_hand_with_fingers_splayed: | `:raised_hand_with_fingers_splayed:` | :hand: | `:hand:` `:raised_hand:` | [top](#table-of-contents) |
| [top](#people--body) | :vulcan_salute: | `:vulcan_salute:` | :rightwards_hand: | `:rightwards_hand:` | [top](#table-of-contents) |
| [top](#people--body) | :leftwards_hand: | `:leftwards_hand:` | :palm_down_hand: | `:palm_down_hand:` | [top](#table-of-contents) |
| [top](#people--body) | :palm_up_hand: | `:palm_up_hand:` | :leftwards_pushing_hand: | `:leftwards_pushing_hand:` | [top](#table-of-contents) |
| | ico | shortcode | ico | shortcode | |
| - | :-: | - | :-: | - | - |
| [top](#people--body) | :point_left: | `:point_left:` | :point_right: | `:point_right:` | [top](#table-of-contents) |
-| [top](#people--body) | :point_up_2: | `:point_up_2:` | :fu: | `:fu:` <br /> `:middle_finger:` | [top](#table-of-contents) |
+| [top](#people--body) | :point_up_2: | `:point_up_2:` | :fu: | `:fu:` `:middle_finger:` | [top](#table-of-contents) |
| [top](#people--body) | :point_down: | `:point_down:` | :point_up: | `:point_up:` | [top](#table-of-contents) |
| [top](#people--body) | :index_pointing_at_the_viewer: | `:index_pointing_at_the_viewer:` | | | [top](#table-of-contents) |
| | ico | shortcode | ico | shortcode | |
| - | :-: | - | :-: | - | - |
-| [top](#people--body) | :+1: | `:+1:` <br /> `:thumbsup:` | :-1: | `:-1:` <br /> `:thumbsdown:` | [top](#table-of-contents) |
-| [top](#people--body) | :fist: | `:fist:` <br /> `:fist_raised:` | :facepunch: | `:facepunch:` <br /> `:fist_oncoming:` <br /> `:punch:` | [top](#table-of-contents) |
+| [top](#people--body) | :+1: | `:+1:` `:thumbsup:` | :-1: | `:-1:` `:thumbsdown:` | [top](#table-of-contents) |
+| [top](#people--body) | :fist: | `:fist:` `:fist_raised:` | :facepunch: | `:facepunch:` `:fist_oncoming:` `:punch:` | [top](#table-of-contents) |
| [top](#people--body) | :fist_left: | `:fist_left:` | :fist_right: | `:fist_right:` | [top](#table-of-contents) |
### Hands
| [top](#people--body) | :person_red_hair: | `:person_red_hair:` | :curly_haired_woman: | `:curly_haired_woman:` | [top](#table-of-contents) |
| [top](#people--body) | :person_curly_hair: | `:person_curly_hair:` | :white_haired_woman: | `:white_haired_woman:` | [top](#table-of-contents) |
| [top](#people--body) | :person_white_hair: | `:person_white_hair:` | :bald_woman: | `:bald_woman:` | [top](#table-of-contents) |
-| [top](#people--body) | :person_bald: | `:person_bald:` | :blond_haired_woman: | `:blond_haired_woman:` <br /> `:blonde_woman:` | [top](#table-of-contents) |
+| [top](#people--body) | :person_bald: | `:person_bald:` | :blond_haired_woman: | `:blond_haired_woman:` `:blonde_woman:` | [top](#table-of-contents) |
| [top](#people--body) | :blond_haired_man: | `:blond_haired_man:` | :older_adult: | `:older_adult:` | [top](#table-of-contents) |
| [top](#people--body) | :older_man: | `:older_man:` | :older_woman: | `:older_woman:` | [top](#table-of-contents) |
| [top](#people--body) | :frowning_person: | `:frowning_person:` | :frowning_man: | `:frowning_man:` | [top](#table-of-contents) |
| [top](#people--body) | :frowning_woman: | `:frowning_woman:` | :pouting_face: | `:pouting_face:` | [top](#table-of-contents) |
| [top](#people--body) | :pouting_man: | `:pouting_man:` | :pouting_woman: | `:pouting_woman:` | [top](#table-of-contents) |
-| [top](#people--body) | :no_good: | `:no_good:` | :ng_man: | `:ng_man:` <br /> `:no_good_man:` | [top](#table-of-contents) |
-| [top](#people--body) | :ng_woman: | `:ng_woman:` <br /> `:no_good_woman:` | :ok_person: | `:ok_person:` | [top](#table-of-contents) |
+| [top](#people--body) | :no_good: | `:no_good:` | :ng_man: | `:ng_man:` `:no_good_man:` | [top](#table-of-contents) |
+| [top](#people--body) | :ng_woman: | `:ng_woman:` `:no_good_woman:` | :ok_person: | `:ok_person:` | [top](#table-of-contents) |
| [top](#people--body) | :ok_man: | `:ok_man:` | :ok_woman: | `:ok_woman:` | [top](#table-of-contents) |
-| [top](#people--body) | :information_desk_person: | `:information_desk_person:` <br /> `:tipping_hand_person:` | :sassy_man: | `:sassy_man:` <br /> `:tipping_hand_man:` | [top](#table-of-contents) |
-| [top](#people--body) | :sassy_woman: | `:sassy_woman:` <br /> `:tipping_hand_woman:` | :raising_hand: | `:raising_hand:` | [top](#table-of-contents) |
+| [top](#people--body) | :information_desk_person: | `:information_desk_person:` `:tipping_hand_person:` | :sassy_man: | `:sassy_man:` `:tipping_hand_man:` | [top](#table-of-contents) |
+| [top](#people--body) | :sassy_woman: | `:sassy_woman:` `:tipping_hand_woman:` | :raising_hand: | `:raising_hand:` | [top](#table-of-contents) |
| [top](#people--body) | :raising_hand_man: | `:raising_hand_man:` | :raising_hand_woman: | `:raising_hand_woman:` | [top](#table-of-contents) |
| [top](#people--body) | :deaf_person: | `:deaf_person:` | :deaf_man: | `:deaf_man:` | [top](#table-of-contents) |
| [top](#people--body) | :deaf_woman: | `:deaf_woman:` | :bow: | `:bow:` | [top](#table-of-contents) |
| [top](#people--body) | :astronaut: | `:astronaut:` | :man_astronaut: | `:man_astronaut:` | [top](#table-of-contents) |
| [top](#people--body) | :woman_astronaut: | `:woman_astronaut:` | :firefighter: | `:firefighter:` | [top](#table-of-contents) |
| [top](#people--body) | :man_firefighter: | `:man_firefighter:` | :woman_firefighter: | `:woman_firefighter:` | [top](#table-of-contents) |
-| [top](#people--body) | :cop: | `:cop:` <br /> `:police_officer:` | :policeman: | `:policeman:` | [top](#table-of-contents) |
+| [top](#people--body) | :cop: | `:cop:` `:police_officer:` | :policeman: | `:policeman:` | [top](#table-of-contents) |
| [top](#people--body) | :policewoman: | `:policewoman:` | :detective: | `:detective:` | [top](#table-of-contents) |
| [top](#people--body) | :male_detective: | `:male_detective:` | :female_detective: | `:female_detective:` | [top](#table-of-contents) |
| [top](#people--body) | :guard: | `:guard:` | :guardsman: | `:guardsman:` | [top](#table-of-contents) |
| [top](#people--body) | :woman_with_headscarf: | `:woman_with_headscarf:` | :person_in_tuxedo: | `:person_in_tuxedo:` | [top](#table-of-contents) |
| [top](#people--body) | :man_in_tuxedo: | `:man_in_tuxedo:` | :woman_in_tuxedo: | `:woman_in_tuxedo:` | [top](#table-of-contents) |
| [top](#people--body) | :person_with_veil: | `:person_with_veil:` | :man_with_veil: | `:man_with_veil:` | [top](#table-of-contents) |
-| [top](#people--body) | :bride_with_veil: | `:bride_with_veil:` <br /> `:woman_with_veil:` | :pregnant_woman: | `:pregnant_woman:` | [top](#table-of-contents) |
+| [top](#people--body) | :bride_with_veil: | `:bride_with_veil:` `:woman_with_veil:` | :pregnant_woman: | `:pregnant_woman:` | [top](#table-of-contents) |
| [top](#people--body) | :pregnant_man: | `:pregnant_man:` | :pregnant_person: | `:pregnant_person:` | [top](#table-of-contents) |
| [top](#people--body) | :breast_feeding: | `:breast_feeding:` | :woman_feeding_baby: | `:woman_feeding_baby:` | [top](#table-of-contents) |
| [top](#people--body) | :man_feeding_baby: | `:man_feeding_baby:` | :person_feeding_baby: | `:person_feeding_baby:` | [top](#table-of-contents) |
| [top](#people--body) | :person_in_motorized_wheelchair: | `:person_in_motorized_wheelchair:` | :man_in_motorized_wheelchair: | `:man_in_motorized_wheelchair:` | [top](#table-of-contents) |
| [top](#people--body) | :woman_in_motorized_wheelchair: | `:woman_in_motorized_wheelchair:` | :person_in_manual_wheelchair: | `:person_in_manual_wheelchair:` | [top](#table-of-contents) |
| [top](#people--body) | :man_in_manual_wheelchair: | `:man_in_manual_wheelchair:` | :woman_in_manual_wheelchair: | `:woman_in_manual_wheelchair:` | [top](#table-of-contents) |
-| [top](#people--body) | :runner: | `:runner:` <br /> `:running:` | :running_man: | `:running_man:` | [top](#table-of-contents) |
-| [top](#people--body) | :running_woman: | `:running_woman:` | :dancer: | `:dancer:` <br /> `:woman_dancing:` | [top](#table-of-contents) |
+| [top](#people--body) | :runner: | `:runner:` `:running:` | :running_man: | `:running_man:` | [top](#table-of-contents) |
+| [top](#people--body) | :running_woman: | `:running_woman:` | :dancer: | `:dancer:` `:woman_dancing:` | [top](#table-of-contents) |
| [top](#people--body) | :man_dancing: | `:man_dancing:` | :business_suit_levitating: | `:business_suit_levitating:` | [top](#table-of-contents) |
| [top](#people--body) | :dancers: | `:dancers:` | :dancing_men: | `:dancing_men:` | [top](#table-of-contents) |
| [top](#people--body) | :dancing_women: | `:dancing_women:` | :sauna_person: | `:sauna_person:` | [top](#table-of-contents) |
| [top](#people--body) | :rowboat: | `:rowboat:` | :rowing_man: | `:rowing_man:` | [top](#table-of-contents) |
| [top](#people--body) | :rowing_woman: | `:rowing_woman:` | :swimmer: | `:swimmer:` | [top](#table-of-contents) |
| [top](#people--body) | :swimming_man: | `:swimming_man:` | :swimming_woman: | `:swimming_woman:` | [top](#table-of-contents) |
-| [top](#people--body) | :bouncing_ball_person: | `:bouncing_ball_person:` | :basketball_man: | `:basketball_man:` <br /> `:bouncing_ball_man:` | [top](#table-of-contents) |
-| [top](#people--body) | :basketball_woman: | `:basketball_woman:` <br /> `:bouncing_ball_woman:` | :weight_lifting: | `:weight_lifting:` | [top](#table-of-contents) |
+| [top](#people--body) | :bouncing_ball_person: | `:bouncing_ball_person:` | :basketball_man: | `:basketball_man:` `:bouncing_ball_man:` | [top](#table-of-contents) |
+| [top](#people--body) | :basketball_woman: | `:basketball_woman:` `:bouncing_ball_woman:` | :weight_lifting: | `:weight_lifting:` | [top](#table-of-contents) |
| [top](#people--body) | :weight_lifting_man: | `:weight_lifting_man:` | :weight_lifting_woman: | `:weight_lifting_woman:` | [top](#table-of-contents) |
| [top](#people--body) | :bicyclist: | `:bicyclist:` | :biking_man: | `:biking_man:` | [top](#table-of-contents) |
| [top](#people--body) | :biking_woman: | `:biking_woman:` | :mountain_bicyclist: | `:mountain_bicyclist:` | [top](#table-of-contents) |
| [top](#animals--nature) | :koala: | `:koala:` | :panda_face: | `:panda_face:` | [top](#table-of-contents) |
| [top](#animals--nature) | :sloth: | `:sloth:` | :otter: | `:otter:` | [top](#table-of-contents) |
| [top](#animals--nature) | :skunk: | `:skunk:` | :kangaroo: | `:kangaroo:` | [top](#table-of-contents) |
-| [top](#animals--nature) | :badger: | `:badger:` | :feet: | `:feet:` <br /> `:paw_prints:` | [top](#table-of-contents) |
+| [top](#animals--nature) | :badger: | `:badger:` | :feet: | `:feet:` `:paw_prints:` | [top](#table-of-contents) |
### Animal Bird
| | ico | shortcode | ico | shortcode | |
| - | :-: | - | :-: | - | - |
| [top](#animals--nature) | :whale: | `:whale:` | :whale2: | `:whale2:` | [top](#table-of-contents) |
-| [top](#animals--nature) | :dolphin: | `:dolphin:` <br /> `:flipper:` | :seal: | `:seal:` | [top](#table-of-contents) |
+| [top](#animals--nature) | :dolphin: | `:dolphin:` `:flipper:` | :seal: | `:seal:` | [top](#table-of-contents) |
| [top](#animals--nature) | :fish: | `:fish:` | :tropical_fish: | `:tropical_fish:` | [top](#table-of-contents) |
| [top](#animals--nature) | :blowfish: | `:blowfish:` | :shark: | `:shark:` | [top](#table-of-contents) |
| [top](#animals--nature) | :octopus: | `:octopus:` | :shell: | `:shell:` | [top](#table-of-contents) |
| - | :-: | - | :-: | - | - |
| [top](#animals--nature) | :snail: | `:snail:` | :butterfly: | `:butterfly:` | [top](#table-of-contents) |
| [top](#animals--nature) | :bug: | `:bug:` | :ant: | `:ant:` | [top](#table-of-contents) |
-| [top](#animals--nature) | :bee: | `:bee:` <br /> `:honeybee:` | :beetle: | `:beetle:` | [top](#table-of-contents) |
+| [top](#animals--nature) | :bee: | `:bee:` `:honeybee:` | :beetle: | `:beetle:` | [top](#table-of-contents) |
| [top](#animals--nature) | :lady_beetle: | `:lady_beetle:` | :cricket: | `:cricket:` | [top](#table-of-contents) |
| [top](#animals--nature) | :cockroach: | `:cockroach:` | :spider: | `:spider:` | [top](#table-of-contents) |
| [top](#animals--nature) | :spider_web: | `:spider_web:` | :scorpion: | `:scorpion:` | [top](#table-of-contents) |
| | ico | shortcode | ico | shortcode | |
| - | :-: | - | :-: | - | - |
| [top](#food--drink) | :grapes: | `:grapes:` | :melon: | `:melon:` | [top](#table-of-contents) |
-| [top](#food--drink) | :watermelon: | `:watermelon:` | :mandarin: | `:mandarin:` <br /> `:orange:` <br /> `:tangerine:` | [top](#table-of-contents) |
+| [top](#food--drink) | :watermelon: | `:watermelon:` | :mandarin: | `:mandarin:` `:orange:` `:tangerine:` | [top](#table-of-contents) |
| [top](#food--drink) | :lemon: | `:lemon:` | :banana: | `:banana:` | [top](#table-of-contents) |
| [top](#food--drink) | :pineapple: | `:pineapple:` | :mango: | `:mango:` | [top](#table-of-contents) |
| [top](#food--drink) | :apple: | `:apple:` | :green_apple: | `:green_apple:` | [top](#table-of-contents) |
| - | :-: | - | :-: | - | - |
| [top](#food--drink) | :chopsticks: | `:chopsticks:` | :plate_with_cutlery: | `:plate_with_cutlery:` | [top](#table-of-contents) |
| [top](#food--drink) | :fork_and_knife: | `:fork_and_knife:` | :spoon: | `:spoon:` | [top](#table-of-contents) |
-| [top](#food--drink) | :hocho: | `:hocho:` <br /> `:knife:` | :jar: | `:jar:` | [top](#table-of-contents) |
+| [top](#food--drink) | :hocho: | `:hocho:` `:knife:` | :jar: | `:jar:` | [top](#table-of-contents) |
| [top](#food--drink) | :amphora: | `:amphora:` | | | [top](#table-of-contents) |
## Travel & Places
| [top](#travel--places) | :ambulance: | `:ambulance:` | :fire_engine: | `:fire_engine:` | [top](#table-of-contents) |
| [top](#travel--places) | :police_car: | `:police_car:` | :oncoming_police_car: | `:oncoming_police_car:` | [top](#table-of-contents) |
| [top](#travel--places) | :taxi: | `:taxi:` | :oncoming_taxi: | `:oncoming_taxi:` | [top](#table-of-contents) |
-| [top](#travel--places) | :car: | `:car:` <br /> `:red_car:` | :oncoming_automobile: | `:oncoming_automobile:` | [top](#table-of-contents) |
+| [top](#travel--places) | :car: | `:car:` `:red_car:` | :oncoming_automobile: | `:oncoming_automobile:` | [top](#table-of-contents) |
| [top](#travel--places) | :blue_car: | `:blue_car:` | :pickup_truck: | `:pickup_truck:` | [top](#table-of-contents) |
| [top](#travel--places) | :truck: | `:truck:` | :articulated_lorry: | `:articulated_lorry:` | [top](#table-of-contents) |
| [top](#travel--places) | :tractor: | `:tractor:` | :racing_car: | `:racing_car:` | [top](#table-of-contents) |
| | ico | shortcode | ico | shortcode | |
| - | :-: | - | :-: | - | - |
| [top](#travel--places) | :anchor: | `:anchor:` | :ring_buoy: | `:ring_buoy:` | [top](#table-of-contents) |
-| [top](#travel--places) | :boat: | `:boat:` <br /> `:sailboat:` | :canoe: | `:canoe:` | [top](#table-of-contents) |
+| [top](#travel--places) | :boat: | `:boat:` `:sailboat:` | :canoe: | `:canoe:` | [top](#table-of-contents) |
| [top](#travel--places) | :speedboat: | `:speedboat:` | :passenger_ship: | `:passenger_ship:` | [top](#table-of-contents) |
| [top](#travel--places) | :ferry: | `:ferry:` | :motor_boat: | `:motor_boat:` | [top](#table-of-contents) |
| [top](#travel--places) | :ship: | `:ship:` | | | [top](#table-of-contents) |
| | ico | shortcode | ico | shortcode | |
| - | :-: | - | :-: | - | - |
| [top](#travel--places) | :new_moon: | `:new_moon:` | :waxing_crescent_moon: | `:waxing_crescent_moon:` | [top](#table-of-contents) |
-| [top](#travel--places) | :first_quarter_moon: | `:first_quarter_moon:` | :moon: | `:moon:` <br /> `:waxing_gibbous_moon:` | [top](#table-of-contents) |
+| [top](#travel--places) | :first_quarter_moon: | `:first_quarter_moon:` | :moon: | `:moon:` `:waxing_gibbous_moon:` | [top](#table-of-contents) |
| [top](#travel--places) | :full_moon: | `:full_moon:` | :waning_gibbous_moon: | `:waning_gibbous_moon:` | [top](#table-of-contents) |
| [top](#travel--places) | :last_quarter_moon: | `:last_quarter_moon:` | :waning_crescent_moon: | `:waning_crescent_moon:` | [top](#table-of-contents) |
| [top](#travel--places) | :crescent_moon: | `:crescent_moon:` | :new_moon_with_face: | `:new_moon_with_face:` | [top](#table-of-contents) |
| [top](#objects) | :eyeglasses: | `:eyeglasses:` | :dark_sunglasses: | `:dark_sunglasses:` | [top](#table-of-contents) |
| [top](#objects) | :goggles: | `:goggles:` | :lab_coat: | `:lab_coat:` | [top](#table-of-contents) |
| [top](#objects) | :safety_vest: | `:safety_vest:` | :necktie: | `:necktie:` | [top](#table-of-contents) |
-| [top](#objects) | :shirt: | `:shirt:` <br /> `:tshirt:` | :jeans: | `:jeans:` | [top](#table-of-contents) |
+| [top](#objects) | :shirt: | `:shirt:` `:tshirt:` | :jeans: | `:jeans:` | [top](#table-of-contents) |
| [top](#objects) | :scarf: | `:scarf:` | :gloves: | `:gloves:` | [top](#table-of-contents) |
| [top](#objects) | :coat: | `:coat:` | :socks: | `:socks:` | [top](#table-of-contents) |
| [top](#objects) | :dress: | `:dress:` | :kimono: | `:kimono:` | [top](#table-of-contents) |
| [top](#objects) | :folding_hand_fan: | `:folding_hand_fan:` | :purse: | `:purse:` | [top](#table-of-contents) |
| [top](#objects) | :handbag: | `:handbag:` | :pouch: | `:pouch:` | [top](#table-of-contents) |
| [top](#objects) | :shopping: | `:shopping:` | :school_satchel: | `:school_satchel:` | [top](#table-of-contents) |
-| [top](#objects) | :thong_sandal: | `:thong_sandal:` | :mans_shoe: | `:mans_shoe:` <br /> `:shoe:` | [top](#table-of-contents) |
+| [top](#objects) | :thong_sandal: | `:thong_sandal:` | :mans_shoe: | `:mans_shoe:` `:shoe:` | [top](#table-of-contents) |
| [top](#objects) | :athletic_shoe: | `:athletic_shoe:` | :hiking_boot: | `:hiking_boot:` | [top](#table-of-contents) |
| [top](#objects) | :flat_shoe: | `:flat_shoe:` | :high_heel: | `:high_heel:` | [top](#table-of-contents) |
| [top](#objects) | :sandal: | `:sandal:` | :ballet_shoes: | `:ballet_shoes:` | [top](#table-of-contents) |
| | ico | shortcode | ico | shortcode | |
| - | :-: | - | :-: | - | - |
| [top](#objects) | :iphone: | `:iphone:` | :calling: | `:calling:` | [top](#table-of-contents) |
-| [top](#objects) | :phone: | `:phone:` <br /> `:telephone:` | :telephone_receiver: | `:telephone_receiver:` | [top](#table-of-contents) |
+| [top](#objects) | :phone: | `:phone:` `:telephone:` | :telephone_receiver: | `:telephone_receiver:` | [top](#table-of-contents) |
| [top](#objects) | :pager: | `:pager:` | :fax: | `:fax:` | [top](#table-of-contents) |
### Computer
| [top](#objects) | :vhs: | `:vhs:` | :mag: | `:mag:` | [top](#table-of-contents) |
| [top](#objects) | :mag_right: | `:mag_right:` | :candle: | `:candle:` | [top](#table-of-contents) |
| [top](#objects) | :bulb: | `:bulb:` | :flashlight: | `:flashlight:` | [top](#table-of-contents) |
-| [top](#objects) | :izakaya_lantern: | `:izakaya_lantern:` <br /> `:lantern:` | :diya_lamp: | `:diya_lamp:` | [top](#table-of-contents) |
+| [top](#objects) | :izakaya_lantern: | `:izakaya_lantern:` `:lantern:` | :diya_lamp: | `:diya_lamp:` | [top](#table-of-contents) |
### Book Paper
| | ico | shortcode | ico | shortcode | |
| - | :-: | - | :-: | - | - |
| [top](#objects) | :notebook_with_decorative_cover: | `:notebook_with_decorative_cover:` | :closed_book: | `:closed_book:` | [top](#table-of-contents) |
-| [top](#objects) | :book: | `:book:` <br /> `:open_book:` | :green_book: | `:green_book:` | [top](#table-of-contents) |
+| [top](#objects) | :book: | `:book:` `:open_book:` | :green_book: | `:green_book:` | [top](#table-of-contents) |
| [top](#objects) | :blue_book: | `:blue_book:` | :orange_book: | `:orange_book:` | [top](#table-of-contents) |
| [top](#objects) | :books: | `:books:` | :notebook: | `:notebook:` | [top](#table-of-contents) |
| [top](#objects) | :ledger: | `:ledger:` | :page_with_curl: | `:page_with_curl:` | [top](#table-of-contents) |
| | ico | shortcode | ico | shortcode | |
| - | :-: | - | :-: | - | - |
-| [top](#objects) | :envelope: | `:envelope:` | :e-mail: | `:e-mail:` <br /> `:email:` | [top](#table-of-contents) |
+| [top](#objects) | :envelope: | `:envelope:` | :e-mail: | `:e-mail:` `:email:` | [top](#table-of-contents) |
| [top](#objects) | :incoming_envelope: | `:incoming_envelope:` | :envelope_with_arrow: | `:envelope_with_arrow:` | [top](#table-of-contents) |
| [top](#objects) | :outbox_tray: | `:outbox_tray:` | :inbox_tray: | `:inbox_tray:` | [top](#table-of-contents) |
| [top](#objects) | :package: | `:package:` | :mailbox: | `:mailbox:` | [top](#table-of-contents) |
| [top](#objects) | :pencil2: | `:pencil2:` | :black_nib: | `:black_nib:` | [top](#table-of-contents) |
| [top](#objects) | :fountain_pen: | `:fountain_pen:` | :pen: | `:pen:` | [top](#table-of-contents) |
| [top](#objects) | :paintbrush: | `:paintbrush:` | :crayon: | `:crayon:` | [top](#table-of-contents) |
-| [top](#objects) | :memo: | `:memo:` <br /> `:pencil:` | | | [top](#table-of-contents) |
+| [top](#objects) | :memo: | `:memo:` `:pencil:` | | | [top](#table-of-contents) |
### Office
| - | :-: | - | :-: | - | - |
| [top](#symbols) | :bangbang: | `:bangbang:` | :interrobang: | `:interrobang:` | [top](#table-of-contents) |
| [top](#symbols) | :question: | `:question:` | :grey_question: | `:grey_question:` | [top](#table-of-contents) |
-| [top](#symbols) | :grey_exclamation: | `:grey_exclamation:` | :exclamation: | `:exclamation:` <br /> `:heavy_exclamation_mark:` | [top](#table-of-contents) |
+| [top](#symbols) | :grey_exclamation: | `:grey_exclamation:` | :exclamation: | `:exclamation:` `:heavy_exclamation_mark:` | [top](#table-of-contents) |
| [top](#symbols) | :wavy_dash: | `:wavy_dash:` | | | [top](#table-of-contents) |
### Currency
| [top](#flags) | :ecuador: | `:ecuador:` | :estonia: | `:estonia:` | [top](#table-of-contents) |
| [top](#flags) | :egypt: | `:egypt:` | :western_sahara: | `:western_sahara:` | [top](#table-of-contents) |
| [top](#flags) | :eritrea: | `:eritrea:` | :es: | `:es:` | [top](#table-of-contents) |
-| [top](#flags) | :ethiopia: | `:ethiopia:` | :eu: | `:eu:` <br /> `:european_union:` | [top](#table-of-contents) |
+| [top](#flags) | :ethiopia: | `:ethiopia:` | :eu: | `:eu:` `:european_union:` | [top](#table-of-contents) |
| [top](#flags) | :finland: | `:finland:` | :fiji: | `:fiji:` | [top](#table-of-contents) |
| [top](#flags) | :falkland_islands: | `:falkland_islands:` | :micronesia: | `:micronesia:` | [top](#table-of-contents) |
| [top](#flags) | :faroe_islands: | `:faroe_islands:` | :fr: | `:fr:` | [top](#table-of-contents) |
-| [top](#flags) | :gabon: | `:gabon:` | :gb: | `:gb:` <br /> `:uk:` | [top](#table-of-contents) |
+| [top](#flags) | :gabon: | `:gabon:` | :gb: | `:gb:` `:uk:` | [top](#table-of-contents) |
| [top](#flags) | :grenada: | `:grenada:` | :georgia: | `:georgia:` | [top](#table-of-contents) |
| [top](#flags) | :french_guiana: | `:french_guiana:` | :guernsey: | `:guernsey:` | [top](#table-of-contents) |
| [top](#flags) | :ghana: | `:ghana:` | :gibraltar: | `:gibraltar:` | [top](#table-of-contents) |
###### Type
-(`bool`) The passthrough element type, either `block` or `inline`.
+(`string`) The passthrough element type, either `block` or `inline`.
## Example
{{- range .THead }}
<tr>
{{- range . }}
- <th {{ printf "style=%q" (printf "text-align: %s" .Alignment) | safeHTMLAttr }}>
+ <th
+ {{- with .Alignment }}
+ {{- printf " style=%q" (printf "text-align: %s" .) | safeHTMLAttr }}
+ {{- end -}}
+ >
{{- .Text -}}
</th>
{{- end }}
{{- range .TBody }}
<tr>
{{- range . }}
- <td {{ printf "style=%q" (printf "text-align: %s" .Alignment) | safeHTMLAttr }}>
+ <td
+ {{- with .Alignment }}
+ {{- printf " style=%q" (printf "text-align: %s" .) | safeHTMLAttr }}
+ {{- end -}}
+ >
{{- .Text -}}
</td>
{{- end }}
{{< code-toggle file=hugo >}}
[services.googleAnalytics]
-ID = "G-MEASUREMENT_ID"
+id = "G-MEASUREMENT_ID"
{{</ code-toggle >}}
To use this value in your own template, access the configured ID with `{{ site.Config.Services.GoogleAnalytics.ID }}`.
You can split a template action over two or more lines. For example, these are equivalent:
```go-html-template
-{{ $v := or .Site.Language.LanguageName .Site.Language.Lang }}
+{{ $v := or $arg1 $arg2 }}
{{ $v := or
- .Site.Language.LanguageName
- .Site.Language.Lang
+ $arg1
+ $arg2
}}
```
These are just a few of the questions most frequently asked by new users.
-###### An error message indicates that a feature is not available. Why?
+###### An error message indicates that a feature is not available. Why? {#feature-not-available}
-Hugo is available in two editions: standard and extended. With the extended edition you can (a) encode to the WebP format when processing images, and (b) transpile Sass to CSS using the embedded LibSass transpiler. The extended edition is not required to use the Dart Sass transpiler.
+{{% include "installation/_common/01-editions.md" %}}
-When you attempt to perform either of the operations above with the standard edition, Hugo throws this error:
+When you attempt to use a feature that is not available in the edition that you installed, Hugo throws this error:
```go-html-template
-Error: this feature is not available in your current Hugo version
+this feature is not available in this edition of Hugo
```
-To resolve, uninstall the standard edition, then install the extended edition. See the [installation] section for details.
+To resolve, install a different edition based on the feature table above. See the [installation] section for details.
###### Why do I see "Page Not Found" when visiting the home page?
[branch bundle]: /getting-started/glossary/#branch-bundle
[leaf bundle]: /getting-started/glossary/#leaf-bundle
-###### Why is my partial template not rendered as expected? {#foo}
+###### Why is my partial template not rendered as expected?
You may have neglected to pass the required [context] when calling the partial. For example:
###### Which page methods trigger content rendering?
-The following methods on a `Page` object trigger content rendering: `Content`, `FuzzyWordCount`, `Len`, `Plain`, `PlainWords`, `ReadingTime`, `Summary`, `Truncated`, and `WordCount`.
+The following methods on a `Page` object trigger content rendering: `Content`, `ContentWithoutSummary`, `FuzzyWordCount`, `Len`, `Plain`, `PlainWords`, `ReadingTime`, `Summary`, `Truncated`, and `WordCount`.
{{% note %}}
For other questions please visit the [forum]. A quick search of over 20,000 topics will often answer your question. Please be sure to read about [requesting help] before asking your first question.
'render-codeblock-goat' = '_default/_markup/render-codeblock-goat.html'
# Shortcodes
+'comment' = 'shortcodes/comment.html'
'figure' = 'shortcodes/figure.html'
'gist' = 'shortcodes/gist.html'
'highlight' = 'shortcodes/highlight.html'
go 1.16
-require github.com/gohugoio/gohugoioTheme v0.0.0-20240815082608-66ccd383a90f // indirect
+require github.com/gohugoio/gohugoioTheme v0.0.0-20241105120803-6c6e5fb8f8af // indirect
-github.com/gohugoio/gohugoioTheme v0.0.0-20240426212330-f38e99e0d88d h1:EaFz80Aqh3Ej20VmUSNe3K+F0NbT8UueXLP/VqkK9Dw=
-github.com/gohugoio/gohugoioTheme v0.0.0-20240426212330-f38e99e0d88d/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
-github.com/gohugoio/gohugoioTheme v0.0.0-20240508091825-b23e8e2d2419 h1:cQ/44eDHK0tVImTtSx/9sWWZv+RynH/oB4R7ASbQNAE=
-github.com/gohugoio/gohugoioTheme v0.0.0-20240508091825-b23e8e2d2419/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
-github.com/gohugoio/gohugoioTheme v0.0.0-20240619093131-b595d5fb8c52 h1:dPJxUU4SevIZ7OS1DIVOrJ7p8I/QM00pXGRfAtKgQmU=
-github.com/gohugoio/gohugoioTheme v0.0.0-20240619093131-b595d5fb8c52/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
-github.com/gohugoio/gohugoioTheme v0.0.0-20240622143740-53a4bdb8c0fb h1:gOIE1eFXILxCio/QOm3oLYcYmsis2CD099dXbXpjprA=
-github.com/gohugoio/gohugoioTheme v0.0.0-20240622143740-53a4bdb8c0fb/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
-github.com/gohugoio/gohugoioTheme v0.0.0-20240623150114-cc7096eab3fd h1:I8X7c0oBRWXy83BL2ODSk7v0xPXDnp2hcFWpCcN+Kyc=
-github.com/gohugoio/gohugoioTheme v0.0.0-20240623150114-cc7096eab3fd/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
-github.com/gohugoio/gohugoioTheme v0.0.0-20240728210410-d42c342ce472 h1:AYZUibKKFRBp2VCQpDHW+JmQKvCvyhX7z7/SOLUSCcw=
-github.com/gohugoio/gohugoioTheme v0.0.0-20240728210410-d42c342ce472/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
-github.com/gohugoio/gohugoioTheme v0.0.0-20240812175901-cc0ef8e4a14a h1:E3JbZo69eqFBz6B+meQlKyy/ZBZQ73ldVDw8TADiIrQ=
-github.com/gohugoio/gohugoioTheme v0.0.0-20240812175901-cc0ef8e4a14a/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
-github.com/gohugoio/gohugoioTheme v0.0.0-20240815082608-66ccd383a90f h1:Eo5z3uUYfmrtIxQvHm388dFOERZwWGTjLuUO6vobzLc=
-github.com/gohugoio/gohugoioTheme v0.0.0-20240815082608-66ccd383a90f/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
+github.com/gohugoio/gohugoioTheme v0.0.0-20241105040910-e9dac9458255 h1:kaSc7cVAifWPRzmECr7il0YXgXBM+H2ZrGcNnb03S8k=
+github.com/gohugoio/gohugoioTheme v0.0.0-20241105040910-e9dac9458255/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
+github.com/gohugoio/gohugoioTheme v0.0.0-20241105120803-6c6e5fb8f8af h1:H8Oa4AEJs2yz8w1Gq9hEGBJNukkKo05OAaIEsHMd63k=
+github.com/gohugoio/gohugoioTheme v0.0.0-20241105120803-6c6e5fb8f8af/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
+++ /dev/null
-{{- /*
-Renders the given image using the given filter, if any.
-
-@param {string} src The path to the image which must be a remote, page, or global resource.
-@param {string} [filter] The filter to apply to the image (case-insensitive).
-@param {string} [filterArgs] A comma-delimited list of arguments to pass to the filter.
-@param {bool} [example=false] If true, renders a before/after example.
-@param {int} [exampleWidth=384] Image width, in pixels, when rendering a before/after example.
-
-@returns {template.HTML}
-
-@examples
-
- {{< img src="zion-national-park.jpg" >}}
-
- {{< img src="zion-national-park.jpg" alt="Zion National Park" >}}
-
- {{< img
- src="zion-national-park.jpg"
- alt="Zion National Park"
- filter="grayscale"
- >}}
-
- {{< img
- src="zion-national-park.jpg"
- alt="Zion National Park"
- filter="process"
- filterArgs="resize 400x webp"
- >}}
-
- {{< img
- src="zion-national-park.jpg"
- alt="Zion National Park"
- filter="colorize"
- filterArgs="180,50,20"
- >}}
-
- {{< img
- src="zion-national-park.jpg"
- alt="Zion National Park"
- filter="grayscale"
- example=true
- >}}
-
- {{< img
- src="zion-national-park.jpg"
- alt="Zion National Park"
- filter="grayscale"
- example=true
- exampleWidth=400
- >}}
-
- When using the text filter, provide the arguments in this order:
-
- 0. The text
- 1. The horizontal offset, in pixels, relative to the left of the image (default 20)
- 2. The vertical offset, in pixels, relative to the top of the image (default 20)
- 3. The font size in pixels (default 64)
- 4. The line height (default 1.2)
- 5. The font color (default #ffffff)
-
- {{< img
- src="images/examples/zion-national-park.jpg"
- alt="Zion National Park"
- filter="Text"
- filterArgs="Zion National Park,25,250,56"
- example=true
- >}}
-
- When using the padding filter, provide all arguments in this order:
-
- 0. Padding top
- 1. Padding right
- 2. Padding bottom
- 3. Padding right
- 4. Canvas color
-
- {{< img
- src="images/examples/zion-national-park.jpg"
- alt="Zion National Park"
- filter="Padding"
- filterArgs="20,50,20,50,#0705"
- example=true
- >}}
-
-*/}}
-
-{{- /* Initialize. */}}
-{{- $alt := "" }}
-{{- $src := "" }}
-{{- $filter := "" }}
-{{- $filterArgs := slice }}
-{{- $example := false }}
-{{- $exampleWidth := 384 }}
-
-{{- /* Default values to use with the text filter. */}}
-{{ $textFilterOpts := dict
- "xOffset" 20
- "yOffset" 20
- "fontSize" 64
- "lineHeight" 1.2
- "fontColor" "#ffffff"
- "fontPath" "https://github.com/google/fonts/raw/main/ofl/lato/Lato-Regular.ttf"
-}}
-
-{{- /* Get and validate parameters. */}}
-{{- with .Get "alt" }}
- {{- $alt = .}}
-{{- end }}
-
-{{- with .Get "src" }}
- {{- $src = . }}
-{{- else }}
- {{- errorf "The %q shortcode requires a file parameter. See %s" .Name .Position }}
-{{- end }}
-
-{{- with .Get "filter" }}
- {{- $filter = . | lower }}
-{{- end }}
-
-{{- $validFilters := slice
- "autoorient" "brightness" "colorbalance" "colorize" "contrast" "dither"
- "gamma" "gaussianblur" "grayscale" "hue" "invert" "none" "opacity" "overlay"
- "padding" "pixelate" "process" "saturation" "sepia" "sigmoid" "text"
- "unsharpmask"
-}}
-
-{{- with $filter }}
- {{- if not (in $validFilters .) }}
- {{- errorf "The filter passed to the %q shortcode is invalid. The filter must be one of %s. See %s" $.Name (delimit $validFilters ", " ", or ") $.Position }}
- {{- end }}
-{{- end }}
-
-{{- with .Get "filterArgs" }}
- {{- $filterArgs = split . "," }}
- {{- $filterArgs = apply $filterArgs "trim" "." " " }}
-{{- end }}
-
-{{- if in (slice "false" false 0) (.Get "example") }}
- {{- $example = false }}
-{{- else if in (slice "true" true 1) (.Get "example")}}
- {{- $example = true }}
-{{- end }}
-
-{{- with .Get "exampleWidth" }}
- {{- $exampleWidth = . | int }}
-{{- end }}
-
-{{- /* Get image. */}}
-{{- $ctx := dict "page" .Page "src" $src "name" .Name "position" .Position }}
-{{- $i := partial "inline/get-resource.html" $ctx }}
-
-{{- /* Resize if rendering before/after examples. */}}
-{{- if $example }}
- {{- $i = $i.Resize (printf "%dx" $exampleWidth) }}
-{{- end }}
-
-{{- /* Create filter. */}}
-{{- $f := "" }}
-{{- $ctx := dict "filter" $filter "args" $filterArgs "name" .Name "position" .Position }}
-{{- if eq $filter "autoorient" }}
- {{- $ctx = merge $ctx (dict "argsRequired" 0) }}
- {{- template "validate-arg-count" $ctx }}
- {{- $f = images.AutoOrient }}
-{{- else if eq $filter "brightness" }}
- {{- $ctx = merge $ctx (dict "argsRequired" 1) }}
- {{- template "validate-arg-count" $ctx }}
- {{- $filterArgs = apply $filterArgs "float" "." }}
- {{- $ctx = merge $ctx (dict "argName" "percentage" "argValue" (index $filterArgs 0) "min" -100 "max" 100) }}
- {{- template "validate-arg-value" $ctx }}
- {{- $f = images.Brightness (index $filterArgs 0) }}
-{{- else if eq $filter "colorbalance" }}
- {{- $ctx = merge $ctx (dict "argsRequired" 3) }}
- {{- template "validate-arg-count" $ctx }}
- {{- $filterArgs = apply $filterArgs "float" "." }}
- {{- $ctx = merge $ctx (dict "argName" "percentage red" "argValue" (index $filterArgs 0) "min" -100 "max" 500) }}
- {{- template "validate-arg-value" $ctx }}
- {{- $ctx = merge $ctx (dict "argName" "percentage green" "argValue" (index $filterArgs 1) "min" -100 "max" 500) }}
- {{- template "validate-arg-value" $ctx }}
- {{- $ctx = merge $ctx (dict "argName" "percentage blue" "argValue" (index $filterArgs 2) "min" -100 "max" 500) }}
- {{- template "validate-arg-value" $ctx }}
- {{- $f = images.ColorBalance (index $filterArgs 0) (index $filterArgs 1) (index $filterArgs 2) }}
-{{- else if eq $filter "colorize" }}
- {{- $ctx = merge $ctx (dict "argsRequired" 3) }}
- {{- template "validate-arg-count" $ctx }}
- {{- $filterArgs = apply $filterArgs "float" "." }}
- {{- $ctx = merge $ctx (dict "argName" "hue" "argValue" (index $filterArgs 0) "min" 0 "max" 360) }}
- {{- template "validate-arg-value" $ctx }}
- {{- $ctx = merge $ctx (dict "argName" "saturation" "argValue" (index $filterArgs 1) "min" 0 "max" 100) }}
- {{- template "validate-arg-value" $ctx }}
- {{- $ctx = merge $ctx (dict "argName" "percentage" "argValue" (index $filterArgs 2) "min" 0 "max" 100) }}
- {{- template "validate-arg-value" $ctx }}
- {{- $f = images.Colorize (index $filterArgs 0) (index $filterArgs 1) (index $filterArgs 2) }}
-{{- else if eq $filter "contrast" }}
- {{- $ctx = merge $ctx (dict "argsRequired" 1) }}
- {{- template "validate-arg-count" $ctx }}
- {{- $filterArgs = apply $filterArgs "float" "." }}
- {{- $ctx = merge $ctx (dict "argName" "percentage" "argValue" (index $filterArgs 0) "min" -100 "max" 100) }}
- {{- template "validate-arg-value" $ctx }}
- {{- $f = images.Contrast (index $filterArgs 0) }}
-{{- else if eq $filter "dither" }}
- {{- $f = images.Dither }}
-{{- else if eq $filter "gamma" }}
- {{- $ctx = merge $ctx (dict "argsRequired" 1) }}
- {{- template "validate-arg-count" $ctx }}
- {{- $filterArgs = apply $filterArgs "float" "." }}
- {{- $ctx = merge $ctx (dict "argName" "gamma" "argValue" (index $filterArgs 0) "min" 0 "max" 100) }}
- {{- template "validate-arg-value" $ctx }}
- {{- $f = images.Gamma (index $filterArgs 0) }}
-{{- else if eq $filter "gaussianblur" }}
- {{- $ctx = merge $ctx (dict "argsRequired" 1) }}
- {{- template "validate-arg-count" $ctx }}
- {{- $filterArgs = apply $filterArgs "float" "." }}
- {{- $ctx = merge $ctx (dict "argName" "sigma" "argValue" (index $filterArgs 0) "min" 0 "max" 1000) }}
- {{- template "validate-arg-value" $ctx }}
- {{- $f = images.GaussianBlur (index $filterArgs 0) }}
-{{- else if eq $filter "grayscale" }}
- {{- $ctx = merge $ctx (dict "argsRequired" 0) }}
- {{- template "validate-arg-count" $ctx }}
- {{- $f = images.Grayscale }}
-{{- else if eq $filter "hue" }}
- {{- $ctx = merge $ctx (dict "argsRequired" 1) }}
- {{- template "validate-arg-count" $ctx }}
- {{- $filterArgs = apply $filterArgs "float" "." }}
- {{- $ctx = merge $ctx (dict "argName" "shift" "argValue" (index $filterArgs 0) "min" -180 "max" 180) }}
- {{- template "validate-arg-value" $ctx }}
- {{- $f = images.Hue (index $filterArgs 0) }}
-{{- else if eq $filter "invert" }}
- {{- $ctx = merge $ctx (dict "argsRequired" 0) }}
- {{- template "validate-arg-count" $ctx }}
- {{- $f = images.Invert }}
-{{- else if eq $filter "opacity" }}
- {{- $ctx = merge $ctx (dict "argsRequired" 1) }}
- {{- template "validate-arg-count" $ctx }}
- {{- $filterArgs = apply $filterArgs "float" "." }}
- {{- $ctx = merge $ctx (dict "argName" "opacity" "argValue" (index $filterArgs 0) "min" 0 "max" 1) }}
- {{- template "validate-arg-value" $ctx }}
- {{- $f = images.Opacity (index $filterArgs 0) }}
-{{- else if eq $filter "overlay" }}
- {{- $ctx = merge $ctx (dict "argsRequired" 3) }}
- {{- template "validate-arg-count" $ctx }}
- {{- $ctx := dict "src" (index $filterArgs 0) "name" .Name "position" .Position }}
- {{- $overlayImg := partial "inline/get-resource.html" $ctx }}
- {{- $f = images.Overlay $overlayImg (index $filterArgs 1 | float ) (index $filterArgs 2 | float) }}
-{{- else if eq $filter "padding" }}
- {{- $ctx = merge $ctx (dict "argsRequired" 5) }}
- {{- template "validate-arg-count" $ctx }}
- {{- $f = images.Padding
- (index $filterArgs 0 | int)
- (index $filterArgs 1 | int)
- (index $filterArgs 2 | int)
- (index $filterArgs 3 | int)
- (index $filterArgs 4)
- }}
-{{- else if eq $filter "pixelate" }}
- {{- $ctx = merge $ctx (dict "argsRequired" 1) }}
- {{- template "validate-arg-count" $ctx }}
- {{- $filterArgs = apply $filterArgs "float" "." }}
- {{- $ctx = merge $ctx (dict "argName" "size" "argValue" (index $filterArgs 0) "min" 0 "max" 1000) }}
- {{- template "validate-arg-value" $ctx }}
- {{- $f = images.Pixelate (index $filterArgs 0) }}
-{{- else if eq $filter "process" }}
- {{- $ctx = merge $ctx (dict "argsRequired" 1) }}
- {{- template "validate-arg-count" $ctx }}
- {{- $f = images.Process (index $filterArgs 0) }}
-{{- else if eq $filter "saturation" }}
- {{- $ctx = merge $ctx (dict "argsRequired" 1) }}
- {{- template "validate-arg-count" $ctx }}
- {{- $filterArgs = apply $filterArgs "float" "." }}
- {{- $ctx = merge $ctx (dict "argName" "percentage" "argValue" (index $filterArgs 0) "min" -100 "max" 500) }}
- {{- template "validate-arg-value" $ctx }}
- {{- $f = images.Saturation (index $filterArgs 0) }}
-{{- else if eq $filter "sepia" }}
- {{- $ctx = merge $ctx (dict "argsRequired" 1) }}
- {{- template "validate-arg-count" $ctx }}
- {{- $filterArgs = apply $filterArgs "float" "." }}
- {{- $ctx = merge $ctx (dict "argName" "percentage" "argValue" (index $filterArgs 0) "min" 0 "max" 100) }}
- {{- template "validate-arg-value" $ctx }}
- {{- $f = images.Sepia (index $filterArgs 0) }}
-{{- else if eq $filter "sigmoid" }}
- {{- $ctx = merge $ctx (dict "argsRequired" 2) }}
- {{- template "validate-arg-count" $ctx }}
- {{- $filterArgs = apply $filterArgs "float" "." }}
- {{- $ctx = merge $ctx (dict "argName" "midpoint" "argValue" (index $filterArgs 0) "min" 0 "max" 1) }}
- {{- template "validate-arg-value" $ctx }}
- {{- $ctx = merge $ctx (dict "argName" "factor" "argValue" (index $filterArgs 1) "min" -10 "max" 10) }}
- {{- template "validate-arg-value" $ctx }}
- {{- $f = images.Sigmoid (index $filterArgs 0) (index $filterArgs 1) }}
-{{- else if eq $filter "text" }}
- {{- $ctx = merge $ctx (dict "argsRequired" 1) }}
- {{- template "validate-arg-count" $ctx }}
- {{- $ctx := dict "src" $textFilterOpts.fontPath "name" .Name "position" .Position }}
- {{- $font := or (partial "inline/get-resource.html" $ctx) }}
- {{- $fontSize := or (index $filterArgs 3 | int) $textFilterOpts.fontSize }}
- {{- $lineHeight := math.Max (or (index $filterArgs 4 | float) $textFilterOpts.lineHeight) 1 }}
- {{- $opts := dict
- "x" (or (index $filterArgs 1 | int) $textFilterOpts.xOffset)
- "y" (or (index $filterArgs 2 | int) $textFilterOpts.yOffset)
- "size" $fontSize
- "linespacing" (mul (sub $lineHeight 1) $fontSize)
- "color" (or (index $filterArgs 5) $textFilterOpts.fontColor)
- "font" $font
- }}
- {{- $f = images.Text (index $filterArgs 0) $opts }}
-{{- else if eq $filter "unsharpmask" }}
- {{- $ctx = merge $ctx (dict "argsRequired" 3) }}
- {{- template "validate-arg-count" $ctx }}
- {{- $filterArgs = apply $filterArgs "float" "." }}
- {{- $ctx = merge $ctx (dict "argName" "sigma" "argValue" (index $filterArgs 0) "min" 0 "max" 500) }}
- {{- template "validate-arg-value" $ctx }}
- {{- $ctx = merge $ctx (dict "argName" "amount" "argValue" (index $filterArgs 1) "min" 0 "max" 100) }}
- {{- template "validate-arg-value" $ctx }}
- {{- $ctx = merge $ctx (dict "argName" "threshold" "argValue" (index $filterArgs 2) "min" 0 "max" 1) }}
- {{- template "validate-arg-value" $ctx }}
- {{- $f = images.UnsharpMask (index $filterArgs 0) (index $filterArgs 1) (index $filterArgs 2) }}
-{{- end }}
-
-{{- /* Apply filter. */}}
-{{- $fi := $i }}
-{{- with $f }}
- {{- $fi = $i.Filter . }}
-{{- end }}
-
-{{- /* Render. */}}
-{{- if $example }}
- <p>Original</p>
- <img class='di ba b--black-20' style="width: initial;" src="{{ $i.RelPermalink }}" alt="{{ $alt }}">
- <p>Processed</p>
- <img class='di ba b--black-20' style="width: initial;" src="{{ $fi.RelPermalink }}" alt="{{ $alt }}">
-{{- else -}}
- <img class='di' style="width: initial;" src="{{ $fi.RelPermalink }}" alt="{{ $alt }}">
-{{- end }}
-
-{{- define "validate-arg-count" }}
- {{- $msg := "When using the %q filter, the %q shortcode requires an args parameter with %d %s. See %s" }}
- {{- if lt (len .args) .argsRequired }}
- {{- $text := "values" }}
- {{- if eq 1 .argsRequired }}
- {{- $text = "value" }}
- {{- end }}
- {{- errorf $msg .filter .name .argsRequired $text .position }}
- {{- end }}
-{{- end }}
-
-{{- define "validate-arg-value" }}
- {{- $msg := "The %q argument passed to the %q shortcode is invalid. Expected a value in the range [%v,%v], but received %v. See %s" }}
- {{- if or (lt .argValue .min) (gt .argValue .max) }}
- {{- errorf $msg .argName .name .min .max .argValue .position }}
- {{- end }}
-{{- end }}
-
-{{- define "partials/inline/get-resource.html" }}
- {{- $r := "" }}
- {{- $u := urls.Parse .src }}
- {{- $msg := "The %q shortcode was unable to resolve %s. See %s" }}
- {{- if $u.IsAbs }}
- {{- with resources.GetRemote $u.String }}
- {{- with .Err }}
- {{- errorf "%s" }}
- {{- else }}
- {{- /* This is a remote resource. */}}
- {{- $r = . }}
- {{- end }}
- {{- else }}
- {{- errorf $msg $.name $u.String $.position }}
- {{- end }}
- {{- else }}
- {{- with .page.Resources.Get (strings.TrimPrefix "./" $u.Path) }}
- {{- /* This is a page resource. */}}
- {{- $r = . }}
- {{- else }}
- {{- with resources.Get $u.Path }}
- {{- /* This is a global resource. */}}
- {{- $r = . }}
- {{- else }}
- {{- errorf $msg $.name $u.Path $.position }}
- {{- end }}
- {{- end }}
- {{- end }}
- {{- return $r}}
-{{- end -}}
command = "hugo --gc --minify"
[build.environment]
- HUGO_VERSION = "0.134.0"
+ HUGO_VERSION = "0.138.0"
[context.production.environment]
HUGO_ENV = "production"