mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 23:38:53 +00:00
Formatting and grammar fixes (#1844)
This commit is contained in:
@@ -63,6 +63,7 @@
|
||||
"DATOCMS",
|
||||
"debugconfig",
|
||||
"defang",
|
||||
"Deindent",
|
||||
"DELIM",
|
||||
"dhersam",
|
||||
"digitalcraftsman",
|
||||
@@ -74,6 +75,7 @@
|
||||
"DRING",
|
||||
"Eiqc",
|
||||
"Eliott",
|
||||
"embeddable",
|
||||
"Emojify",
|
||||
"Enwrite",
|
||||
"eopkg",
|
||||
@@ -150,6 +152,7 @@
|
||||
"keycdn",
|
||||
"KEYVALS",
|
||||
"kubernetes",
|
||||
"Kubuntu",
|
||||
"Lanczos",
|
||||
"langformatnumber",
|
||||
"lastmod",
|
||||
@@ -157,6 +160,7 @@
|
||||
"linktitle",
|
||||
"Lipi",
|
||||
"lrwxr",
|
||||
"Lubuntu",
|
||||
"maingo",
|
||||
"markdownified",
|
||||
"markdownify",
|
||||
@@ -265,6 +269,7 @@
|
||||
"sitemapxml",
|
||||
"slugorfilename",
|
||||
"Smartcrop",
|
||||
"Sobre",
|
||||
"Sprintf",
|
||||
"Startseite",
|
||||
"strconv",
|
||||
@@ -314,6 +319,7 @@
|
||||
"Wowchemy",
|
||||
"wpxr",
|
||||
"Xbaabbab",
|
||||
"Xubuntu",
|
||||
"xvzf",
|
||||
"yoyoyo",
|
||||
"yunbox",
|
||||
|
||||
@@ -15,6 +15,7 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: streetsidesoftware/cspell-action@v2
|
||||
with:
|
||||
check_dot_files: false
|
||||
incremental_files_only: true
|
||||
inline: warning
|
||||
strict: false
|
||||
incremental_files_only: true
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
**/news/**
|
||||
**/showcase/**
|
||||
**/zh/**
|
||||
@@ -7,11 +7,11 @@ Documentation site for [Hugo](https://github.com/gohugoio/hugo), the very fast a
|
||||
|
||||
## Contributing
|
||||
|
||||
We welcome contributions to Hugo of any kind including documentation, suggestions, bug reports, pull requests etc. Also check out our [contribution guide](https://gohugo.io/contribute/documentation/). We would love to hear from you.
|
||||
We welcome contributions to Hugo of any kind including documentation, suggestions, bug reports, pull requests etc. Also check out our [contribution guide](https://gohugo.io/contribute/documentation/). We would love to hear from you.
|
||||
|
||||
Note that this repository contains solely the documentation for Hugo. For contributions that aren't documentation-related please refer to the [hugo](https://github.com/gohugoio/hugo) repository.
|
||||
Note that this repository contains solely the documentation for Hugo. For contributions that aren't documentation-related please refer to the [hugo](https://github.com/gohugoio/hugo) repository.
|
||||
|
||||
*Pull requests shall **only** contain changes to the actual documentation. However, changes on the code base of Hugo **and** the documentation shall be a single, atomic pull request in the [hugo](https://github.com/gohugoio/hugo) repository.*
|
||||
*Pull requests shall **only** contain changes to the actual documentation. However, changes on the codebase of Hugo **and** the documentation shall be a single, atomic pull request in the [hugo](https://github.com/gohugoio/hugo) repository.*
|
||||
|
||||
Spelling fixes are most welcomed, and if you want to contribute longer sections to the documentation, it would be great if you had the following criteria in mind when writing:
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ weight = 3
|
||||
|
||||
Anything not defined in a `languages` block will fall back to the global value for that key (e.g., `copyright` for the English `en` language). This also works for `params`, as demonstrated with `help` above: You will get the value `Aide` in French and `Help` in all the languages without this parameter set.
|
||||
|
||||
With the configuration above, all content, sitemap, RSS feeds, paginations,
|
||||
With the configuration above, all content, sitemap, RSS feeds, pagination,
|
||||
and taxonomy pages will be rendered below `/` in English (your default content language) and then below `/fr` in French.
|
||||
|
||||
When working with front matter `Params` in [single page templates], omit the `params` in the key for the translation.
|
||||
@@ -538,7 +538,6 @@ And do the appropriate changes in the menu code to use the `i18n` tag with the `
|
||||
{{- end }}
|
||||
</ul>
|
||||
{{< /code >}}
|
||||
|
||||
|
||||
## Missing Translations
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ hugo new <DOCS-SECTION>/<new-content-lowercase>.md
|
||||
|
||||
### Add a New Function
|
||||
|
||||
Once you have cloned the Hugo repository, you can create a new function via the following command. Keep the file name lowercase.
|
||||
Once you have cloned the Hugo repository, you can create a new function via the following command. Keep the filename lowercase.
|
||||
|
||||
```
|
||||
hugo new functions/newfunction.md
|
||||
@@ -94,7 +94,7 @@ Code blocks are crucial for providing examples of Hugo's new features to end use
|
||||
|
||||
### Standard Syntax
|
||||
|
||||
Across many pages on the Hugo docs, the typical triple-back-tick markdown syntax (```` ``` ````) is used. If you do not want to take the extra time to implement the following code block shortcodes, please use standard GitHub-flavored markdown. The Hugo docs use a version of [highlight.js](https://highlightjs.org/) with a specific set of languages.
|
||||
Across many pages on the Hugo docs, the typical triple-back-tick Markdown syntax (```` ``` ````) is used. If you do not want to take the extra time to implement the following code block shortcodes, please use standard GitHub-flavored Markdown. The Hugo docs use a version of [highlight.js](https://highlightjs.org/) with a specific set of languages.
|
||||
|
||||
Your options for languages are `xml`/`html`, `go`/`golang`, `md`/`markdown`/`mkd`, `handlebars`, `apache`, `toml`, `yaml`, `json`, `css`, `asciidoc`, `ruby`, `powershell`/`ps`, `scss`, `sh`/`zsh`/`bash`/`git`, `http`/`https`, and `javascript`/`js`.
|
||||
|
||||
@@ -125,7 +125,6 @@ A whole bunch of coding going on up in here!
|
||||
|
||||
The following are the arguments passed into `code`:
|
||||
|
||||
|
||||
***`file`***
|
||||
: the only *required* argument. `file` is needed for styling but also plays an important role in helping users create a mental model around Hugo's directory structure. Visually, this will be displayed as text in the top left of the code block.
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ linktitle: Get Started Overview
|
||||
description: Quick start and guides for installing Hugo on your preferred operating system.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [getting started]
|
||||
keywords: [usage,docs]
|
||||
menu:
|
||||
@@ -12,7 +11,6 @@ menu:
|
||||
parent: "getting-started"
|
||||
weight: 1
|
||||
weight: 0001 #rem
|
||||
draft: false
|
||||
aliases: [/overview/introduction/]
|
||||
toc: false
|
||||
---
|
||||
|
||||
@@ -79,7 +79,6 @@ Note that attributes in [code fences](/content-management/syntax-highlighting/#h
|
||||
autoHeadingIDType ("github") {{< new-in "0.62.2" >}}
|
||||
: The strategy used for creating auto IDs (anchor names). Available types are `github`, `github-ascii` and `blackfriday`. `github` produces GitHub-compatible IDs, `github-ascii` will drop any non-Ascii characters after accent normalization, and `blackfriday` will make the IDs compatible with [Blackfriday](#blackfriday), the default Markdown engine before Hugo 0.60. Note that if Goldmark is your default Markdown engine, this is also the strategy used in the [anchorize](/functions/anchorize/) template func.
|
||||
|
||||
|
||||
### Highlight
|
||||
|
||||
This is the default `highlight` configuration. Note that some of these settings can be set per code block, see [Syntax Highlighting](/content-management/syntax-highlighting/).
|
||||
@@ -108,8 +107,6 @@ endLevel
|
||||
ordered
|
||||
: Whether or not to generate an ordered list instead of an unordered list.
|
||||
|
||||
|
||||
## Markdown Render Hooks
|
||||
|
||||
See [Markdown Render Hooks](/templates/render-hooks/).
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ menu:
|
||||
weight: 60
|
||||
weight: 60
|
||||
sections_weight: 60
|
||||
draft: false
|
||||
aliases: [/overview/source-directory/,/overview/configuration/]
|
||||
toc: true
|
||||
---
|
||||
@@ -92,9 +91,8 @@ This is how you need to configure your `config.toml` files considering the above
|
||||
3. Similarly in `staging/config.toml` you just need to have one line:
|
||||
|
||||
```googleAnalytics = "G-SSSSSSSS"```
|
||||
|
||||
Now you need to tell Hugo that you are using the staging environment. So your build command should be `hugo --environment staging` which will load the `G-SSSSSSSS` analytics code in your staging website
|
||||
|
||||
Now you need to tell Hugo that you are using the staging environment. So your build command should be `hugo --environment staging` which will load the `G-SSSSSSSS` analytics code in your staging website
|
||||
|
||||
{{% note %}}
|
||||
Default environments are __development__ with `hugo server` and __production__ with `hugo`.
|
||||
@@ -125,7 +123,7 @@ The following is the full list of Hugo-defined variables with their default
|
||||
value in parentheses. Users may choose to override those values in their site
|
||||
config file(s).
|
||||
|
||||
### archetypeDir
|
||||
### archetypeDir
|
||||
|
||||
**Default value:** "archetypes"
|
||||
|
||||
@@ -304,18 +302,23 @@ See [Configure Languages](/content-management/multilingual/#configure-languages)
|
||||
See [Disable a Language](/content-management/multilingual/#disable-a-language)
|
||||
|
||||
### markup
|
||||
|
||||
See [Configure Markup](/getting-started/configuration-markup).{{< new-in "0.60.0" >}}
|
||||
|
||||
### mediaTypes
|
||||
|
||||
See [Configure Media Types](/templates/output-formats/#media-types).
|
||||
|
||||
### menus
|
||||
|
||||
See [Add Non-content Entries to a Menu](/content-management/menus/#add-non-content-entries-to-a-menu).
|
||||
|
||||
### minify
|
||||
|
||||
See [Configure Minify](#configure-minify)
|
||||
|
||||
### module
|
||||
|
||||
Module config see [Module Config](/hugo-modules/configuration/).{{< new-in "0.56.0" >}}
|
||||
|
||||
### newContentEditor
|
||||
@@ -382,6 +385,7 @@ Enable this to make all relative URLs relative to content root. Note that this d
|
||||
When using `ref` or `relref` to resolve page links and a link cannot resolved, it will be logged with this log level. Valid values are `ERROR` (default) or `WARNING`. Any `ERROR` will fail the build (`exit -1`).
|
||||
|
||||
### refLinksNotFoundURL
|
||||
|
||||
URL to be used as a placeholder when a page reference cannot be found in `ref` or `relref`. Is used as-is.
|
||||
|
||||
### removePathAccents
|
||||
@@ -394,7 +398,6 @@ Removes [non-spacing marks](https://www.compart.com/en/unicode/category/Mn) from
|
||||
content/post/hügó.md --> https://example.org/post/hugo/
|
||||
```
|
||||
|
||||
|
||||
### rssLimit
|
||||
|
||||
**Default value:** -1 (unlimited)
|
||||
@@ -402,6 +405,7 @@ content/post/hügó.md --> https://example.org/post/hugo/
|
||||
Maximum number of items in the RSS feed.
|
||||
|
||||
### sectionPagesMenu
|
||||
|
||||
See ["Section Menu for Lazy Bloggers"](/templates/menu-templates/#section-menu-for-lazy-bloggers).
|
||||
|
||||
### security
|
||||
@@ -409,6 +413,7 @@ See ["Section Menu for Lazy Bloggers"](/templates/menu-templates/#section-menu-f
|
||||
See [Security Policy](/about/security-model/#security-policy)
|
||||
|
||||
### sitemap
|
||||
|
||||
Default [sitemap configuration](/templates/sitemap-template/#configuration).
|
||||
|
||||
### summaryLength
|
||||
@@ -418,9 +423,11 @@ Default [sitemap configuration](/templates/sitemap-template/#configuration).
|
||||
The length of text in words to show in a [`.Summary`](/content-management/summaries/#automatic-summary-splitting).
|
||||
|
||||
### taxonomies
|
||||
|
||||
See [Configure Taxonomies](/content-management/taxonomies#configure-taxonomies).
|
||||
|
||||
### theme
|
||||
|
||||
: See [Module Config](/hugo-modules/configuration/#module-config-imports) for how to import a theme.
|
||||
|
||||
### themesDir
|
||||
@@ -429,19 +436,20 @@ See [Configure Taxonomies](/content-management/taxonomies#configure-taxonomies).
|
||||
|
||||
The directory where Hugo reads the themes from.
|
||||
|
||||
### timeout
|
||||
### timeout
|
||||
|
||||
**Default value:** "30s"
|
||||
|
||||
Timeout for generating page contents, specified as a [duration](https://pkg.go.dev/time#Duration) or in milliseconds. *Note:* this is used to bail out of recursive content generation. You might need to raise this limit if your pages are slow to generate (e.g., because they require large image processing or depend on remote contents).
|
||||
|
||||
### timeZone
|
||||
### timeZone
|
||||
|
||||
{{< new-in "0.87.0" >}}
|
||||
|
||||
The time zone (or location), e.g. `Europe/Oslo`, used to parse front matter dates without such information and in the [`time` function](/functions/time/). 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).
|
||||
|
||||
### title
|
||||
|
||||
Site title.
|
||||
|
||||
### titleCaseStyle
|
||||
@@ -648,7 +656,6 @@ ignoreFiles = ['^/home/user/project/content/test\.md$']
|
||||
|
||||
Dates are important in Hugo, and you can configure how Hugo assigns dates to your content pages. You do this by adding a `frontmatter` section to your `config.toml`.
|
||||
|
||||
|
||||
The default configuration is:
|
||||
|
||||
{{< code-toggle file="config" >}}
|
||||
|
||||
@@ -22,7 +22,7 @@ toc: true
|
||||
|
||||
{{< youtube sB0HLHjgQ7E >}}
|
||||
|
||||
Running the `hugo new site` generator from the command line will create a directory structure with the following elements:
|
||||
Running the `hugo new site` generator from the command-line will create a directory structure with the following elements:
|
||||
|
||||
```
|
||||
.
|
||||
@@ -36,14 +36,13 @@ Running the `hugo new site` generator from the command line will create a direct
|
||||
└── themes
|
||||
```
|
||||
|
||||
|
||||
## Directory Structure Explained
|
||||
|
||||
The following is a high-level overview of each of the directories with links to each of their respective sections within the Hugo docs.
|
||||
|
||||
[`archetypes`](/content-management/archetypes/)
|
||||
: You can create new content files in Hugo using the `hugo new` command.
|
||||
By default, Hugo will create new content files with at least `date`, `title` (inferred from the file name), and `draft = true`. This saves time and promotes consistency for sites using multiple content types. You can create your own [archetypes][] with custom preconfigured front matter fields as well.
|
||||
By default, Hugo will create new content files with at least `date`, `title` (inferred from the filename), and `draft = true`. This saves time and promotes consistency for sites using multiple content types. You can create your own [archetypes][] with custom preconfigured front matter fields as well.
|
||||
|
||||
[`assets`][]
|
||||
: Stores all the files which need be processed by [Hugo Pipes](/hugo-pipes/). Only the files whose `.Permalink` or `.RelPermalink` are used will be published to the `public` directory. Note: assets directory is not created by default.
|
||||
@@ -73,7 +72,7 @@ From **Hugo 0.31** you can have multiple static directories.
|
||||
{{% /note %}}
|
||||
|
||||
[`resources`][]
|
||||
: Caches some files to speed up generation. Can be also used by template authors to distribute built SASS files, so you don't have to have the preprocessor installed. Note: resources directory is not created by default.
|
||||
: Caches some files to speed up generation. Can be also used by template authors to distribute built Sass files, so you don't have to have the preprocessor installed. Note: resources directory is not created by default.
|
||||
|
||||
[archetypes]: /content-management/archetypes/
|
||||
[`assets`]: /hugo-pipes/introduction#asset-directory/
|
||||
|
||||
@@ -34,11 +34,10 @@ Hugo in Action is a step-by-step guide to using Hugo to create static websites.
|
||||
|
||||
### Hugo tutorial by CloudCannon
|
||||
|
||||
[Step-by-step written tutorial](https://cloudcannon.com/community/learn/hugo-101/) to teach you the basics of creating a Hugo site.
|
||||
[Step-by-step written tutorial](https://cloudcannon.com/community/learn/hugo-101/) to teach you the basics of creating a Hugo site.
|
||||
|
||||
## Video tutorials
|
||||
|
||||
* Mike Dane explains the various features of Hugo via dedicated tutorials on [YouTube](https://www.youtube.com/watch?list=PLLAZ4kZ9dFpOnyRlyS-liKL5ReHDcj4G3&v=qtIqKaDlqXo).
|
||||
|
||||
* [Introduction to building your first Hugo site](https://cloudcannon.com/community/learn/hugo-beginner-tutorial/
|
||||
) by Mike Neumegen.
|
||||
* [Introduction to building your first Hugo site](https://cloudcannon.com/community/learn/hugo-beginner-tutorial/) by Mike Neumegen.
|
||||
|
||||
@@ -143,7 +143,7 @@ Remove `--tags extended` if you do not want/need Sass/SCSS support.
|
||||
|
||||
1. You know how to open the macOS terminal.
|
||||
2. You're running a modern 64-bit Mac.
|
||||
3. You will use `~/Sites` as the starting point for your site. (`~/Sites` is used for example purposes. If you are familiar enough with the command line and file system, you should have no issues following along with the instructions.)
|
||||
3. You will use `~/Sites` as the starting point for your site. (`~/Sites` is used for example purposes. If you are familiar enough with the command-line and file system, you should have no issues following along with the instructions.)
|
||||
|
||||
### Pick Your Method
|
||||
|
||||
@@ -161,12 +161,12 @@ There are pros and cons to each of the aforementioned methods:
|
||||
|
||||
1. **Package Manager.** Using a package manager is the simplest method and will require the least amount of work to maintain. The drawbacks aren't severe. The default package will be for the most recent release, so it will not have bug fixes until the next release (i.e., unless you install it with the `--HEAD` option in Homebrew). Releases may lag a few days behind because it has to be coordinated with another team. Nevertheless, this is the recommended installation method if you want to work from a stable, widely used source. Package managers work well and they are easy to update.
|
||||
|
||||
2. **Tarball.** Downloading and installing from the tarball is also easy, although it requires a few more command line skills than does Homebrew. Updates are easy as well: you just repeat the process with the new binary. This gives you the flexibility to have multiple versions on your computer. If you don't want to use `brew`, then the tarball/binary is a good choice.
|
||||
2. **Tarball.** Downloading and installing from the tarball is also easy, although it requires a few more command-line skills than does Homebrew. Updates are easy as well: you just repeat the process with the new binary. This gives you the flexibility to have multiple versions on your computer. If you don't want to use `brew`, then the tarball/binary is a good choice.
|
||||
|
||||
3. **Building from Source.** Building from source is the most work. The advantage of building from source is that you don't have to wait for a release to add features or bug fixes. The disadvantage is that you need to spend more time managing the setup, which is manageable but requires more time than the preceding two options.
|
||||
|
||||
{{% note %}}
|
||||
Since building from source is appealing to more seasoned command line users, this guide will focus more on installing Hugo via Homebrew and Tarball.
|
||||
Since building from source is appealing to more seasoned command-line users, this guide will focus more on installing Hugo via Homebrew and Tarball.
|
||||
{{% /note %}}
|
||||
|
||||
### Install Hugo with Brew
|
||||
@@ -384,7 +384,7 @@ You'll need a place to store the Hugo executable, your [content][], and the gene
|
||||
|
||||
1. Download the latest zipped Hugo executable from [Hugo Releases][releases].
|
||||
2. Extract all contents to your `..\Hugo\bin` folder.
|
||||
3. Open Windows Command Line (cmd, "DOS") to add the `hugo.exe` executable to your PATH
|
||||
3. Open Windows command-line (cmd, "DOS") to add the `hugo.exe` executable to your PATH
|
||||
* do `set PATH=%PATH%;C:\Hugo\bin` to have hugo in PATH for the currently opened cmd box
|
||||
* do `setx PATH "%PATH%;C:\Hugo\bin"` to have hugo in PATH for every newly opened cmd box
|
||||
* note: "setx", not "set", plus syntax 'key "val"', not 'key=val'
|
||||
|
||||
@@ -105,7 +105,7 @@ hugo && rsync -avz --delete public/ ${USER}@${HOST}:~/${DIR}
|
||||
exit 0
|
||||
```
|
||||
|
||||
Note that `DIR` is the relative path from the remote user's home. If you have to specify a full path (for instance `/var/www/mysite/`) you must change `~/${DIR}` to `${DIR}` inside the command line. For most cases you should not have to.
|
||||
Note that `DIR` is the relative path from the remote user's home. If you have to specify a full path (for instance `/var/www/mysite/`) you must change `~/${DIR}` to `${DIR}` inside the command-line. For most cases you should not have to.
|
||||
|
||||
Save and close, and make the `deploy` file executable:
|
||||
|
||||
|
||||
@@ -53,5 +53,4 @@ If you need to use a different, perhaps newer, version of Hugo than the version
|
||||
1. From the selection, click **Hugo** and ensure the version field says `latest`
|
||||
1. Click **Save** to save the changes.
|
||||
|
||||
|
||||
[Quick Start]: /getting-started/quick-start/
|
||||
|
||||
@@ -25,7 +25,6 @@ Since Hugo `0.42` a project can configure a theme as a composite of as many them
|
||||
theme = ["my-shortcodes", "base-theme", "hyde"]
|
||||
{{< /code-toggle >}}
|
||||
|
||||
|
||||
You can even nest this, and have the theme component itself include theme components in its own `config.toml` (theme inheritance).[^1]
|
||||
|
||||
The theme definition example above in `config.toml` creates a theme with 3 theme components with precedence from left to right.
|
||||
@@ -47,8 +46,4 @@ Also note that a component that is part of a theme can have its own configuratio
|
||||
|
||||
The same rules apply here: The left-most param/menu etc. with the same ID will win. There are some hidden and experimental namespace support in the above, which we will work to improve in the future, but theme authors are encouraged to create their own namespaces to avoid naming conflicts.
|
||||
|
||||
|
||||
[^1]: For themes hosted on the [Hugo Themes Showcase](https://themes.gohugo.io/) components need to be added as git submodules that point to the directory `exampleSite/themes`
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -20,8 +20,6 @@ toc: true
|
||||
|
||||
{{< gomodules-info >}}
|
||||
|
||||
|
||||
|
||||
## Initialize a New Module
|
||||
|
||||
Use `hugo mod init` to initialize a new Hugo Module. If it fails to guess the module path, you must provide it as an argument, e.g.:
|
||||
@@ -33,6 +31,7 @@ hugo mod init github.com/gohugoio/myShortcodes
|
||||
Also see the [CLI Doc](/commands/hugo_mod_init/).
|
||||
|
||||
## Use a Module for a Theme
|
||||
|
||||
The easiest way to use a Module for a theme is to import it in the config.
|
||||
|
||||
1. Initialize the hugo module system: `hugo mod init github.com/<your_user>/<your_project>`
|
||||
@@ -71,6 +70,7 @@ hugo mod get -u ./...
|
||||
```bash
|
||||
hugo mod get -u github.com/gohugoio/myShortcodes
|
||||
```
|
||||
|
||||
### Get a Specific Version
|
||||
|
||||
```bash
|
||||
@@ -125,7 +125,6 @@ Note that:
|
||||
|
||||
Also see the [CLI Doc](/commands/hugo_mod_vendor/).
|
||||
|
||||
|
||||
## Tidy go.mod, go.sum
|
||||
|
||||
Run `hugo mod tidy` to remove unused entries in `go.mod` and `go.sum`.
|
||||
@@ -138,6 +137,4 @@ 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/).
|
||||
|
||||
@@ -3,7 +3,6 @@ title: Babel
|
||||
description: Hugo Pipes can process JS files with Babel.
|
||||
date: 2019-03-21
|
||||
publishdate: 2019-03-21
|
||||
lastmod: 2019-03-21
|
||||
categories: [asset management]
|
||||
keywords: []
|
||||
menu:
|
||||
@@ -12,7 +11,6 @@ menu:
|
||||
weight: 48
|
||||
weight: 48
|
||||
sections_weight: 48
|
||||
draft: false
|
||||
---
|
||||
|
||||
Any JavaScript resource file can be transpiled to another JavaScript version using `resources.Babel` which takes for argument the resource object and an optional dict of options listed below. Babel uses the [babel cli](https://babeljs.io/docs/en/babel-cli).
|
||||
@@ -46,8 +44,6 @@ module.exports = {
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Options
|
||||
|
||||
config [string]
|
||||
|
||||
@@ -3,7 +3,6 @@ title: Fingerprinting and SRI
|
||||
description: Hugo Pipes allows Fingerprinting and Subresource Integrity.
|
||||
date: 2018-07-14
|
||||
publishdate: 2018-07-14
|
||||
lastmod: 2018-07-14
|
||||
categories: [asset management]
|
||||
keywords: []
|
||||
menu:
|
||||
@@ -12,10 +11,8 @@ menu:
|
||||
weight: 70
|
||||
weight: 70
|
||||
sections_weight: 70
|
||||
draft: false
|
||||
---
|
||||
|
||||
|
||||
Fingerprinting and [SRI](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) can be applied to any asset file using `resources.Fingerprint` which takes two arguments, the resource object and a [hash function](https://en.wikipedia.org/wiki/Cryptographic_hash_function).
|
||||
|
||||
The default hash function is `sha256`. Other available functions are `sha384` (from Hugo `0.55`), `sha512` and `md5`.
|
||||
|
||||
@@ -3,7 +3,6 @@ title: JavaScript Building
|
||||
description: Hugo Pipes can process JavaScript files with [ESBuild](https://github.com/evanw/esbuild).
|
||||
date: 2020-07-20
|
||||
publishdate: 2020-07-20
|
||||
lastmod: 2020-07-20
|
||||
categories: [asset management]
|
||||
keywords: []
|
||||
menu:
|
||||
@@ -20,7 +19,7 @@ Any JavaScript resource file can be transpiled and "tree shaken" using `js.Build
|
||||
### Options
|
||||
|
||||
targetPath [string]
|
||||
: If not set, the source path will be used as the base target path.
|
||||
: If not set, the source path will be used as the base target path.
|
||||
Note that the target path's extension may change if the target MIME type is different, e.g. when the source is TypeScript.
|
||||
|
||||
params [map or slice] {{< new-in "0.78.0" >}}
|
||||
@@ -29,11 +28,11 @@ params [map or slice] {{< new-in "0.78.0" >}}
|
||||
```go-html-template
|
||||
{{ $js := resources.Get "js/main.js" | js.Build (dict "params" (dict "api" "https://example.org/api")) }}
|
||||
```
|
||||
And then in your JS file:
|
||||
And then in your JS file:
|
||||
|
||||
```js
|
||||
import * as params from '@params';
|
||||
```
|
||||
```
|
||||
|
||||
Note that this is meant for small data sets, e.g. config settings. For larger data, please put/mount the files into `/assets` and import them directly.
|
||||
|
||||
@@ -63,7 +62,6 @@ module.exports = window.React;
|
||||
module.exports = window.ReactDOM;
|
||||
```
|
||||
|
||||
|
||||
With the above, these imports should work in both scenarios:
|
||||
|
||||
```js
|
||||
@@ -97,7 +95,7 @@ format [string] {{< new-in "0.74.3" >}}
|
||||
Default is `iife`, a self-executing function, suitable for inclusion as a <script> tag.
|
||||
|
||||
sourceMap
|
||||
: Whether to generate `inline` or `external` sourcemap from esbuild. External sourcemaps will be written to the target with the output file name + ".map". Input sourcemaps can be read from js.Build and node modules and combined into the output sourcemaps.
|
||||
: Whether to generate `inline` or `external` sourcemap from esbuild. External sourcemaps will be written to the target with the output filename + ".map". Input sourcemaps can be read from js.Build and node modules and combined into the output sourcemaps.
|
||||
|
||||
### Import JS code from /assets
|
||||
|
||||
@@ -129,14 +127,14 @@ For other files (e.g. `JSON`, `CSS`) you need to use the relative path including
|
||||
import * as data from 'my/module/data.json';
|
||||
```
|
||||
|
||||
Any imports in a file outside `/assets` or that does not resolve to a component inside `/assets` will be resolved by [ESBuild](https://esbuild.github.io/) with the **project directory** as the resolve directory (used as the starting point when looking for `node_modules` etc.). Also see [hugo mod npm pack](/commands/hugo_mod_npm_pack/). If you have any imported NPM dependencies in your project, you need to make sure to run `npm install` before you run `hugo`.
|
||||
Any imports in a file outside `/assets` or that does not resolve to a component inside `/assets` will be resolved by [ESBuild](https://esbuild.github.io/) with the **project directory** as the resolve directory (used as the starting point when looking for `node_modules` etc.). Also see [hugo mod npm pack](/commands/hugo_mod_npm_pack/). If you have any imported npm dependencies in your project, you need to make sure to run `npm install` before you run `hugo`.
|
||||
|
||||
Also note the new `params` option that can be passed from template to your JS files, e.g.:
|
||||
|
||||
```go-html-template
|
||||
{{ $js := resources.Get "js/main.js" | js.Build (dict "params" (dict "api" "https://example.org/api")) }}
|
||||
```
|
||||
And then in your JS file:
|
||||
And then in your JS file:
|
||||
|
||||
```js
|
||||
import * as params from '@params';
|
||||
@@ -145,14 +143,13 @@ import * as params from '@params';
|
||||
Hugo will, by default, generate a `assets/jsconfig.json` file that maps the imports. This is useful for navigation/intellisense help inside code editors, but if you don't need/want it, you can [turn it off](/getting-started/configuration/#configure-build).
|
||||
|
||||
|
||||
|
||||
### Include Dependencies In package.json / node_modules
|
||||
|
||||
Any imports in a file outside `/assets` or that does not resolve to a component inside `/assets` will be resolved by [ESBuild](https://esbuild.github.io/) with the **project directory** as the resolve directory (used as the starting point when looking for `node_modules` etc.). Also see [hugo mod npm pack](/commands/hugo_mod_npm_pack/). If you have any imported NPM dependencies in your project, you need to make sure to run `npm install` before you run `hugo`.
|
||||
Any imports in a file outside `/assets` or that does not resolve to a component inside `/assets` will be resolved by [ESBuild](https://esbuild.github.io/) with the **project directory** as the resolve directory (used as the starting point when looking for `node_modules` etc.). Also see [hugo mod npm pack](/commands/hugo_mod_npm_pack/). If you have any imported npm dependencies in your project, you need to make sure to run `npm install` before you run `hugo`.
|
||||
|
||||
{{< new-in "0.78.1" >}} From Hugo `0.78.1` the start directory for resolving NPM packages (aka. packages that live inside a `node_modules` folder) is always the main project folder.
|
||||
{{< new-in "0.78.1" >}} From Hugo `0.78.1` the start directory for resolving npm packages (aka. packages that live inside a `node_modules` folder) is always the main project folder.
|
||||
|
||||
**Note:** If you're developing a theme/component that is supposed to be imported and depends on dependencies inside `package.json`, we recommend reading about [hugo mod npm pack](/commands/hugo_mod_npm_pack/), a tool to consolidate all the NPM dependencies in a project.
|
||||
**Note:** If you're developing a theme/component that is supposed to be imported and depends on dependencies inside `package.json`, we recommend reading about [hugo mod npm pack](/commands/hugo_mod_npm_pack/), a tool to consolidate all the npm dependencies in a project.
|
||||
|
||||
|
||||
### Examples
|
||||
@@ -171,5 +168,3 @@ Or with options:
|
||||
{{ $built := resources.Get "scripts/main.js" | js.Build $opts }}
|
||||
<script type="text/javascript" src="{{ $built.RelPermalink }}" defer></script>
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ title: PostCSS
|
||||
description: Hugo Pipes can process CSS files with PostCSS.
|
||||
date: 2018-07-14
|
||||
publishdate: 2018-07-14
|
||||
lastmod: 2018-07-14
|
||||
categories: [asset management]
|
||||
keywords: []
|
||||
menu:
|
||||
@@ -12,10 +11,9 @@ menu:
|
||||
weight: 40
|
||||
weight: 40
|
||||
sections_weight: 40
|
||||
draft: false
|
||||
---
|
||||
|
||||
Any asset file can be processed using `resources.PostCSS` which takes for argument the resource object and a slice of options listed below.
|
||||
Any asset file can be processed using `resources.PostCSS` which takes for argument the resource object and a slice of options listed below.
|
||||
|
||||
The resource will be processed using the project's or theme's own `postcss.config.js` or any file set with the `config` option.
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
---
|
||||
title: SASS / SCSS
|
||||
description: Hugo Pipes allows the processing of SASS and SCSS files.
|
||||
title: Sass / SCSS
|
||||
description: Hugo Pipes allows the processing of Sass and SCSS files.
|
||||
date: 2018-07-14
|
||||
publishdate: 2018-07-14
|
||||
lastmod: 2018-07-14
|
||||
categories: [asset management]
|
||||
keywords: []
|
||||
menu:
|
||||
@@ -12,10 +11,8 @@ menu:
|
||||
weight: 30
|
||||
weight: 02
|
||||
sections_weight: 02
|
||||
draft: false
|
||||
---
|
||||
|
||||
|
||||
Any Sass or SCSS file can be transformed into a CSS file using `resources.ToCSS` which takes two arguments, the resource object and a map of options listed below.
|
||||
|
||||
```go-html-template
|
||||
@@ -50,5 +47,5 @@ includePaths [string slice]
|
||||
```
|
||||
|
||||
{{% note %}}
|
||||
Setting `outputStyle` to `compressed` will handle SASS/SCSS files minification better than the more generic [`resources.Minify`]({{< ref "minification">}}).
|
||||
Setting `outputStyle` to `compressed` will handle Sass/SCSS files minification better than the more generic [`resources.Minify`]({{< ref "minification">}}).
|
||||
{{% /note %}}
|
||||
|
||||
@@ -13,7 +13,7 @@ Through collaboration in our communities of practice, Digital.gov is a window in
|
||||
Digital.gov is built using the [U.S. Web Design System](https://designsystem.digital.gov/) (USWDS) and have followed the [design principles](https://designsystem.digital.gov/maturity-model/) in building out our new site:
|
||||
|
||||
- **Start with real user needs** — We used human-centered design methods to inform our product decisions (like qualitative user research), and gathered feedback from real users. We also continually test our assumptions with small experiments.
|
||||
- **Earn trust** —We recognize that trust has to be earned every time. We are including all [required links and content](https://digital.gov/resources/required-web-content-and-links/) on our site, clearly identifying as a government site, building with modern best practices, and using https.
|
||||
- **Earn trust** —We recognize that trust has to be earned every time. We are including all [required links and content](https://digital.gov/resources/required-web-content-and-links/) on our site, clearly identifying as a government site, building with modern best practices, and using HTTPS.
|
||||
- **Embrace accessibility** — [Accessibility](https://digital.gov/resources/intro-accessibility/) affects everybody, and we built it into every decision. We’re continually working to conform to Section 508 requirements, use user experience best practices, and support a wide range of devices.
|
||||
- **Promote continuity** — We started from shared solutions like USWDS and [Federalist](https://federalist.18f.gov/). We designed our site to clearly identify as a government site by including USWDS’s .gov banner, common colors and patterns, and built with modern best practices.
|
||||
- **Listen** — We actively collect user feedback and web metrics. We use the [Digital Analytics Program](https://digital.gov/services/dap/) (DAP) and analyze the data to discover actionable insights. We make small, incremental changes to continuously improve our website by listening to readers and learning from what we hear.
|
||||
|
||||
@@ -14,4 +14,4 @@ After careful consideration of JavaScript/JSX-based static site generators, it b
|
||||
- **Composability.** Hugo's partial and shortcode systems empower us to write DRY and maintainable templates.
|
||||
- **Simplicity.** Hugo is easy to learn (even without Go experience) and doesn't burden us with brittle dependencies.
|
||||
|
||||
The site is able to achieve Lighthouse performance scores of 95+, despite the fact that it is a fully interactive PWA that ships Angular and Firebase in the JS bundle. This is made possible by (1) prerendering content with Hugo and (2) lazily embedding native web components directly in the HTML and markdown. We provide a [detailed explanation](https://youtu.be/gun8OiGtlNc) of the architecture on YouTube and can't imagine development without Hugo.
|
||||
The site is able to achieve Lighthouse performance scores of 95+, despite the fact that it is a fully interactive PWA that ships Angular and Firebase in the JS bundle. This is made possible by (1) prerendering content with Hugo and (2) lazily embedding native web components directly in the HTML and Markdown. We provide a [detailed explanation](https://youtu.be/gun8OiGtlNc) of the architecture on YouTube and can't imagine development without Hugo.
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
Forestry.io is a Git-backed CMS (content management system) for websites and web products built using static site generators such as Hugo.
|
||||
Forestry.io is a Git-backed CMS (content management system) for websites and web products built using static site generators such as Hugo.
|
||||
|
||||
Forestry bridges the gap between developers and their teams, by making development fun and easy, while providing powerful content management for their teams.
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
|
||||
[Godot Tutorials](https://godottutorials.com) aims to teach beginners how to get up and running with basic game programming and game development skills.
|
||||
|
||||
The website is built with the **Hugo Framework** alongside aws+cloudfront+lambda.
|
||||
|
||||
The site is built by:
|
||||
|
||||
* [Godot Tutorials](https://godottutorials.com)
|
||||
|
||||
- [Godot Tutorials](https://godottutorials.com)
|
||||
|
||||
@@ -15,11 +15,11 @@ byline: "[Godot Tutorials](https://godottutorials.com), Web Developer & Game Pro
|
||||
|
||||
|
||||
[Godot Tutorials](https://godottutorials.com) started as a way to teach beginners game programming and game development.
|
||||
As I created videos, I ran into a problem; if I made a mistake with a Youtube video, it was difficult to correct errors.
|
||||
As I created videos, I ran into a problem; if I made a mistake with a YouTube video, it was difficult to correct errors.
|
||||
|
||||
I discovered that blogging episodes and having articles that teach on top of my videos is a fantastic solution to my problem.
|
||||
|
||||
As I researched blogging platforms, I came across two solutions; however, I chose [Hugo](https://gohugo.io) because it's built with markdown in mind and simplified my workflow.
|
||||
As I researched blogging platforms, I came across two solutions; however, I chose [Hugo](https://gohugo.io) because it's built with Markdown in mind and simplified my workflow.
|
||||
|
||||
In a sense, with [Hugo](https://gohugo.io) programmed the right way, I can focus **more time on planning, creating, and editing**
|
||||
my videos and **less time maintaining and fixing** my website.
|
||||
@@ -20,7 +20,7 @@ It’s a multi-page, single-page (!) website written in Hugo, a static site gene
|
||||
|
||||
There’s no Apache or Node backend that does compilation at runtime, it’s all done at the build step. This means the server; Netlify in this case, only has to do one thing – serve files. Unsurprisingly, serving simple files is VERY quick.
|
||||
|
||||
The starter point was the [Victor Hugo](https://github.com/netlify/victor-hugo) repository that Netlify have created. It let me dive in with Hugo, PostCSS, BrowserSync and ES6 without setting up any tooling myself – always a win!
|
||||
The starter point was the [Victor Hugo](https://github.com/netlify/victor-hugo) repository that Netlify have created. It let me dive in with Hugo, PostCSS, Browsersync and ES6 without setting up any tooling myself – always a win!
|
||||
|
||||
I then took all the content from the design file and moved it into Markdown, putting shortcodes in where necessary. This site did need a number of custom shortcodes for the presentational elements like the expanding circles and full width backgrounds. But mostly it was just clean, semantic HTML with some CSS and JS enhancement thrown in.
|
||||
|
||||
|
||||
@@ -18,13 +18,13 @@ Application development has become increasingly complex and there is a strong mo
|
||||
|
||||
Libraries like React make this easy, but we also wanted something that was server rendered. This led us to look at React based tools for static site generation such as GatsbyJS. We liked GatsbyJS, but in the end, we didn’t choose it due to the lack of availability of a simple CMS driven data source.
|
||||
|
||||
For this, we considered Contentful. Contentful is a beautifully designed application. It’s basically a headless CMS, but it’s not specifically designed for websites and it becomes quite expensive at a commercial level. Their free tier is possibly a good option for personal sites especially with Gatsby. We also evaluated prose.io. This is a free service for editing markdown files in a GitHub repository. It works well, but it’s quite basic and didn’t provide the editing experience we were looking for.
|
||||
For this, we considered Contentful. Contentful is a beautifully designed application. It’s basically a headless CMS, but it’s not specifically designed for websites and it becomes quite expensive at a commercial level. Their free tier is possibly a good option for personal sites especially with Gatsby. We also evaluated prose.io. This is a free service for editing Markdown files in a GitHub repository. It works well, but it’s quite basic and didn’t provide the editing experience we were looking for.
|
||||
|
||||
At the same time, we started exploring Hugo. Hugo is a static site generator similar to Jekyll, but it’s written in Go. It has excellent support and integration with Netlify and we were immediately blown away by how fast it was.
|
||||
|
||||
We had been closely following the redevelopment of the Smashing Magazine website. We knew this was being powered by Hugo and Netlify and this showed us that Hugo could work for a large scale sites.
|
||||
|
||||
The deciding factor, however, was the availability of CMS options that integrate well with Hugo. Netlify has an open source project called NetlifyCMS and there are also hosted services like Forestry.io. These both provide a CMS with an editing interface for markdown files and images. There is no database, instead, changes are committed directly back into the GitHub repository.
|
||||
The deciding factor, however, was the availability of CMS options that integrate well with Hugo. Netlify has an open source project called NetlifyCMS and there are also hosted services like Forestry.io. These both provide a CMS with an editing interface for Markdown files and images. There is no database, instead, changes are committed directly back into the GitHub repository.
|
||||
|
||||
In the end, we chose Hugo on Netlify, with Forestry as our CMS. The site is built and redeployed immediately with Netlify watching for changes to the GitHub repository.
|
||||
|
||||
@@ -40,7 +40,7 @@ NetlifyCMS was also very new when we first looked at it and this is partly why w
|
||||
|
||||
Fortunately, the site is more portable now than it was, or would have been with a dynamic CMS like WordPress, or a fully hosted service like SquareSpace. It should be comparatively easy to swap the publishing functions from Forestry to NetlifyCMS or to change the templates. No part of the pipe-line is tightly coupled, the hosting, the CMS and the templates and the build process can all be updated independently, without changing anything else.
|
||||
|
||||
We have complete control over the design and mark-up produced. This means we can implement a better responsive design and have a stronger focus on accessibility and performance.
|
||||
We have complete control over the design and markup produced. This means we can implement a better responsive design and have a stronger focus on accessibility and performance.
|
||||
|
||||
These technology choices gave us a good performance baseline. It was important to implement a site that took advantage of this. As a data visualisation agency, it can be difficult to optimise for performance with a small bundle size, while also aiming for high-quality visuals and working with large datasets. This meant we spent a lot of time optimising assets making sure there was little blocking the critical path for faster rendering and lazy-load images and videos.
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ With the command-line flag `--cacheDir`, you can specify any folder on your syst
|
||||
|
||||
You can also set `cacheDir` in the [main configuration file][config].
|
||||
|
||||
If you don't like caching at all, you can fully disable caching with the command line flag `--ignoreCache`.
|
||||
If you don't like caching at all, you can fully disable caching with the command-line flag `--ignoreCache`.
|
||||
|
||||
### Authentication When Using REST URLs
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ To enable this menu, configure `sectionPagesMenu` in your site `config`:
|
||||
sectionPagesMenu = "main"
|
||||
```
|
||||
|
||||
The menu name can be anything, but take a note of what it is.
|
||||
The menu name can be anything, but take a note of what it is.
|
||||
|
||||
This will create a menu with all the sections as menu items and all the sections' pages as "shadow-members". Ensure that all first level directories that you would like to show up on this menu are [Branch Bundles](https://gohugo.io/content-management/sections/). Leaf Bundles do not form sections.
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ linktitle: Editor Plug-ins
|
||||
description: The Hugo community uses a wide range of preferred tools and has developed plug-ins for some of the most popular text editors to help automate parts of your workflow.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [developer tools]
|
||||
keywords: [editor, plug-ins]
|
||||
menu:
|
||||
@@ -36,7 +35,7 @@ The Hugo community uses a wide range of preferred tools and has developed plug-i
|
||||
## Emacs
|
||||
|
||||
* [emacs-easy-hugo](https://github.com/masasam/emacs-easy-hugo). Emacs major mode for managing hugo blogs. Note that Hugo also supports [Org-mode][formats].
|
||||
* [ox-hugo.el](https://ox-hugo.scripter.co). Native Org-mode exporter that exports to Blackfriday Markdown with Hugo front-matter. `ox-hugo` supports two common Org blogging flows --- exporting multiple Org sub-trees in a single file to multiple Hugo posts, and exporting a single Org file to a single Hugo post. It also leverages the Org tag and property inheritance features. See [*Why ox-hugo?*](https://ox-hugo.scripter.co/doc/why-ox-hugo/) for more.
|
||||
* [ox-hugo.el](https://ox-hugo.scripter.co). Native Org-mode exporter that exports to Blackfriday Markdown with Hugo front-matter. `ox-hugo` supports two common Org blogging flows --- exporting multiple Org subtrees in a single file to multiple Hugo posts, and exporting a single Org file to a single Hugo post. It also leverages the Org tag and property inheritance features. See [*Why ox-hugo?*](https://ox-hugo.scripter.co/doc/why-ox-hugo/) for more.
|
||||
|
||||
## Vim
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ description: A list of community-developed tools for migrating from your existin
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2022-03-26
|
||||
keywords: [migrations,jekyll,wordpress,drupal,ghost,contentful]
|
||||
keywords: [migrations, jekyll, wordpress, drupal, ghost, contentful]
|
||||
menu:
|
||||
docs:
|
||||
parent: "tools"
|
||||
@@ -13,7 +13,7 @@ menu:
|
||||
weight: 10
|
||||
sections_weight: 10
|
||||
draft: false
|
||||
aliases: [/developer-tools/migrations/,/developer-tools/migrated/]
|
||||
aliases: [/developer-tools/migrations/, /developer-tools/migrated/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
@@ -80,7 +80,6 @@ Alternatively, you can use the new [Jekyll import command](/commands/hugo_import
|
||||
|
||||
- [contentful2hugo](https://github.com/ArnoNuyts/contentful2hugo) - A tool to create content-files for Hugo from content on [Contentful](https://www.contentful.com/).
|
||||
|
||||
|
||||
## BlogML
|
||||
|
||||
- [BlogML2Hugo](https://github.com/jijiechen/BlogML2Hugo) - A tool that helps you convert BlogML xml file to Hugo markdown files. Users need to take care of links to attachments and images by themselves. This helps the blogs that export BlogML files (e.g. BlogEngine.NET) transform to hugo sites easily.
|
||||
- [BlogML2Hugo](https://github.com/jijiechen/BlogML2Hugo) - A tool that helps you convert BlogML xml file to Hugo Markdown files. Users need to take care of links to attachments and images by themselves. This helps the blogs that export BlogML files (e.g. BlogEngine.NET) transform to hugo sites easily.
|
||||
|
||||
@@ -20,9 +20,9 @@ A static website with a dynamic search function? Yes, Hugo provides an alternati
|
||||
|
||||
* [GitHub Gist for Hugo Workflow](https://gist.github.com/sebz/efddfc8fdcb6b480f567). This gist contains a simple workflow to create a search index for your static website. It uses a simple Grunt script to index all your content files and [lunr.js](https://lunrjs.com/) to serve the search results.
|
||||
|
||||
* [hugo-lunr](https://www.npmjs.com/package/hugo-lunr). A simple way to add site search to your static Hugo site using [lunr.js](https://lunrjs.com/). Hugo-lunr will create an index file of any html and markdown documents in your Hugo project.
|
||||
* [hugo-lunr](https://www.npmjs.com/package/hugo-lunr). A simple way to add site search to your static Hugo site using [lunr.js](https://lunrjs.com/). Hugo-lunr will create an index file of any HTML and Markdown documents in your Hugo project.
|
||||
* [hugo-lunr-zh](https://www.npmjs.com/package/hugo-lunr-zh). A bit like Hugo-lunr, but Hugo-lunr-zh can help you separate the Chinese keywords.
|
||||
* [GitHub Gist for Fuse.js integration](https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1cb41ae). This gist demonstrates how to leverage Hugo's existing build time processing to generate a searchable JSON index used by [Fuse.js](https://fusejs.io/) on the client side. Although this gist uses Fuse.js for fuzzy matching, any client side search tool capable of reading JSON indexes will work. Does not require npm, grunt or other build-time tools except Hugo!
|
||||
* [GitHub Gist for Fuse.js integration](https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1cb41ae). This gist demonstrates how to leverage Hugo's existing build time processing to generate a searchable JSON index used by [Fuse.js](https://fusejs.io/) on the client-side. Although this gist uses Fuse.js for fuzzy matching, any client-side search tool capable of reading JSON indexes will work. Does not require npm, grunt or other build-time tools except Hugo!
|
||||
* [hugo-search-index](https://www.npmjs.com/package/hugo-search-index). A library containing Gulp tasks and a prebuilt browser script that implements search. Gulp generates a search index from project markdown files.
|
||||
* [hugofastsearch](https://gist.github.com/cmod/5410eae147e4318164258742dd053993). A usability and speed update to "GitHub Gist for Fuse.js integration" — global, keyboard-optimized search.
|
||||
* [JS & Fuse.js tutorial](https://makewithhugo.com/add-search-to-a-hugo-site/) A simple client-side search solution, using FuseJS (does not require jQuery).
|
||||
|
||||
@@ -18,17 +18,17 @@ toc: true
|
||||
## Template Metrics
|
||||
|
||||
Hugo is a very fast static site generator, but it is possible to write
|
||||
inefficient templates. Hugo's *template metrics* feature is extremely helpful
|
||||
inefficient templates. Hugo's _template metrics_ feature is extremely helpful
|
||||
in pinpointing which templates are executed most often and how long those
|
||||
executions take **in terms of CPU time**.
|
||||
|
||||
| Metric Name | Description |
|
||||
|---------------------|-------------|
|
||||
| cumulative duration | The cumulative time spent executing a given template. |
|
||||
| average duration | The average time spent executing a given template. |
|
||||
| Metric Name | Description |
|
||||
| ------------------- | -------------------------------------------------------------- |
|
||||
| cumulative duration | The cumulative time spent executing a given template. |
|
||||
| average duration | The average time spent executing a given template. |
|
||||
| maximum duration | The maximum time a single execution took for a given template. |
|
||||
| count | The number of times a template was executed. |
|
||||
| template | The template name. |
|
||||
| count | The number of times a template was executed. |
|
||||
| template | The template name. |
|
||||
|
||||
```
|
||||
▶ hugo --templateMetrics
|
||||
@@ -77,20 +77,18 @@ simultaneously. Because of this parallelism, the sum of "cumulative duration"
|
||||
values is usually greater than the actual time it takes to build a site.
|
||||
{{% /note %}}
|
||||
|
||||
|
||||
## Cached Partials
|
||||
|
||||
Some `partial` templates such as sidebars or menus are executed many times
|
||||
during a site build. Depending on the content within the `partial` template and
|
||||
during a site build. Depending on the content within the `partial` template and
|
||||
the desired output, the template may benefit from caching to reduce the number
|
||||
of executions. The [`partialCached`][partialCached] template function provides
|
||||
of executions. The [`partialCached`][partialcached] template function provides
|
||||
caching capabilities for `partial` templates.
|
||||
|
||||
{{% tip %}}
|
||||
Note that you can create cached variants of each `partial` by passing additional
|
||||
parameters to `partialCached` beyond the initial context. See the
|
||||
parameters to `partialCached` beyond the initial context. See the
|
||||
`partialCached` documentation for more details.
|
||||
{{% /tip %}}
|
||||
|
||||
|
||||
[partialCached]:{{< ref "/functions/partialCached.md" >}}
|
||||
|
||||
@@ -19,9 +19,9 @@ aliases: [/faq/]
|
||||
|
||||
## I can't see my content!
|
||||
|
||||
Is your markdown file [in draft mode](https://gohugo.io/content-management/front-matter/#front-matter-variables)? When testing, run `hugo server` with the `-D` or `--buildDrafts` [switch](https://gohugo.io/getting-started/usage/#draft-future-and-expired-content).
|
||||
Is your Markdown file [in draft mode](https://gohugo.io/content-management/front-matter/#front-matter-variables)? When testing, run `hugo server` with the `-D` or `--buildDrafts` [switch](https://gohugo.io/getting-started/usage/#draft-future-and-expired-content).
|
||||
|
||||
Is your markdown file part of a [leaf bundle](/content-management/page-bundles/)? If there is an `index.md` file in the same or any parent directory then other markdown files will not be rendered as individual pages.
|
||||
Is your Markdown file part of a [leaf bundle](/content-management/page-bundles/)? If there is an `index.md` file in the same or any parent directory then other Markdown files will not be rendered as individual pages.
|
||||
|
||||
## Can I set configuration variables via OS environment?
|
||||
|
||||
@@ -49,7 +49,7 @@ Yes you can! Read [this](/hosting-and-deployment/hosting-on-netlify/#configure-h
|
||||
|
||||
## I get "... this feature is not available in your current Hugo version"
|
||||
|
||||
If you process `SCSS` or `SASS` to `CSS` in your Hugo project with `libsass` as the transpiler or if you convert images to the `webp` format, you need the Hugo `extended` version, or else you may see an error message similar to the below:
|
||||
If you process `SCSS` or `Sass` to `CSS` in your Hugo project with `libsass` as the transpiler or if you convert images to the `webp` format, you need the Hugo `extended` version, or else you may see an error message similar to the below:
|
||||
|
||||
```bash
|
||||
error: failed to transform resource: TOCSS: failed to transform "scss/main.scss" (text/x-scss): this feature is not available in your current Hugo version
|
||||
|
||||
@@ -4,7 +4,6 @@ linktitle:
|
||||
description: Page-level variables are defined in a content file's front matter, derived from the content's file location, or extracted from the content body itself.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [variables and params]
|
||||
keywords: [pages]
|
||||
draft: false
|
||||
|
||||
@@ -23,8 +23,8 @@ Also see [List templates](/templates/lists) for an overview of sort methods.
|
||||
|
||||
`.Next` and `.Prev` on `Pages` work similar to the methods with the same names on `.Page`, but are more flexible (and slightly slower) as they can be used on any page collection.
|
||||
|
||||
`.Next` points **up** to the next page relative to the page sent in as the argument. Example: `{{with .Site.RegularPages.Next . }}{{.RelPermalink}}{{end}}`. Calling `.Next` with the first page in the collection returns `nil`.
|
||||
`.Next` points **up** to the next page relative to the page sent in as the argument. Example: `{{with .Site.RegularPages.Next . }}{{.RelPermalink}}{{end}}`. Calling `.Next` with the first page in the collection returns `nil`.
|
||||
|
||||
## .Prev PAGE
|
||||
|
||||
`.Prev` points **down** to the previous page relative to the page sent in as the argument. Example: `{{with .Site.RegularPages.Prev . }}{{.RelPermalink}}{{end}}`. Calling `.Prev` with the last page in the collection returns `nil`.
|
||||
`.Prev` points **down** to the previous page relative to the page sent in as the argument. Example: `{{with .Site.RegularPages.Prev . }}{{.RelPermalink}}{{end}}`. Calling `.Prev` with the last page in the collection returns `nil`.
|
||||
|
||||
@@ -4,10 +4,8 @@ linktitle: Shortcode Variables
|
||||
description: Shortcodes can access page variables and also have their own specific built-in variables.
|
||||
date: 2017-03-12
|
||||
publishdate: 2017-03-12
|
||||
lastmod: 2017-03-12
|
||||
categories: [variables and params]
|
||||
keywords: [shortcodes]
|
||||
draft: false
|
||||
menu:
|
||||
docs:
|
||||
parent: "variables"
|
||||
@@ -47,6 +45,3 @@ toc: false
|
||||
|
||||
.InnerDeindent {{< new-in "0.100.0" >}}
|
||||
: Gets the `.Inner` with any indentation removed. This is what's used in the built-in `{{</* highlight */>}}` shortcode.
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user