mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Squashed 'docs/' changes from 2c0125b52..1214f6ffb
1214f6ffb Document cleanDestinationDir configuration setting 27ca65463 Clarify .Page.Param method (#1953) 3fa1792d2 Document the usage of `hardWrap` option for markdown rendering (#1951) 8b5afdfb4 Update theme 207e7f0a0 fix docs for getting remote font 1f7094b9e Correct typo f9d6445c4 Added missing `/` in URL generator (#1946) 3a22ee7d6 Remove translations b3b900f3f Update introduction.md aca440052 rm Forestry - facing end-of-life shortly (#1944) af0014e14 Update scss-sass.md 1c43bbbc9 Merge branch 'docs/goworkspace' d034175ca netlify: Hugo 0.109.0 d3a6a5c3f Merge branch 'tempv0.109.0' e033dbead docs: Regen docs helper JSON 452bf675c resource/page: Add Page.Ancestors 12edd7363 Add some docs for workspaces 8f0fcba6b Add HUGO_PUBLISHDIR to the Node environment 4e66d98ad Update theme 808aee6f6 config: Update to ga v4 1de2bc5a9 config: Update to ga v4 ddb5fd6b0 Merge commit '41bc6f702aa54200530efbf4267e5c823df3028d' 54c54bf76 modules: Adjust watch logic vs workspace use definitions git-subtree-dir: docs git-subtree-split: 1214f6ffbf680e853746aaeb6cb097b28c0c556b
This commit is contained in:
parent
41bc6f702a
commit
ef6f101e75
35 changed files with 350 additions and 657 deletions
|
@ -19,6 +19,15 @@ Spelling fixes are most welcomed, and if you want to contribute longer sections
|
|||
* For example, try to find short snippets that teaches people about the concept. If the example is also useful as-is (copy and paste), then great. Don't list long and similar examples just so people can use them on their sites.
|
||||
* Hugo has users from all over the world, so easy to understand and [simple English](https://simple.wikipedia.org/wiki/Basic_English) is good.
|
||||
|
||||
|
||||
## Edit the theme
|
||||
|
||||
If you want to do docs-related theme changes, the simplest way is to have both `hugoDocs` and `gohugoioTheme` cloned as sibling directories, and then run:
|
||||
|
||||
```
|
||||
HUGO_MODULE_WORKSPACE=hugo.work hugo server --ignoreVendorPaths "**"
|
||||
```
|
||||
|
||||
## Branches
|
||||
|
||||
* The `master` branch is where the site is automatically built from, and is the place to put changes relevant to the current Hugo version.
|
||||
|
|
|
@ -4,12 +4,6 @@
|
|||
logo = "/images/sponsors/linode-logo_standard_light_medium.png"
|
||||
utm_campaign = "hugosponsor"
|
||||
|
||||
[[banners]]
|
||||
name = "eSolia"
|
||||
link = "https://esolia.com/post/why-did-esolia-choose-hugo/"
|
||||
logo = "/images/sponsors/esolia-logo.svg"
|
||||
utm_campaign = "hugosponsor"
|
||||
|
||||
[[banners]]
|
||||
name = "ButterCMS"
|
||||
link = "https://buttercms.com/hugo-cms/"
|
||||
|
@ -17,6 +11,13 @@
|
|||
utm_campaign = "sponsorship"
|
||||
bgcolor = "#131A3E"
|
||||
|
||||
[[banners]]
|
||||
name = "Your Company?"
|
||||
link = "https://bep.is/en/hugo-sponsor-2023-01/"
|
||||
logo = "/images/sponsors/your-company.svg"
|
||||
utm_campaign = "hugosponsor"
|
||||
bgcolor = "#004887"
|
||||
|
||||
#hugohome
|
||||
#hugofooter
|
||||
#hugogithub
|
||||
|
|
|
@ -1,75 +1,119 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="no-js" lang="{{ with $.Site.LanguageCode }}{{ . }}{{ else }}en-us{{ end }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
{{/* https://www.zachleat.com/web/preload/ */}}
|
||||
<link rel="preload" href="{{ "fonts/muli-latin-200.woff2" | absURL }}" as="font" type="font/woff2" crossorigin>
|
||||
<link rel="preload" href="{{ "fonts/muli-latin-400.woff2" | absURL }}" as="font" type="font/woff2" crossorigin>
|
||||
<link rel="preload" href="{{ "fonts/muli-latin-800.woff2" | absURL }}" as="font" type="font/woff2" crossorigin>
|
||||
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
{{/* NOTE: the Site's title, and if there is a page title, that is set too */}}
|
||||
<title>{{ block "title" . }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{ end }}</title>
|
||||
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1">
|
||||
{{ hugo.Generator }}
|
||||
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
|
||||
<meta name="robots" content="index, follow">
|
||||
<html
|
||||
class="no-js"
|
||||
lang="{{ with $.Site.LanguageCode }}
|
||||
{{ . }}
|
||||
{{ else }}
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
en-us
|
||||
{{ end }}
|
||||
">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
{{/* https://www.zachleat.com/web/preload/ */}}
|
||||
<link
|
||||
rel="preload"
|
||||
href="{{ "fonts/muli-latin-200.woff2" | absURL }}"
|
||||
as="font"
|
||||
type="font/woff2"
|
||||
crossorigin />
|
||||
<link
|
||||
rel="preload"
|
||||
href="{{ "fonts/muli-latin-400.woff2" | absURL }}"
|
||||
as="font"
|
||||
type="font/woff2"
|
||||
crossorigin />
|
||||
<link
|
||||
rel="preload"
|
||||
href="{{ "fonts/muli-latin-800.woff2" | absURL }}"
|
||||
as="font"
|
||||
type="font/woff2"
|
||||
crossorigin />
|
||||
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
|
||||
{{ end -}}
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
{{/* NOTE: the Site's title, and if there is a page title, that is set too */}}
|
||||
<title>
|
||||
{{ block "title" . }}
|
||||
{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}
|
||||
{{ end }}
|
||||
|
||||
{{ $isDev := eq hugo.Environment "development" }}
|
||||
{{ $stylesheet := resources.Get "output/css/app.css" }}
|
||||
{{ if not $isDev }}
|
||||
{{ $stylesheet = $stylesheet | minify | fingerprint }}
|
||||
{{ end }}
|
||||
{{ with $stylesheet }}
|
||||
{{ if $isDev }}
|
||||
<link rel="stylesheet" href="{{ .RelPermalink }}" crossorigin="anonymous">
|
||||
{{ else }}
|
||||
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
|
||||
{{ end }}
|
||||
{{ $.Scratch.Set "stylesheet" . }}
|
||||
{{end}}
|
||||
</title>
|
||||
|
||||
<meta name="description"
|
||||
content="{{ with .Description }}{{ . }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1" />
|
||||
{{ hugo.Generator }}
|
||||
|
||||
{{ block "scripts" . }}
|
||||
{{- partial "site-scripts.html" . -}}
|
||||
{{ end }}
|
||||
{{ partial "site-manifest.html" . }}
|
||||
{{- partial "head-additions.html" . -}}
|
||||
{{- partial "opengraph/opengraph.html" . -}}
|
||||
{{- template "_internal/schema.html" . -}}
|
||||
{{- partial "opengraph/twitter_cards.html" . -}}
|
||||
{{ if hugo.IsProduction }}
|
||||
<meta name="robots" content="index, follow" />
|
||||
{{ else }}
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
{{ end }}
|
||||
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
|
||||
{{ partial "gtag" . }}
|
||||
{{ end }}
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
<link
|
||||
rel="{{ .Rel }}"
|
||||
type="{{ .MediaType.Type }}"
|
||||
href="{{ .Permalink | safeURL }}" />
|
||||
{{ end -}}
|
||||
|
||||
</head>
|
||||
{{ $isDev := eq hugo.Environment "development" }}
|
||||
{{ $stylesheet := resources.Get "output/css/app.css" }}
|
||||
{{ if not $isDev }}
|
||||
{{ $stylesheet = $stylesheet | minify | fingerprint }}
|
||||
{{ end }}
|
||||
{{ with $stylesheet }}
|
||||
{{ if $isDev }}
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{ .RelPermalink }}"
|
||||
crossorigin="anonymous" />
|
||||
{{ else }}
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{ .RelPermalink }}"
|
||||
integrity="{{ .Data.Integrity }}"
|
||||
crossorigin="anonymous" />
|
||||
{{ end }}
|
||||
{{ $.Scratch.Set "stylesheet" . }}
|
||||
{{ end }}
|
||||
|
||||
<body class="ma0 sans-serif bg-primary-color-light{{ with getenv "HUGO_ENV" }} {{ . }}{{ end }}">
|
||||
{{ partial "hooks/after-body-start" . }}
|
||||
{{ block "nav" . }}{{ partial "site-nav.html" . }}{{ end }}
|
||||
{{ block "header" . }}{{ end }}
|
||||
<main role="main" class="content-with-sidebar min-vh-100 pb7 pb0-ns">
|
||||
{{ block "main" . }}{{ end }}
|
||||
</main>
|
||||
|
||||
{{ block "footer" . }}{{ partialCached "site-footer.html" . }}{{ end }}
|
||||
|
||||
{{ partial "hooks/before-body-end" . }}
|
||||
|
||||
<meta
|
||||
name="description"
|
||||
content="{{ with .Description }}
|
||||
{{ . }}
|
||||
{{ else }}
|
||||
{{ with .Site.Params.description }}{{ . }}{{ end }}
|
||||
{{ end }}
|
||||
" />
|
||||
|
||||
</body>
|
||||
{{ block "scripts" . }}
|
||||
{{- partial "site-scripts.html" . -}}
|
||||
{{ end }}
|
||||
{{ partial "site-manifest.html" . }}
|
||||
{{- partial "head-additions.html" . -}}
|
||||
{{- partial "opengraph/opengraph.html" . -}}
|
||||
{{- template "_internal/schema.html" . -}}
|
||||
{{- partial "opengraph/twitter_cards.html" . -}}
|
||||
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ partial "gtag" . }}
|
||||
{{ end }}
|
||||
|
||||
</head>
|
||||
|
||||
<body
|
||||
class="ma0 sans-serif bg-primary-color-light{{ with getenv "HUGO_ENV" }}
|
||||
{{ . }}
|
||||
{{ end }}">
|
||||
{{ partial "hooks/after-body-start" . }}
|
||||
{{ block "nav" . }}{{ partial "site-nav.html" . }}{{ end }}
|
||||
{{ block "header" . }}{{ end }}
|
||||
<main role="main" class="content-with-sidebar min-vh-100 pb7 pb0-ns">
|
||||
{{ block "main" . }}{{ end }}
|
||||
</main>
|
||||
|
||||
{{ block "footer" . }}{{ partialCached "site-footer.html" . }}{{ end }}
|
||||
|
||||
{{ partial "hooks/before-body-end" . }}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1 +1 @@
|
|||
# github.com/gohugoio/gohugoioTheme v0.0.0-20221217122332-1c1752ad8f14
|
||||
# github.com/gohugoio/gohugoioTheme v0.0.0-20230109120406-12694c4a9456
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
baseURL = "https://gohugo.io/"
|
||||
defaultContentLanguage = "en"
|
||||
enableEmoji = true
|
||||
googleAnalytics = "UA-7131036-4"
|
||||
googleAnalytics = "G-MBZGKNMDWC"
|
||||
ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
|
||||
languageCode = "en-us"
|
||||
paginate = 100
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
|
||||
[en]
|
||||
contentDir = "content/en"
|
||||
languageName = "English"
|
||||
weight = 1
|
||||
|
||||
[zh]
|
||||
contentDir = "content/zh"
|
||||
languageName = "中文"
|
||||
weight = 2
|
||||
[en]
|
||||
contentDir = "content/en"
|
||||
languageName = "English"
|
||||
weight = 1
|
||||
|
|
|
@ -1,121 +0,0 @@
|
|||
|
||||
# Chinese menus
|
||||
|
||||
[[docs]]
|
||||
name = "关于 Hugo"
|
||||
weight = 1
|
||||
identifier = "about"
|
||||
url = "/zh/about/"
|
||||
|
||||
[[docs]]
|
||||
name = "入门"
|
||||
weight = 5
|
||||
identifier = "getting-started"
|
||||
url = "/zh/getting-started/"
|
||||
|
||||
[[docs]]
|
||||
name = "主题"
|
||||
weight = 15
|
||||
identifier = "themes"
|
||||
post = "break"
|
||||
url = "/zh/themes/"
|
||||
|
||||
# Core languages.zh.menus
|
||||
|
||||
[[docs]]
|
||||
name = "内容管理"
|
||||
weight = 20
|
||||
identifier = "content-management"
|
||||
post = "expanded"
|
||||
url = "/zh/content-management/"
|
||||
|
||||
[[docs]]
|
||||
name = "模板"
|
||||
weight = 25
|
||||
identifier = "templates"
|
||||
url = "/zh/templates/"
|
||||
|
||||
[[docs]]
|
||||
name = "函数"
|
||||
weight = 30
|
||||
identifier = "functions"
|
||||
url = "/zh/functions/"
|
||||
|
||||
[[docs]]
|
||||
name = "变量"
|
||||
weight = 35
|
||||
identifier = "variables"
|
||||
url = "/zh/variables/"
|
||||
|
||||
[[docs]]
|
||||
name = "CLI"
|
||||
weight = 40
|
||||
post = "break"
|
||||
identifier = "commands"
|
||||
url = "/commands/"
|
||||
|
||||
# LOW LEVEL ITEMS
|
||||
[[docs]]
|
||||
name = "故障排除"
|
||||
weight = 60
|
||||
identifier = "troubleshooting"
|
||||
url = "/zh/troubleshooting/"
|
||||
|
||||
[[docs]]
|
||||
name = "工具"
|
||||
weight = 70
|
||||
identifier = "tools"
|
||||
url = "/zh/tools/"
|
||||
|
||||
[[docs]]
|
||||
name = "托管与部署"
|
||||
weight = 80
|
||||
identifier = "hosting-and-deployment"
|
||||
url = "/zh/hosting-and-deployment/"
|
||||
|
||||
[[docs]]
|
||||
name = "贡献"
|
||||
weight = 100
|
||||
post = "break"
|
||||
identifier = "contribute"
|
||||
url = "/zh/contribute/"
|
||||
|
||||
[[global]]
|
||||
name = "新闻"
|
||||
weight = 1
|
||||
identifier = "news"
|
||||
url = "/zh/news/"
|
||||
|
||||
[[global]]
|
||||
name = "文档"
|
||||
weight = 5
|
||||
identifier = "docs"
|
||||
url = "/zh/documentation/"
|
||||
|
||||
[[global]]
|
||||
name = "主题"
|
||||
weight = 10
|
||||
identifier = "themes"
|
||||
url = "https://themes.gohugo.io/"
|
||||
|
||||
[[global]]
|
||||
name = "作品展示"
|
||||
weight = 20
|
||||
identifier = "showcase"
|
||||
url = "/zh/showcase/"
|
||||
|
||||
# Anything with a weight > 100 gets an external icon
|
||||
[[global]]
|
||||
name = "社区"
|
||||
weight = 150
|
||||
icon = true
|
||||
identifier = "community"
|
||||
post = "external"
|
||||
url = "https://discourse.gohugo.io/"
|
||||
|
||||
[[global]]
|
||||
name = "GitHub"
|
||||
weight = 200
|
||||
identifier = "github"
|
||||
post = "external"
|
||||
url = "https://github.com/gohugoio/hugo"
|
|
@ -63,19 +63,16 @@ If you need a specific template for a sub-section, you need to adjust either the
|
|||
With the available [section variables and methods](#section-page-variables-and-methods) you can build powerful navigation. One common example would be a partial to show Breadcrumb navigation:
|
||||
|
||||
{{< code file="layouts/partials/breadcrumb.html" download="breadcrumb.html" >}}
|
||||
<ol class="nav navbar-nav">
|
||||
{{ template "breadcrumbnav" (dict "p1" . "p2" .) }}
|
||||
</ol>
|
||||
{{ define "breadcrumbnav" }}
|
||||
{{ if .p1.Parent }}
|
||||
{{ template "breadcrumbnav" (dict "p1" .p1.Parent "p2" .p2 ) }}
|
||||
{{ else if not .p1.IsHome }}
|
||||
{{ template "breadcrumbnav" (dict "p1" .p1.Site.Home "p2" .p2 ) }}
|
||||
{{ end }}
|
||||
<li{{ if eq .p1 .p2 }} class="active" aria-current="page" {{ end }}>
|
||||
<a href="{{ .p1.Permalink }}">{{ .p1.Title }}</a>
|
||||
<ol class="nav navbar-nav">
|
||||
<ul>
|
||||
{{- range .Ancestors.Reverse }}
|
||||
<li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
|
||||
{{- end }}
|
||||
<li class="active" aria-current="page">
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</ol>
|
||||
{{< /code >}}
|
||||
|
||||
## Section Page Variables and Methods
|
||||
|
|
|
@ -60,7 +60,7 @@ You can load a custom font if needed. Load the font as a Hugo `Resource` and set
|
|||
|
||||
```go-html-template
|
||||
|
||||
{{ $font := resources.Get "https://github.com/google/fonts/raw/main/apache/roboto/static/Roboto-Black.ttf" }}
|
||||
{{ $font := resources.GetRemote "https://github.com/google/fonts/raw/main/apache/roboto/static/Roboto-Black.ttf" }}
|
||||
{{ $img := resources.Get "/images/background.png"}}
|
||||
{{ $img = $img.Filter (images.Text "Hugo rocks!" (dict
|
||||
"font" $font
|
||||
|
|
|
@ -1,40 +1,47 @@
|
|||
---
|
||||
title: .Param
|
||||
description: Calls page or site variables into your template.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-04-30
|
||||
keywords: ["front matter"]
|
||||
description: Returns a page parameter, falling back to a site parameter if present.
|
||||
signature: ['.Param KEY']
|
||||
categories: [functions]
|
||||
keywords: ['front matter', 'params']
|
||||
menu:
|
||||
docs:
|
||||
parent: "functions"
|
||||
toc:
|
||||
signature: [".Param KEY"]
|
||||
workson: []
|
||||
hugoversion:
|
||||
relatedfuncs: [default]
|
||||
deprecated: false
|
||||
draft: false
|
||||
parent: 'functions'
|
||||
aliases: []
|
||||
---
|
||||
|
||||
In Hugo, you can declare [site-wide params][sitevars] (i.e. in your [configuration]), as well as params for [individual pages][pagevars].
|
||||
The `.Param` method on `.Page` looks for the given `KEY` in page parameters, and returns the corresponding value. If it cannot find the `KEY` in page parameters, it looks for the `KEY` in site parameters. If it cannot find the `KEY` in either location, the `.Param` method returns `nil`.
|
||||
|
||||
A common use case is to have a general value for the site and a more specific value for some of the pages (e.g., an image).
|
||||
Site and theme developers commonly set parameters at the site level, allowing content authors to override those parameters at the page level.
|
||||
|
||||
You can use the `.Param` method to call these values into your template. The following will first look for an `image` param in a specific content's [front matter]. If not found, Hugo will look for an `image` param in your site's configuration:
|
||||
For example, to show a table of contents on every page, but allow authors to hide the table of contents as needed:
|
||||
|
||||
```
|
||||
$.Param "image"
|
||||
```
|
||||
**Configuration**
|
||||
|
||||
{{% note %}}
|
||||
The `Param` method may not consider empty strings in a content's front matter as "not found." If you are setting preconfigured front matter fields to empty strings using Hugo's archetypes, it may be best to use the [`default` function](/functions/default/) instead of `Param`. See the [related issue on GitHub](https://github.com/gohugoio/hugo/issues/3366).
|
||||
{{% /note %}}
|
||||
{{< code-toggle file="config" copy=false >}}
|
||||
[params]
|
||||
display_toc = true
|
||||
{{< /code-toggle >}}
|
||||
|
||||
**Content**
|
||||
|
||||
[configuration]: /getting-started/configuration/
|
||||
[front matter]: /content-management/front-matter/
|
||||
[pagevars]: /variables/page/
|
||||
[sitevars]: /variables/site/
|
||||
{{< code-toggle file="content/about.md" fm=true copy=false >}}
|
||||
title = 'About'
|
||||
date = 2023-01-01
|
||||
draft = false
|
||||
display_toc = false
|
||||
{{< /code-toggle >}}
|
||||
|
||||
**Template**
|
||||
|
||||
{{< code file="layouts/_default/single.html" copy="false" >}}
|
||||
{{ if .Param "display_toc" }}
|
||||
{{ .TableOfContents }}
|
||||
{{ end }}
|
||||
{{< /code >}}
|
||||
|
||||
The `.Param` method returns the value associated with the given `KEY`, regardless of whether the value is truthy or falsy. If you need to ignore falsy values, use this construct instead:
|
||||
|
||||
{{< code file="layouts/_default/single.html" copy="false" >}}
|
||||
{{ or .Params.foo site.Params.foo }}
|
||||
{{< /code >}}
|
||||
|
|
|
@ -32,6 +32,9 @@ For details on the extensions, refer to [this section](https://github.com/yuin/g
|
|||
|
||||
Some settings explained:
|
||||
|
||||
hardWrap
|
||||
: By default, Goldmark ignores newlines within a paragraph. Set to `true` to render newlines as `<br>` elements.
|
||||
|
||||
unsafe
|
||||
: By default, Goldmark does not render raw HTMLs and potentially dangerous links. If you have lots of inline HTML and/or JavaScript, you may need to turn this on.
|
||||
|
||||
|
|
|
@ -173,6 +173,12 @@ Pass down default configuration values (front matter) to pages in the content tr
|
|||
|
||||
Enable to turn relative URLs into absolute.
|
||||
|
||||
### cleanDestinationDir
|
||||
|
||||
**Default value:** false
|
||||
|
||||
When building, removes files from destination not found in static directories.
|
||||
|
||||
### contentDir
|
||||
|
||||
**Default value:** "content"
|
||||
|
@ -231,7 +237,7 @@ Disable automatic live reloading of browser window.
|
|||
|
||||
**Default value:** false
|
||||
|
||||
: Do not convert the url/path to lowercase.
|
||||
Do not convert the url/path to lowercase.
|
||||
|
||||
### enableEmoji
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@ hugo server --navigateToChanged
|
|||
As noted above, Hugo does not clear the public directory before building your site. Manually clear the contents of the public directory before each build to remove draft, expired, and future content.
|
||||
{{% /note %}}
|
||||
|
||||
When are ready to deploy your site, run:
|
||||
When you are ready to deploy your site, run:
|
||||
|
||||
```bash
|
||||
hugo
|
||||
|
|
|
@ -23,7 +23,7 @@ proxy = "direct"
|
|||
noProxy = "none"
|
||||
private = "*.*"
|
||||
replacements = ""
|
||||
workspace = ""
|
||||
workspace = "off"
|
||||
{{< /code-toggle >}}
|
||||
|
||||
noVendor
|
||||
|
@ -42,7 +42,7 @@ private
|
|||
: Comma separated glob list matching paths that should be treated as private.
|
||||
|
||||
workspace
|
||||
: The workspace file to use. This enables Go workspace mode. Note that this can also be set via OS env, e.g. `export HUGO_MODULE_WORKSPACE=/my/hugo.work` This only works with Go 1.18+.
|
||||
: The workspace file to use. This enables Go workspace mode. Note that this can also be set via OS env, e.g. `export HUGO_MODULE_WORKSPACE=/my/hugo.work` This only works with Go 1.18+. In Hugo `v0.109.0` we changed the default to `off` and we now resolve any relative work filenames relative to the working directory.
|
||||
|
||||
replacements
|
||||
: A comma separated (or a slice) list of module path to directory replacement mapping, e.g. `github.com/bep/my-theme -> ../..,github.com/bep/shortcodes -> /some/path`. This is mostly useful for temporary locally development of a module, and then it makes sense to set it as an OS environment variable, e.g: `env HUGO_MODULE_REPLACEMENTS="github.com/bep/my-theme -> ../.."`. Any relative path is relate to [themesDir](https://gohugo.io/getting-started/configuration/#all-configuration-settings), and absolute paths are allowed.
|
||||
|
|
|
@ -135,3 +135,33 @@ Run `hugo mod clean` to delete the entire modules cache.
|
|||
Note that you can also configure the `modules` cache with a `maxAge`, see [File Caches](/getting-started/configuration/#configure-file-caches).
|
||||
|
||||
Also see the [CLI Doc](/commands/hugo_mod_clean/).
|
||||
|
||||
## Module Workspaces
|
||||
|
||||
{{< new-in "0.109.0" >}}
|
||||
|
||||
Workspace support was added in [Go 1.18](https://go.dev/blog/get-familiar-with-workspaces) and Hugo got solid support for it in the `v0.109.0` version.
|
||||
|
||||
A common use case for a workspace is to simplify local development of a site with its theme modules.
|
||||
|
||||
A workspace can be configured in a `*.work` file and activated with the [module.workspace](/hugo-modules/configuration/) setting, which for this use is commonly controlled via the `HUGO_MODULE_WORKSPACE` OS environment variable.
|
||||
|
||||
See the [hugo.work](https://github.com/gohugoio/hugo/blob/master/hugo.work) file in the Hugo Docs repo for an example:
|
||||
|
||||
```
|
||||
go 1.19
|
||||
|
||||
use .
|
||||
use ../gohugoioTheme
|
||||
```
|
||||
|
||||
Using the `use` directive, list all the modules you want to work on, pointing to its relative location. As in the example above, it's recommended to always include the main project (the ".") in the list.
|
||||
|
||||
With that you can start the Hugo server with that workspace enabled:
|
||||
|
||||
```
|
||||
HUGO_MODULE_WORKSPACE=hugo.work hugo server --ignoreVendorPaths "**"
|
||||
```
|
||||
|
||||
The `--ignoreVendorPaths` flag is added above to ignore any of the vendored dependencies inside `_vendor`. If you don't use vendoring, you don't need that flag. But now the server is set up watching the files and directories in the workspace and you can see your local edits reloaded.
|
||||
|
||||
|
|
|
@ -50,16 +50,6 @@ With `resources.GetRemote`, the first argument is a remote URL:
|
|||
|
||||
`resources.Get` and `resources.GetRemote` return `nil` if the resource is not found.
|
||||
|
||||
## Copy a Resource
|
||||
|
||||
{{< new-in "0.100.0" >}}
|
||||
|
||||
`resources.Copy` allows you to copy almost any Hugo `Resource` (the one exception is the `Page`), possibly most useful for renaming things:
|
||||
|
||||
```go-html-template
|
||||
{{ $resized := $image.Resize "400x400" | resources.Copy "images/mynewname.jpg" }}
|
||||
<img src="{{ $resized.RelPermalink }}">
|
||||
```
|
||||
|
||||
### Caching
|
||||
|
||||
|
@ -119,6 +109,18 @@ You can also change the request method and set the request body:
|
|||
|
||||
Remote resources fetched with `resources.GetRemote` will be cached on disk. See [Configure File Caches](/getting-started/configuration/#configure-file-caches) for details.
|
||||
|
||||
|
||||
## Copy a Resource
|
||||
|
||||
{{< new-in "0.100.0" >}}
|
||||
|
||||
`resources.Copy` allows you to copy almost any Hugo `Resource` (the one exception is the `Page`), possibly most useful for renaming things:
|
||||
|
||||
```go-html-template
|
||||
{{ $resized := $image.Resize "400x400" | resources.Copy "images/mynewname.jpg" }}
|
||||
<img src="{{ $resized.RelPermalink }}">
|
||||
```
|
||||
|
||||
## Asset directory
|
||||
|
||||
Asset files must be stored in the asset directory. This is `/assets` by default, but can be configured via the configuration file's `assetDir` key.
|
||||
|
|
|
@ -68,3 +68,30 @@ Note that in the example above, the "CSS purge step" will only be applied to the
|
|||
{{ end }}
|
||||
<link href="{{ $css.RelPermalink }}" rel="stylesheet" />
|
||||
```
|
||||
|
||||
|
||||
## Hugo Environment variables available in PostCSS
|
||||
|
||||
These are the environment variables Hugo passes down to PostCSS (and Babel), which allows you do do `process.env.HUGO_ENVIRONMENT === 'production' ? [autoprefixer] : []` and similar:
|
||||
|
||||
PWD
|
||||
: The absolute path to the project working directory.
|
||||
HUGO_ENVIRONMENT (and the alias HUGO_ENV)
|
||||
: The value e.g. set with `hugo -e production` (defaults to `production` for `hugo` and `development` for `hugo server`).
|
||||
|
||||
HUGO_PUBLISHDIR
|
||||
: {{ new-in "0.109.0" }} The absolute path to the publish directory (the `public` directory). Note that the value will always point to a directory on disk even when running `hugo server` in memory mode. If you write to this folder from PostCSS when running the server, you could run the server with one of these flags:
|
||||
|
||||
```
|
||||
hugo server --renderToDisk
|
||||
hugo server --renderStaticToDisk
|
||||
```
|
||||
|
||||
Also, Hugo will add environment variables for all files mounted below `assets/_jsconfig`. A default mount will be set up with files in the project root matching this regexp: `(babel|postcss|tailwind)\.config\.js`.
|
||||
|
||||
These will get environment variables named on the form `HUGO_FILE_:filename:` where `:filename:` is all upper case with periods replaced with underscore. This allows you do do this and similar:
|
||||
|
||||
```js
|
||||
let tailwindConfig = process.env.HUGO_FILE_TAILWIND_CONFIG_JS || './tailwind.config.js';
|
||||
```
|
||||
|
||||
|
|
|
@ -29,6 +29,9 @@ transpiler [string]
|
|||
targetPath [string]
|
||||
: If not set, the resource's target path will be the asset file original path with its extension replaced by `.css`.
|
||||
|
||||
vars [map]
|
||||
: Map of key/value pairs that will be available in the `hugo:vars` namespace, e.g. with `@use "hugo:vars" as v;` or (globally) with `@import "hugo:vars";` {{< new-in "0.109.0" >}}
|
||||
|
||||
outputStyle [string]
|
||||
: Default is `nested` (LibSass) and `expanded` (Dart Sass). Other available output styles for LibSass are `expanded`, `compact` and `compressed`. Dart Sass only supports `expanded` and `compressed`.
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ date: 2017-02-01
|
|||
publishdate: 2017-02-01
|
||||
lastmod: 2017-04-06
|
||||
categories: [templates]
|
||||
keywords: [page,templates]
|
||||
keywords: [page, templates]
|
||||
menu:
|
||||
docs:
|
||||
parent: "templates"
|
||||
|
@ -32,6 +32,7 @@ This single page template makes use of Hugo [base templates], the [`.Format` fun
|
|||
|
||||
{{< code file="layouts/posts/single.html" download="single.html" >}}
|
||||
{{ define "main" }}
|
||||
|
||||
<section id="main">
|
||||
<h1 id="title">{{ .Title }}</h1>
|
||||
<div>
|
||||
|
@ -46,20 +47,20 @@ This single page template makes use of Hugo [base templates], the [`.Format` fun
|
|||
<h4 id="date"> {{ .Date.Format "Mon Jan 2, 2006" }} </h4>
|
||||
<h5 id="wordcount"> {{ .WordCount }} Words </h5>
|
||||
</section>
|
||||
{{ with .Params.topics }}
|
||||
<ul id="topics">
|
||||
{{ range . }}
|
||||
<li><a href="{{ "topics" | absURL}}{{ . | urlize }}">{{ . }}</a> </li>
|
||||
{{ with .GetTerms "topics" }}
|
||||
<ul id="topics">
|
||||
{{ range . }}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
{{ with .Params.tags }}
|
||||
<ul id="tags">
|
||||
{{ range . }}
|
||||
<li> <a href="{{ "tags" | absURL }}{{ . | urlize }}">{{ . }}</a> </li>
|
||||
{{ with .GetTerms "tags" }}
|
||||
<ul id="tags">
|
||||
{{ range . }}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
</div>
|
||||
<div>
|
||||
{{ with .PrevInSection }}
|
||||
|
@ -81,7 +82,7 @@ To easily generate new instances of a content type (e.g., new `.md` files in a s
|
|||
[content type]: /content-management/types/
|
||||
[directory structure]: /getting-started/directory-structure/
|
||||
[dry]: https://en.wikipedia.org/wiki/Don%27t_repeat_yourself
|
||||
[`.Format` function]: /functions/format/
|
||||
[`.format` function]: /functions/format/
|
||||
[front matter]: /content-management/front-matter/
|
||||
[pagetaxonomy]: /templates/taxonomy-templates/#display-a-single-piece-of-contents-taxonomies
|
||||
[pagevars]: /variables/page/
|
||||
|
|
|
@ -26,5 +26,4 @@ toc: false
|
|||
## Commercial Services
|
||||
|
||||
- [DATOCMS](https://www.datocms.com) DatoCMS is a fully customizable administrative area for your static websites. Use your favorite website generator, let your clients publish new content independently, and the host the site anywhere you like.
|
||||
- [Forestry.io](https://forestry.io/). Forestry is a git-backed CMS for Hugo, Gatsby, Jekyll and VuePress websites with support for GitHub, GitLab, Bitbucket and Azure Devops. Forestry provides a nice user interface to edit and model content for non technical editors. It supports S3, Cloudinary and Netlify Large Media integrations for storing media. Every time an update is made via the CMS, Forestry will commit changes back to your repo and vice-versa.
|
||||
- [CloudCannon](https://cloudcannon.com/hugo-cms/). The intuitive Git-based CMS for your Hugo website. CloudCannon syncs changes from your Git repository and pushes content changes back, so your development and content teams are always in sync. Edit all of your content on the page with visual editing, build entire pages with reusable custom components and then publish confidently.
|
||||
|
|
|
@ -32,6 +32,9 @@ See [`.Scratch`](/functions/scratch/) for page-scoped, writable variables.
|
|||
.Aliases
|
||||
: aliases of this page
|
||||
|
||||
.Ancestors
|
||||
: get the ancestors of each page, simplify [breadcrumb navigation]({{< relref "content-management/sections#example-breadcrumb-navigation" >}}) implementation complexity
|
||||
|
||||
.BundleType
|
||||
: the [bundle] type: `leaf`, `branch`, or an empty string if the page is not a bundle.
|
||||
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
---
|
||||
title: "世界上最快的网站构建框架"
|
||||
date: 2017-03-02T12:00:00-05:00
|
||||
features:
|
||||
- heading: 飞快的速度
|
||||
image_path: /images/icon-fast.svg
|
||||
tagline: 摩登发布
|
||||
copy: Hugo 是同类中最快的工具。生成一页小于 1ms,生成一个站点平均不超过 1s。
|
||||
|
||||
- heading: 强大的内容管理
|
||||
image_path: /images/icon-content-management.svg
|
||||
tagline: 灵活的规则。Hugo 是一个设计师的梦想。
|
||||
copy: Hugo 支持无限的内容类型、分类、菜单、动态 API 驱动的内容,以及更多,都不需要插件。
|
||||
|
||||
- heading: 短代码
|
||||
image_path: /images/icon-shortcodes.svg
|
||||
tagline: Hugo 短代码是 Markdown 隐藏的强大功能。
|
||||
copy: 我们喜欢美丽简洁的 markdown 语法,但是有时候我们也想要更灵活一些。Hugo 短代码允许既美丽又灵活。
|
||||
|
||||
- heading: 内置模板
|
||||
image_path: /images/icon-built-in-templates.svg
|
||||
tagline: Hugo 有通用的模式让你快速的完成工作。
|
||||
copy: Hugo 平台预置的模板会快速实现搜索引擎优化、评论、分析和其他的功能。一行代码,你就完成了。
|
||||
|
||||
- heading: 多语言和国际化
|
||||
image_path: /images/icon-multilingual2.svg
|
||||
tagline: 多语言制作
|
||||
copy: Hugo 为多语言站点提供了完整的国际化支持,并且具有与 Hugo 用户在单语言站点中喜爱的相同的简单开发体验。
|
||||
|
||||
- heading: 自定义输出
|
||||
image_path: /images/icon-custom-outputs.svg
|
||||
tagline: HTML 不够用吗?
|
||||
copy: Hugo 允许您以多种格式输出内容,包括 JSON 或 AMP,并且可以很容易地创建自己的内容。
|
||||
sections:
|
||||
- heading: "100 多个主题"
|
||||
cta: 看看 Hugo 的主题
|
||||
link: https://themes.gohugo.io/
|
||||
color_classes: bg-accent-color white
|
||||
image: /images/homepage-screenshot-hugo-themes.jpg
|
||||
copy: "Hugo 提供了一个强大的主题系统,易于实现,但能够生成即使是最复杂的网站。"
|
||||
- heading: "功能模板"
|
||||
cta: 开始吧。
|
||||
link: templates/
|
||||
color_classes: bg-primary-color-light black
|
||||
image: /images/home-page-templating-example.png
|
||||
copy: "Hugo 基于 Go 的模板提供了恰当的方法来生成从简单到复杂的任何东西。如果你喜欢 Jade/Pug 类似的语法,你也可以使用 Amber、Ace 或三种任意组合。"
|
||||
---
|
||||
|
||||
Hugo 是最受欢迎的开源静态站点生成器之一。凭借惊人的速度和灵活性,Hugo 使建设网站的乐趣再现。
|
|
@ -1,20 +0,0 @@
|
|||
---
|
||||
title: 关于 Hugo
|
||||
linktitle: 概览
|
||||
description: Hugo 的特色、规划、许可和动力。
|
||||
date: 2018-04-26
|
||||
publishdate: 2018-04-26
|
||||
lastmod: 2018-04-26
|
||||
categories: []
|
||||
keywords: []
|
||||
menu:
|
||||
docs:
|
||||
parent: "about"
|
||||
weight: 1
|
||||
weight: 1
|
||||
draft: false
|
||||
aliases: [/about-hugo/,/docs/]
|
||||
toc: false
|
||||
---
|
||||
|
||||
Hugo 不是一般的静态网站生成器。
|
|
@ -1,20 +0,0 @@
|
|||
---
|
||||
title: 内容管理
|
||||
linkTitle: 内容管理概览
|
||||
description: Hugo 可以管理大型的静态网站,支持骨架、内容类型、菜单、引用、概要等等。
|
||||
date: 2018-04-23
|
||||
publishdate: 2018-04-23
|
||||
lastmod: 2018-04-23
|
||||
menu:
|
||||
docs:
|
||||
parent: content-management
|
||||
weight: 1
|
||||
keywords: [source, organization]
|
||||
categories: [content management]
|
||||
weight: 01 #rem
|
||||
aliases: [/content/,/content/organization]
|
||||
toc: false
|
||||
isCJKLanguage: true
|
||||
---
|
||||
|
||||
一个实用的静态网站生成器,需要超越“文件头” (front matter) 和模板的等基本功能,才能兼备可伸缩性和可管理性,满足用户所需。Hugo 不仅是给开发者设计的,也同样适用于内容管理员和写作人员。
|
|
@ -1,21 +0,0 @@
|
|||
---
|
||||
title: Hugo 说明文档
|
||||
linktitle: Hugo
|
||||
description: Hugo 是世界上最快的静态网站引擎。它是用 Go (即 Golang) 编程语言所写成,由 bep、spf13 和朋友们共同开发。
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
menu:
|
||||
main:
|
||||
parent: "section name"
|
||||
weight: 01
|
||||
weight: 01 #rem
|
||||
draft: false
|
||||
slug:
|
||||
aliases: []
|
||||
toc: false
|
||||
layout: documentation-home
|
||||
isCJKLanguage: true
|
||||
---
|
||||
Hugo 是世界上最快的静态网站引擎。它是用 Go (即 Golang) 编程语言所写成,由 [bep](https://github.com/bep)、[spf13](https://github.com/spf13) 和[朋友们](https://github.com/gohugoio/hugo/graphs/contributors)共同开发。
|
||||
|
||||
下面是我们说明文档中最常用和实用的章节:
|
|
@ -1,4 +0,0 @@
|
|||
---
|
||||
title: "Hugo 新闻"
|
||||
aliases: [/release-notes/]
|
||||
---
|
|
@ -1,19 +0,0 @@
|
|||
---
|
||||
title: 模板 Templates
|
||||
linktitle: 模板概览
|
||||
description: Go templating, template types and lookup order, shortcodes, and data.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
menu:
|
||||
docs:
|
||||
parent: "templates"
|
||||
weight: 01
|
||||
weight: 01 #rem
|
||||
categories: [templates]
|
||||
keywords: []
|
||||
draft: false
|
||||
aliases: [/templates/overview/,/templates/content]
|
||||
toc: false
|
||||
notesforauthors:
|
||||
---
|
|
@ -1,131 +0,0 @@
|
|||
---
|
||||
title: Base 模板 and Blocks
|
||||
linktitle:
|
||||
description: The base and block constructs allow you to define the outer shell of your master templates (i.e., the chrome of the page).
|
||||
date: 2017-02-01
|
||||
publishdate: 2018-08-11
|
||||
lastmod: 2017-02-01
|
||||
categories: [templates,fundamentals]
|
||||
keywords: [blocks,base]
|
||||
menu:
|
||||
docs:
|
||||
parent: "templates"
|
||||
weight: 20
|
||||
weight: 20
|
||||
sections_weight: 20
|
||||
draft: false
|
||||
aliases: [/templates/blocks/,/templates/base-templates-and-blocks/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
The `block` keyword allows you to define the outer shell of your pages' one or more master template(s) and then fill in or override portions as necessary.
|
||||
|
||||
{{< youtube QVOMCYitLEc >}}
|
||||
|
||||
## Base Template Lookup Order
|
||||
|
||||
The [lookup order][lookup] for base templates is as follows:
|
||||
|
||||
1. `/layouts/section/<TYPE>-baseof.html`
|
||||
2. `/themes/<THEME>/layouts/section/<TYPE>-baseof.html`
|
||||
3. `/layouts/<TYPE>/baseof.html`
|
||||
4. `/themes/<THEME>/layouts/<TYPE>/baseof.html`
|
||||
5. `/layouts/section/baseof.html`
|
||||
6. `/themes/<THEME>/layouts/section/baseof.html`
|
||||
7. `/layouts/_default/<TYPE>-baseof.html`
|
||||
8. `/themes/<THEME>/layouts/_default/<TYPE>-baseof.html`
|
||||
9. `/layouts/_default/baseof.html`
|
||||
10. `/themes/<THEME>/layouts/_default/baseof.html`
|
||||
|
||||
Variables are denoted by capitalized text set within `<>`. Note that Hugo's default behavior is for `type` to inherit from `section` unless otherwise specified.
|
||||
|
||||
### Example Base Template Lookup Order
|
||||
|
||||
As an example, let's assume your site is using a theme called "mytheme" when rendering the section list for a `posts` section. Hugo picks `layout/section/posts.html` as the template for [rendering the section]. The `{{define}}` block in this template tells Hugo that the template is an extension of a base template.
|
||||
|
||||
Here is the lookup order for the `posts` base template:
|
||||
|
||||
1. `/layouts/section/posts-baseof.html`
|
||||
2. `/themes/mytheme/layouts/section/posts-baseof.html`
|
||||
3. `/layouts/posts/baseof.html`
|
||||
4. `/themes/mytheme/layouts/posts/baseof.html`
|
||||
5. `/layouts/section/baseof.html`
|
||||
6. `/themes/mytheme/layouts/section/baseof.html`
|
||||
7. `/layouts/_default/posts-baseof.html`
|
||||
8. `/themes/mytheme/layouts/_default/posts-baseof.html`
|
||||
9. `/layouts/_default/baseof.html`
|
||||
10. `/themes/mytheme/layouts/_default/baseof.html`
|
||||
|
||||
## Define the Base Template
|
||||
|
||||
The following defines a simple base template at `_default/baseof.html`. As a default template, it is the shell from which all your pages will be rendered unless you specify another `*baseof.html` closer to the beginning of the lookup order.
|
||||
|
||||
{{< code file="layouts/_default/baseof.html" download="baseof.html" >}}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{{ block "title" . }}
|
||||
<!-- Blocks may include default content. -->
|
||||
{{ .Site.Title }}
|
||||
{{ end }}</title>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Code that all your templates share, like a header -->
|
||||
{{ block "main" . }}
|
||||
<!-- The part of the page that begins to differ between templates -->
|
||||
{{ end }}
|
||||
{{ block "footer" . }}
|
||||
<!-- More shared code, perhaps a footer but that can be overridden if need be in -->
|
||||
{{ end }}
|
||||
</body>
|
||||
</html>
|
||||
{{< /code >}}
|
||||
|
||||
## Override the Base Template
|
||||
|
||||
From the above base template, you can define a [default list template][hugolists]. The default list template will inherit all of the code defined above and can then implement its own `"main"` block from:
|
||||
|
||||
{{< code file="layouts/_default/list.html" download="list.html" >}}
|
||||
{{ define "main" }}
|
||||
<h1>Posts</h1>
|
||||
{{ range .Pages }}
|
||||
<article>
|
||||
<h2>{{ .Title }}</h2>
|
||||
{{ .Content }}
|
||||
</article>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{< /code >}}
|
||||
|
||||
This replaces the contents of our (basically empty) "main" block with something useful for the list template. In this case, we didn't define a `"title"` block, so the contents from our base template remain unchanged in lists.
|
||||
|
||||
{{% warning %}}
|
||||
Code that you put outside the block definitions *can* break your layout. This even includes HTML comments. For example:
|
||||
|
||||
```
|
||||
<!-- Seemingly harmless HTML comment..that will break your layout at build -->
|
||||
{{ define "main" }}
|
||||
...your code here
|
||||
{{ end }}
|
||||
```
|
||||
[See this thread from the Hugo discussion forums.](https://discourse.gohugo.io/t/baseof-html-block-templates-and-list-types-results-in-empty-pages/5612/6)
|
||||
{{% /warning %}}
|
||||
|
||||
The following shows how you can override both the `"main"` and `"title"` block areas from the base template with code unique to your [default single page template][singletemplate]:
|
||||
|
||||
{{< code file="layouts/_default/single.html" download="single.html" >}}
|
||||
{{ define "title" }}
|
||||
<!-- This will override the default value set in baseof.html; i.e., "{{.Site.Title}}" in the original example-->
|
||||
{{ .Title }} – {{ .Site.Title }}
|
||||
{{ end }}
|
||||
{{ define "main" }}
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
{{< /code >}}
|
||||
|
||||
[hugolists]: /templates/lists
|
||||
[lookup]: /templates/lookup-order/
|
||||
[rendering the section]: /templates/section-templates/
|
||||
[singletemplate]: /templates/single-page-templates/
|
|
@ -1,25 +0,0 @@
|
|||
---
|
||||
title: 开发者工具
|
||||
linktitle: 开发者工具概览
|
||||
description: 除了 Hugo 强大的命令外,对于 Hugo 开发者还有大量社区开发的工具链。
|
||||
date: 2018-05-29
|
||||
publishdate: 2018-05-29
|
||||
lastmod: 2018-05-29
|
||||
categories: [developer tools]
|
||||
keywords: []
|
||||
menu:
|
||||
docs:
|
||||
parent: "tools"
|
||||
weight: 01
|
||||
weight: 01
|
||||
sections_weight: 01
|
||||
draft: false
|
||||
aliases: [/tools/]
|
||||
---
|
||||
|
||||
Hugo 最强大的在于它是活跃的——并总在发展的——开发者社区。除了在[语法高亮][syntax] 中提到的 `highlight` 简码外,该章节中的这些工具和其它项目特色都是由商业服务和开源项目提供,很多就是由像你一样的 Hugo 开发者开发的。
|
||||
|
||||
[查看 Hugo 的流行程度与其它静态网站生成器的比较。][staticgen]
|
||||
|
||||
[staticgen]: https://staticgen.com
|
||||
[syntax]: /tools/syntax-highlighting/
|
|
@ -1,31 +0,0 @@
|
|||
---
|
||||
title: 搜索你的 Hugo 网站
|
||||
linktitle: 搜索
|
||||
description: 为你最新添加的 Hugo 网站看一些开源和商业搜索选择。
|
||||
date: 2018-05-29
|
||||
publishdate: 2018-05-29
|
||||
lastmod: 2018-05-29
|
||||
categories: [developer tools]
|
||||
keywords: [search,tools]
|
||||
menu:
|
||||
docs:
|
||||
parent: "tools"
|
||||
weight: 60
|
||||
weight: 60
|
||||
sections_weight: 60
|
||||
draft: false
|
||||
aliases: []
|
||||
toc: true
|
||||
---
|
||||
|
||||
静态网站还有动态搜索功能?是的。作为可选方案,来自 Google 或者其它搜索引擎的嵌入式脚本,可以给你的访客提供一个自定义的直接基于你的内容文件索引的搜素。
|
||||
|
||||
* [GitHub Gist for Hugo Workflow](https://gist.github.com/sebz/efddfc8fdcb6b480f567). Gist 包含一个为你的网站创建索引的简单流程。它使用简单的 Grunt 脚本索引你所有的内容文件,并且 [lunr.js](http://lunrjs.com/) 会提供搜索结果。
|
||||
* [hugo-lunr](https://www.npmjs.com/package/hugo-lunr). 一个使用 [lunr.js](http://lunrjs.com/) 为你的 Hugo 静态网站添加搜索的简单方法。Hugo-lunr 将会给你的 Hugo 项目中任意 html 和 markdown 文件创建一个索引文件。
|
||||
* [hugo-lunr-zh](https://www.npmjs.com/package/hugo-lunr-zh). 有点像 Hugo-lunr,但是 Hugo-lunr-zh 能帮助你分割中文关键字。
|
||||
* [Github Gist for Fuse.js integration](https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1cb41ae). 该 gist 显示如何借助 Hugo 已有的构建时间在客户端通过 [Fuse.js](http://fusejs.io/) 生成可搜索的 JSON 索引。尽管 gist 使用 Fuse.js 进行模糊匹配,任何有能力读取 JSON 索引的客户端工具都可以运行。不需要 Hugo 以外, npm、grunt 或者其它构建时工具。
|
||||
* [hugo-search-index](https://www.npmjs.com/package/hugo-search-index). 一个包含实现了搜索的 Gulp 任务和内置浏览器脚本的库。Gulp 从项目中的 markdown 文件生成索引。
|
||||
|
||||
## 商业搜索服务
|
||||
|
||||
* [Algolia](https://www.algolia.com/) 的搜索 API 使得在你的应用和网站中提供一个很好的搜索体验变得简单。Algolia 搜索提供托管的全文本、数字化、分面以及地理定位搜索。
|
128
data/docs.json
128
data/docs.json
|
@ -3033,11 +3033,11 @@
|
|||
},
|
||||
"compare": {
|
||||
"Conditional": {
|
||||
"Description": "Conditional can be used as a ternary operator.\nIt returns a if condition, else b.",
|
||||
"Description": "Conditional can be used as a ternary operator.\n\nIt returns v1 if cond is true, else v2.",
|
||||
"Args": [
|
||||
"condition",
|
||||
"a",
|
||||
"b"
|
||||
"cond",
|
||||
"v1",
|
||||
"v2"
|
||||
],
|
||||
"Aliases": [
|
||||
"cond"
|
||||
|
@ -3050,10 +3050,10 @@
|
|||
]
|
||||
},
|
||||
"Default": {
|
||||
"Description": "Default checks whether a given value is set and returns a default value if it\nis not. \"Set\" in this context means non-zero for numeric types and times;\nnon-zero length for strings, arrays, slices, and maps;\nany boolean or struct value; or non-nil for any other types.",
|
||||
"Description": "Default checks whether a givenv is set and returns the default value defaultv if it\nis not. \"Set\" in this context means non-zero for numeric types and times;\nnon-zero length for strings, arrays, slices, and maps;\nany boolean or struct value; or non-nil for any other types.",
|
||||
"Args": [
|
||||
"dflt",
|
||||
"given"
|
||||
"defaultv",
|
||||
"givenv"
|
||||
],
|
||||
"Aliases": [
|
||||
"default"
|
||||
|
@ -3154,10 +3154,10 @@
|
|||
},
|
||||
"collections": {
|
||||
"After": {
|
||||
"Description": "After returns all the items after the first N in a rangeable list.",
|
||||
"Description": "After returns all the items after the first n items in list l.",
|
||||
"Args": [
|
||||
"index",
|
||||
"seq"
|
||||
"n",
|
||||
"l"
|
||||
],
|
||||
"Aliases": [
|
||||
"after"
|
||||
|
@ -3165,7 +3165,7 @@
|
|||
"Examples": []
|
||||
},
|
||||
"Append": {
|
||||
"Description": "Append appends the arguments up to the last one to the slice in the last argument.\nThis construct allows template constructs like this:\n {{ $pages = $pages | append $p2 $p1 }}\nNote that with 2 arguments where both are slices of the same type,\nthe first slice will be appended to the second:\n {{ $pages = $pages | append .Site.RegularPages }}",
|
||||
"Description": "Append appends args up to the last one to the slice in the last argument.\nThis construct allows template constructs like this:\n\n\t{{ $pages = $pages | append $p2 $p1 }}\n\nNote that with 2 arguments where both are slices of the same type,\nthe first slice will be appended to the second:\n\n\t{{ $pages = $pages | append .Site.RegularPages }}",
|
||||
"Args": [
|
||||
"args"
|
||||
],
|
||||
|
@ -3175,10 +3175,10 @@
|
|||
"Examples": []
|
||||
},
|
||||
"Apply": {
|
||||
"Description": "Apply takes a map, array, or slice and returns a new slice with the function fname applied over it.",
|
||||
"Description": "Apply takes a map, array, or slice c and returns a new slice with the function fname applied over it.",
|
||||
"Args": [
|
||||
"ctx",
|
||||
"seq",
|
||||
"c",
|
||||
"fname",
|
||||
"args"
|
||||
],
|
||||
|
@ -3188,9 +3188,9 @@
|
|||
"Examples": []
|
||||
},
|
||||
"Complement": {
|
||||
"Description": "Complement gives the elements in the last element of seqs that are not in\nany of the others.\nAll elements of seqs must be slices or arrays of comparable types.\n\nThe reasoning behind this rather clumsy API is so we can do this in the templates:\n {{ $c := .Pages | complement $last4 }}",
|
||||
"Description": "Complement gives the elements in the last element of ls that are not in\nany of the others.\n\nAll elements of ls must be slices or arrays of comparable types.\n\nThe reasoning behind this rather clumsy API is so we can do this in the templates:\n\n\t{{ $c := .Pages | complement $last4 }}",
|
||||
"Args": [
|
||||
"seqs"
|
||||
"ls"
|
||||
],
|
||||
"Aliases": [
|
||||
"complement"
|
||||
|
@ -3203,10 +3203,10 @@
|
|||
]
|
||||
},
|
||||
"Delimit": {
|
||||
"Description": "Delimit takes a given sequence and returns a delimited HTML string.\nIf last is passed to the function, it will be used as the final delimiter.",
|
||||
"Description": "Delimit takes a given list l and returns a string delimited by sep.\nIf last is passed to the function, it will be used as the final delimiter.",
|
||||
"Args": [
|
||||
"seq",
|
||||
"delimiter",
|
||||
"l",
|
||||
"sep",
|
||||
"last"
|
||||
],
|
||||
"Aliases": [
|
||||
|
@ -3220,7 +3220,7 @@
|
|||
]
|
||||
},
|
||||
"Dictionary": {
|
||||
"Description": "Dictionary creates a map[string]interface{} from the given parameters by\nwalking the parameters and treating them as key-value pairs. The number\nof parameters must be even.\nThe keys can be string slices, which will create the needed nested structure.",
|
||||
"Description": "Dictionary creates a new map from the given parameters by\ntreating values as key-value pairs. The number of values must be even.\nThe keys can be string slices, which will create the needed nested structure.",
|
||||
"Args": [
|
||||
"values"
|
||||
],
|
||||
|
@ -3230,10 +3230,10 @@
|
|||
"Examples": []
|
||||
},
|
||||
"EchoParam": {
|
||||
"Description": "EchoParam returns a given value if it is set; otherwise, it returns an\nempty string.",
|
||||
"Description": "EchoParam returns a the value in the collection c with key k if is set; otherwise, it returns an\nempty string.",
|
||||
"Args": [
|
||||
"a",
|
||||
"key"
|
||||
"c",
|
||||
"k"
|
||||
],
|
||||
"Aliases": [
|
||||
"echoParam"
|
||||
|
@ -3246,10 +3246,10 @@
|
|||
]
|
||||
},
|
||||
"First": {
|
||||
"Description": "First returns the first N items in a rangeable list.",
|
||||
"Description": "First returns the first limit items in list l.",
|
||||
"Args": [
|
||||
"limit",
|
||||
"seq"
|
||||
"l"
|
||||
],
|
||||
"Aliases": [
|
||||
"first"
|
||||
|
@ -3257,7 +3257,7 @@
|
|||
"Examples": []
|
||||
},
|
||||
"Group": {
|
||||
"Description": "Group groups a set of elements by the given key.\nThis is currently only supported for Pages.",
|
||||
"Description": "Group groups a set of items by the given key.\nThis is currently only supported for Pages.",
|
||||
"Args": [
|
||||
"key",
|
||||
"items"
|
||||
|
@ -3268,7 +3268,7 @@
|
|||
"Examples": []
|
||||
},
|
||||
"In": {
|
||||
"Description": "In returns whether v is in the set l. l may be an array or slice.",
|
||||
"Description": "In returns whether v is in the list l. l may be an array or slice.",
|
||||
"Args": [
|
||||
"l",
|
||||
"v"
|
||||
|
@ -3284,7 +3284,7 @@
|
|||
]
|
||||
},
|
||||
"Index": {
|
||||
"Description": "Index returns the result of indexing its first argument by the following\narguments. Thus \"index x 1 2 3\" is, in Go syntax, x[1][2][3]. Each\nindexed item must be a map, slice, or array.\n\nCopied from Go stdlib src/text/template/funcs.go.\n\nWe deviate from the stdlib due to https://github.com/golang/go/issues/14751.\n\nTODO(moorereason): merge upstream changes.",
|
||||
"Description": "Index returns the result of indexing its first argument by the following\narguments. Thus \"index x 1 2 3\" is, in Go syntax, x[1][2][3]. Each\nindexed item must be a map, slice, or array.\n\nAdapted from Go stdlib src/text/template/funcs.go.\n\nWe deviate from the stdlib mostly because of https://github.com/golang/go/issues/14751.",
|
||||
"Args": [
|
||||
"item",
|
||||
"args"
|
||||
|
@ -3306,9 +3306,9 @@
|
|||
"Examples": []
|
||||
},
|
||||
"IsSet": {
|
||||
"Description": "IsSet returns whether a given array, channel, slice, or map has a key\ndefined.",
|
||||
"Description": "IsSet returns whether a given array, channel, slice, or map in c has the given key\ndefined.",
|
||||
"Args": [
|
||||
"a",
|
||||
"c",
|
||||
"key"
|
||||
],
|
||||
"Aliases": [
|
||||
|
@ -3321,7 +3321,7 @@
|
|||
"Description": "KeyVals creates a key and values wrapper.",
|
||||
"Args": [
|
||||
"key",
|
||||
"vals"
|
||||
"values"
|
||||
],
|
||||
"Aliases": [
|
||||
"keyVals"
|
||||
|
@ -3334,10 +3334,10 @@
|
|||
]
|
||||
},
|
||||
"Last": {
|
||||
"Description": "Last returns the last N items in a rangeable list.",
|
||||
"Description": "Last returns the last limit items in the list l.",
|
||||
"Args": [
|
||||
"limit",
|
||||
"seq"
|
||||
"l"
|
||||
],
|
||||
"Aliases": [
|
||||
"last"
|
||||
|
@ -3345,7 +3345,7 @@
|
|||
"Examples": []
|
||||
},
|
||||
"Merge": {
|
||||
"Description": "Merge creates a copy of the final parameter and merges the preceding\nparameters into it in reverse order.\nCurrently only maps are supported. Key handling is case insensitive.",
|
||||
"Description": "Merge creates a copy of the final parameter in params and merges the preceding\nparameters into it in reverse order.\n\nCurrently only maps are supported. Key handling is case insensitive.",
|
||||
"Args": [
|
||||
"params"
|
||||
],
|
||||
|
@ -3381,7 +3381,7 @@
|
|||
]
|
||||
},
|
||||
"Querify": {
|
||||
"Description": "Querify encodes the given parameters in URL-encoded form (\"bar=baz\u0026foo=quux\") sorted by key.",
|
||||
"Description": "Querify encodes the given params in URL-encoded form (\"bar=baz\u0026foo=quux\") sorted by key.",
|
||||
"Args": [
|
||||
"params"
|
||||
],
|
||||
|
@ -3410,7 +3410,7 @@
|
|||
"Examples": null
|
||||
},
|
||||
"Seq": {
|
||||
"Description": "Seq creates a sequence of integers. It's named and used as GNU's seq.\n\nExamples:\n 3 =\u003e 1, 2, 3\n 1 2 4 =\u003e 1, 3\n -3 =\u003e -1, -2, -3\n 1 4 =\u003e 1, 2, 3, 4\n 1 -2 =\u003e 1, 0, -1, -2",
|
||||
"Description": "Seq creates a sequence of integers from args. It's named and used as GNU's seq.\n\nExamples:\n\n\t3 =\u003e 1, 2, 3\n\t1 2 4 =\u003e 1, 3\n\t-3 =\u003e -1, -2, -3\n\t1 4 =\u003e 1, 2, 3, 4\n\t1 -2 =\u003e 1, 0, -1, -2",
|
||||
"Args": [
|
||||
"args"
|
||||
],
|
||||
|
@ -3425,9 +3425,9 @@
|
|||
]
|
||||
},
|
||||
"Shuffle": {
|
||||
"Description": "Shuffle returns the given rangeable list in a randomised order.",
|
||||
"Description": "Shuffle returns list l in a randomised order.",
|
||||
"Args": [
|
||||
"seq"
|
||||
"l"
|
||||
],
|
||||
"Aliases": [
|
||||
"shuffle"
|
||||
|
@ -3450,9 +3450,9 @@
|
|||
]
|
||||
},
|
||||
"Sort": {
|
||||
"Description": "Sort returns a sorted sequence.",
|
||||
"Description": "Sort returns a sorted copy of the list l.",
|
||||
"Args": [
|
||||
"seq",
|
||||
"l",
|
||||
"args"
|
||||
],
|
||||
"Aliases": [
|
||||
|
@ -3493,9 +3493,9 @@
|
|||
]
|
||||
},
|
||||
"Uniq": {
|
||||
"Description": "Uniq takes in a slice or array and returns a slice with subsequent\nduplicate elements removed.",
|
||||
"Description": "Uniq takes returns a new list with all duplicate elements in the list l removed.\nduplicate elements removed.",
|
||||
"Args": [
|
||||
"seq"
|
||||
"l"
|
||||
],
|
||||
"Aliases": [
|
||||
"uniq"
|
||||
|
@ -3508,9 +3508,9 @@
|
|||
]
|
||||
},
|
||||
"Where": {
|
||||
"Description": "Where returns a filtered subset of a given data type.",
|
||||
"Description": "Where returns a filtered subset of collection c.",
|
||||
"Args": [
|
||||
"seq",
|
||||
"c",
|
||||
"key",
|
||||
"args"
|
||||
],
|
||||
|
@ -3522,9 +3522,9 @@
|
|||
},
|
||||
"crypto": {
|
||||
"FNV32a": {
|
||||
"Description": "FNV32a hashes using fnv32a algorithm",
|
||||
"Description": "FNV32a hashes v using fnv32a algorithm.",
|
||||
"Args": [
|
||||
"in"
|
||||
"v"
|
||||
],
|
||||
"Aliases": null,
|
||||
"Examples": [
|
||||
|
@ -3553,9 +3553,9 @@
|
|||
]
|
||||
},
|
||||
"MD5": {
|
||||
"Description": "MD5 hashes the given input and returns its MD5 checksum.",
|
||||
"Description": "MD5 hashes the v and returns its MD5 checksum.",
|
||||
"Args": [
|
||||
"in"
|
||||
"v"
|
||||
],
|
||||
"Aliases": [
|
||||
"md5"
|
||||
|
@ -3572,9 +3572,9 @@
|
|||
]
|
||||
},
|
||||
"SHA1": {
|
||||
"Description": "SHA1 hashes the given input and returns its SHA1 checksum.",
|
||||
"Description": "SHA1 hashes v and returns its SHA1 checksum.",
|
||||
"Args": [
|
||||
"in"
|
||||
"v"
|
||||
],
|
||||
"Aliases": [
|
||||
"sha1"
|
||||
|
@ -3587,9 +3587,9 @@
|
|||
]
|
||||
},
|
||||
"SHA256": {
|
||||
"Description": "SHA256 hashes the given input and returns its SHA256 checksum.",
|
||||
"Description": "SHA256 hashes v and returns its SHA256 checksum.",
|
||||
"Args": [
|
||||
"in"
|
||||
"v"
|
||||
],
|
||||
"Aliases": [
|
||||
"sha256"
|
||||
|
@ -3604,7 +3604,7 @@
|
|||
},
|
||||
"data": {
|
||||
"GetCSV": {
|
||||
"Description": "GetCSV expects a data separator and one or n-parts of a URL to a resource which\ncan either be a local or a remote one.\nThe data separator can be a comma, semi-colon, pipe, etc, but only one character.\nIf you provide multiple parts for the URL they will be joined together to the final URL.\nGetCSV returns nil or a slice slice to use in a short code.",
|
||||
"Description": "GetCSV expects the separator sep and one or n-parts of a URL to a resource which\ncan either be a local or a remote one.\nThe data separator can be a comma, semi-colon, pipe, etc, but only one character.\nIf you provide multiple parts for the URL they will be joined together to the final URL.\nGetCSV returns nil or a slice slice to use in a short code.",
|
||||
"Args": [
|
||||
"sep",
|
||||
"args"
|
||||
|
@ -3615,7 +3615,7 @@
|
|||
"Examples": []
|
||||
},
|
||||
"GetJSON": {
|
||||
"Description": "GetJSON expects one or n-parts of a URL to a resource which can either be a local or a remote one.\nIf you provide multiple parts they will be joined together to the final URL.\nGetJSON returns nil or parsed JSON to use in a short code.",
|
||||
"Description": "GetJSON expects one or n-parts of a URL in args to a resource which can either be a local or a remote one.\nIf you provide multiple parts they will be joined together to the final URL.\nGetJSON returns nil or parsed JSON to use in a short code.",
|
||||
"Args": [
|
||||
"args"
|
||||
],
|
||||
|
@ -3627,7 +3627,7 @@
|
|||
},
|
||||
"debug": {
|
||||
"Dump": {
|
||||
"Description": "Dump returns a object dump of val as a string.\nNote that not every value passed to Dump will print so nicely, but\nwe'll improve on that. We recommend using the \"go\" Chroma lexer to format the output\nnicely.\nAlso note that the output from Dump may change from Hugo version to the next,\nso don't depend on a specific output.",
|
||||
"Description": "Dump returns a object dump of val as a string.\nNote that not every value passed to Dump will print so nicely, but\nwe'll improve on that.\n\nWe recommend using the \"go\" Chroma lexer to format the output\nnicely.\n\nAlso note that the output from Dump may change from Hugo version to the next,\nso don't depend on a specific output.",
|
||||
"Args": [
|
||||
"val"
|
||||
],
|
||||
|
@ -3684,7 +3684,7 @@
|
|||
]
|
||||
},
|
||||
"Jsonify": {
|
||||
"Description": "Jsonify encodes a given object to JSON. To pretty print the JSON, pass a map\nor dictionary of options as the first argument. Supported options are\n\"prefix\" and \"indent\". Each JSON element in the output will begin on a new\nline beginning with prefix followed by one or more copies of indent according\nto the indentation nesting.",
|
||||
"Description": "Jsonify encodes a given object to JSON. To pretty print the JSON, pass a map\nor dictionary of options as the first value in args. Supported options are\n\"prefix\" and \"indent\". Each JSON element in the output will begin on a new\nline beginning with prefix followed by one or more copies of indent according\nto the indentation nesting.",
|
||||
"Args": [
|
||||
"args"
|
||||
],
|
||||
|
@ -3721,7 +3721,7 @@
|
|||
]
|
||||
},
|
||||
"Erroridf": {
|
||||
"Description": "Erroridf formats args according to a format specifier and logs an ERROR and\nan information text that the error with the given ID can be suppressed in config.\nIt returns an empty string.",
|
||||
"Description": "Erroridf formats args according to a format specifier and logs an ERROR and\nan information text that the error with the given id can be suppressed in config.\nIt returns an empty string.",
|
||||
"Args": [
|
||||
"id",
|
||||
"format",
|
||||
|
@ -3738,7 +3738,7 @@
|
|||
]
|
||||
},
|
||||
"Print": {
|
||||
"Description": "Print returns a string representation args.",
|
||||
"Description": "Print returns a string representation of args.",
|
||||
"Args": [
|
||||
"args"
|
||||
],
|
||||
|
@ -3753,7 +3753,7 @@
|
|||
]
|
||||
},
|
||||
"Printf": {
|
||||
"Description": "Printf returns a formatted string representation of args.",
|
||||
"Description": "Printf returns string representation of args formatted with the layouut in format.",
|
||||
"Args": [
|
||||
"format",
|
||||
"args"
|
||||
|
@ -3948,9 +3948,9 @@
|
|||
},
|
||||
"inflect": {
|
||||
"Humanize": {
|
||||
"Description": "Humanize returns the humanized form of a single parameter.\n\nIf the parameter is either an integer or a string containing an integer\nvalue, the behavior is to add the appropriate ordinal.\n\n Example: \"my-first-post\" -\u003e \"My first post\"\n Example: \"103\" -\u003e \"103rd\"\n Example: 52 -\u003e \"52nd\"",
|
||||
"Description": "Humanize returns the humanized form of v.\n\nIf v is either an integer or a string containing an integer\nvalue, the behavior is to add the appropriate ordinal.",
|
||||
"Args": [
|
||||
"in"
|
||||
"v"
|
||||
],
|
||||
"Aliases": [
|
||||
"humanize"
|
||||
|
@ -3975,9 +3975,9 @@
|
|||
]
|
||||
},
|
||||
"Pluralize": {
|
||||
"Description": "Pluralize returns the plural form of a single word.",
|
||||
"Description": "Pluralize returns the plural form of the single word in v.",
|
||||
"Args": [
|
||||
"in"
|
||||
"v"
|
||||
],
|
||||
"Aliases": [
|
||||
"pluralize"
|
||||
|
@ -3990,9 +3990,9 @@
|
|||
]
|
||||
},
|
||||
"Singularize": {
|
||||
"Description": "Singularize returns the singular form of a single word.",
|
||||
"Description": "Singularize returns the singular form of a single word in v.",
|
||||
"Args": [
|
||||
"in"
|
||||
"v"
|
||||
],
|
||||
"Aliases": [
|
||||
"singularize"
|
||||
|
|
2
go.mod
2
go.mod
|
@ -2,4 +2,4 @@ module github.com/gohugoio/hugoDocs
|
|||
|
||||
go 1.16
|
||||
|
||||
require github.com/gohugoio/gohugoioTheme v0.0.0-20221217122332-1c1752ad8f14 // indirect
|
||||
require github.com/gohugoio/gohugoioTheme v0.0.0-20230109120406-12694c4a9456 // indirect
|
||||
|
|
4
go.sum
4
go.sum
|
@ -49,3 +49,7 @@ github.com/gohugoio/gohugoioTheme v0.0.0-20221206093948-1408550ab675 h1:wjpYa1cT
|
|||
github.com/gohugoio/gohugoioTheme v0.0.0-20221206093948-1408550ab675/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20221217122332-1c1752ad8f14 h1:K6tPFpi7W0zb89QIf+lNdgdTXfDFemU6NKk46MlX9lQ=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20221217122332-1c1752ad8f14/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20221220160735-8ffa1ef883b6 h1:yEoQecRBoLGfc7yTybMD3Mhm03bTScZFYPvwe0p75vA=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20221220160735-8ffa1ef883b6/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230109120406-12694c4a9456 h1:RSLItaapVjWkqSdQhumAmJkodFDbWMGNZmkVW/AFx0c=
|
||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230109120406-12694c4a9456/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
|
||||
|
|
4
hugo.work
Normal file
4
hugo.work
Normal file
|
@ -0,0 +1,4 @@
|
|||
go 1.19
|
||||
|
||||
use .
|
||||
use ../gohugoioTheme
|
|
@ -3,7 +3,7 @@ publish = "public"
|
|||
command = "hugo --gc --minify"
|
||||
|
||||
[context.production.environment]
|
||||
HUGO_VERSION = "0.108.0"
|
||||
HUGO_VERSION = "0.109.0"
|
||||
HUGO_ENV = "production"
|
||||
HUGO_ENABLEGITINFO = "true"
|
||||
|
||||
|
@ -11,20 +11,20 @@ HUGO_ENABLEGITINFO = "true"
|
|||
command = "hugo --gc --minify --enableGitInfo"
|
||||
|
||||
[context.split1.environment]
|
||||
HUGO_VERSION = "0.108.0"
|
||||
HUGO_VERSION = "0.109.0"
|
||||
HUGO_ENV = "production"
|
||||
|
||||
[context.deploy-preview]
|
||||
command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
|
||||
|
||||
[context.deploy-preview.environment]
|
||||
HUGO_VERSION = "0.108.0"
|
||||
HUGO_VERSION = "0.109.0"
|
||||
|
||||
[context.branch-deploy]
|
||||
command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
|
||||
|
||||
[context.branch-deploy.environment]
|
||||
HUGO_VERSION = "0.108.0"
|
||||
HUGO_VERSION = "0.109.0"
|
||||
|
||||
[context.next.environment]
|
||||
HUGO_ENABLEGITINFO = "true"
|
||||
|
|
Loading…
Reference in a new issue