mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-08-04 04:58:55 -04:00
Markdown and formatting fixes (#1850)
This commit is contained in:
parent
43f177e3c8
commit
dac034f63a
6
.github/workflows/super-linter.yml
vendored
6
.github/workflows/super-linter.yml
vendored
@ -1,10 +1,7 @@
|
|||||||
name: Super Linter
|
name: Super Linter
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_dispatch:
|
||||||
branches: [master]
|
|
||||||
pull_request:
|
|
||||||
branches: [master]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -26,7 +23,6 @@ jobs:
|
|||||||
LOG_LEVEL: NOTICE
|
LOG_LEVEL: NOTICE
|
||||||
MARKDOWN_CONFIG_FILE: .markdownlint.yaml
|
MARKDOWN_CONFIG_FILE: .markdownlint.yaml
|
||||||
SUPPRESS_POSSUM: true
|
SUPPRESS_POSSUM: true
|
||||||
VALIDATE_ALL_CODEBASE: false
|
|
||||||
VALIDATE_CSS: false
|
VALIDATE_CSS: false
|
||||||
VALIDATE_EDITORCONFIG: false
|
VALIDATE_EDITORCONFIG: false
|
||||||
VALIDATE_GITLEAKS: false
|
VALIDATE_GITLEAKS: false
|
||||||
|
@ -23,5 +23,4 @@ MD041: false
|
|||||||
MD046: false
|
MD046: false
|
||||||
MD049: false
|
MD049: false
|
||||||
MD050: false
|
MD050: false
|
||||||
MD051: false
|
|
||||||
MD053: false
|
MD053: false
|
||||||
|
3
.vscode/extensions.json
vendored
3
.vscode/extensions.json
vendored
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"recommendations": [
|
"recommendations": [
|
||||||
|
"DavidAnson.vscode-markdownlint",
|
||||||
"EditorConfig.EditorConfig",
|
"EditorConfig.EditorConfig",
|
||||||
"esbenp.prettier-vscode",
|
"streetsidesoftware.code-spell-checker"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -23,8 +23,8 @@ A Page Bundle can be one of:
|
|||||||
| | Leaf Bundle | Branch Bundle |
|
| | Leaf Bundle | Branch Bundle |
|
||||||
|-------------------------------------|----------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|-------------------------------------|----------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| Usage | Collection of content and attachments for single pages | Collection of attachments for section pages (home page, section, taxonomy terms, taxonomy list) |
|
| Usage | Collection of content and attachments for single pages | Collection of attachments for section pages (home page, section, taxonomy terms, taxonomy list) |
|
||||||
| Index file name | `index.md` [^fn:1] | `_index.md` [^fn:1] |
|
| Index filename | `index.md` [^fn:1] | `_index.md` [^fn:1] |
|
||||||
| Allowed Resources | Page and non-page (like images, pdf, etc.) types | Only non-page (like images, pdf, etc.) types |
|
| Allowed Resources | Page and non-page (like images, PDF, etc.) types | Only non-page (like images, PDF, etc.) types |
|
||||||
| Where can the Resources live? | At any directory level within the leaf bundle directory. | Only in the directory level **of** the branch bundle directory i.e. the directory containing the `_index.md` ([ref](https://discourse.gohugo.io/t/question-about-content-folder-structure/11822/4?u=kaushalmodi)). |
|
| Where can the Resources live? | At any directory level within the leaf bundle directory. | Only in the directory level **of** the branch bundle directory i.e. the directory containing the `_index.md` ([ref](https://discourse.gohugo.io/t/question-about-content-folder-structure/11822/4?u=kaushalmodi)). |
|
||||||
| Layout type | `single` | `list` |
|
| Layout type | `single` | `list` |
|
||||||
| Nesting | Does not allow nesting of more bundles under it | Allows nesting of leaf or branch bundles under it |
|
| Nesting | Does not allow nesting of more bundles under it | Allows nesting of leaf or branch bundles under it |
|
||||||
|
@ -313,7 +313,7 @@ https://twitter.com/SanDiegoZoo/status/1453110110599868418
|
|||||||
|
|
||||||
#### Example `tweet` Input
|
#### Example `tweet` Input
|
||||||
|
|
||||||
Pass the tweet's user (case-insensitive) and id from the URL as parameters to the `tweet` shortcode.
|
Pass the tweet's user (case-insensitive) and ID from the URL as parameters to the `tweet` shortcode.
|
||||||
|
|
||||||
{{< code file="example-tweet-input.md" >}}
|
{{< code file="example-tweet-input.md" >}}
|
||||||
{{</* tweet user="SanDiegoZoo" id="1453110110599868418" */>}}
|
{{</* tweet user="SanDiegoZoo" id="1453110110599868418" */>}}
|
||||||
|
@ -27,7 +27,7 @@ Hugo [v0.60.0](https://github.com/gohugoio/hugo/releases/tag/v0.60.0) made a swi
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Create your markdown the way you normally would with the appropriate headings. Here is some example content:
|
Create your Markdown the way you normally would with the appropriate headings. Here is some example content:
|
||||||
|
|
||||||
```
|
```
|
||||||
<!-- Your front matter up here -->
|
<!-- Your front matter up here -->
|
||||||
|
@ -156,7 +156,7 @@ When aliases are specified, Hugo creates a directory to match the alias entry. I
|
|||||||
|
|
||||||
For example, a content file at `posts/my-intended-url.md` with the following in the front matter:
|
For example, a content file at `posts/my-intended-url.md` with the following in the front matter:
|
||||||
|
|
||||||
```
|
```yml
|
||||||
---
|
---
|
||||||
title: My New post
|
title: My New post
|
||||||
aliases: [/posts/my-old-url/]
|
aliases: [/posts/my-old-url/]
|
||||||
@ -165,7 +165,7 @@ aliases: [/posts/my-old-url/]
|
|||||||
|
|
||||||
Assuming a `baseURL` of `example.com`, the contents of the auto-generated alias `.html` found at `https://example.com/posts/my-old-url/` will contain the following:
|
Assuming a `baseURL` of `example.com`, the contents of the auto-generated alias `.html` found at `https://example.com/posts/my-old-url/` will contain the following:
|
||||||
|
|
||||||
```
|
```html
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
@ -251,7 +251,6 @@ Here's the same organization run with `hugo --uglyURLs`:
|
|||||||
└── second.md // <- https://example.com/quote/second.html
|
└── second.md // <- https://example.com/quote/second.html
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Canonicalization
|
## Canonicalization
|
||||||
|
|
||||||
By default, all relative URLs encountered in the input are left unmodified, e.g. `/css/foo.css` would stay as `/css/foo.css`. The `canonifyURLs` field in your site `config` has a default value of `false`.
|
By default, all relative URLs encountered in the input are left unmodified, e.g. `/css/foo.css` would stay as `/css/foo.css`. The `canonifyURLs` field in your site `config` has a default value of `false`.
|
||||||
@ -300,7 +299,6 @@ url: "custom/foo"
|
|||||||
---
|
---
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Relative URLs
|
## Relative URLs
|
||||||
|
|
||||||
By default, all relative URLs are left unchanged by Hugo, which can be problematic when you want to make your site browsable from a local file system.
|
By default, all relative URLs are left unchanged by Hugo, which can be problematic when you want to make your site browsable from a local file system.
|
||||||
|
@ -4,7 +4,6 @@ linktitle: Themes
|
|||||||
description: If you've built a Hugo theme and want to contribute back to the Hugo Community, share it with us.
|
description: If you've built a Hugo theme and want to contribute back to the Hugo Community, share it with us.
|
||||||
date: 2017-02-01
|
date: 2017-02-01
|
||||||
publishdate: 2017-02-01
|
publishdate: 2017-02-01
|
||||||
lastmod: 2017-02-27
|
|
||||||
categories: [contribute]
|
categories: [contribute]
|
||||||
keywords: [contribute,themes,design]
|
keywords: [contribute,themes,design]
|
||||||
authors: [digitalcraftsman]
|
authors: [digitalcraftsman]
|
||||||
@ -14,7 +13,6 @@ menu:
|
|||||||
weight: 30
|
weight: 30
|
||||||
weight: 30
|
weight: 30
|
||||||
sections_weight: 30
|
sections_weight: 30
|
||||||
draft: false
|
|
||||||
aliases: [/contribute/theme/]
|
aliases: [/contribute/theme/]
|
||||||
wip: true
|
wip: true
|
||||||
toc: true
|
toc: true
|
||||||
|
@ -94,7 +94,7 @@ Create a new script called `deploy` the root of your Hugo tree:
|
|||||||
|
|
||||||
Add the following content. Replace the `USER`, `HOST`, and `DIR` values with your own values:
|
Add the following content. Replace the `USER`, `HOST`, and `DIR` values with your own values:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
USER=my-user
|
USER=my-user
|
||||||
HOST=my-server.com
|
HOST=my-server.com
|
||||||
|
@ -4,7 +4,6 @@ linktitle: Host on AWS Amplify
|
|||||||
description: Develop and deploy a cloud-powered web app with AWS Amplify.
|
description: Develop and deploy a cloud-powered web app with AWS Amplify.
|
||||||
date: 2018-01-31
|
date: 2018-01-31
|
||||||
publishdate: 2018-01-31
|
publishdate: 2018-01-31
|
||||||
lastmod: 2018-01-31
|
|
||||||
categories: [hosting and deployment]
|
categories: [hosting and deployment]
|
||||||
keywords: [amplify,hosting,deployment]
|
keywords: [amplify,hosting,deployment]
|
||||||
authors: [Nikhil Swaminathan]
|
authors: [Nikhil Swaminathan]
|
||||||
@ -14,7 +13,6 @@ menu:
|
|||||||
weight: 10
|
weight: 10
|
||||||
weight: 10
|
weight: 10
|
||||||
sections_weight: 10
|
sections_weight: 10
|
||||||
draft: false
|
|
||||||
aliases: []
|
aliases: []
|
||||||
toc: true
|
toc: true
|
||||||
---
|
---
|
||||||
@ -42,7 +40,7 @@ AWS Amplify is a combination of client library, CLI toolchain, and a Console for
|
|||||||
|
|
||||||
1. Review your changes and then choose **Save and deploy**. The Amplify Console will pull code from your repository, build changes to the backend and frontend, and deploy your build artifacts at `https://master.unique-id.amplifyapp.com`. Bonus: Screenshots of your app on different devices to find layout issues.
|
1. Review your changes and then choose **Save and deploy**. The Amplify Console will pull code from your repository, build changes to the backend and frontend, and deploy your build artifacts at `https://master.unique-id.amplifyapp.com`. Bonus: Screenshots of your app on different devices to find layout issues.
|
||||||
|
|
||||||
## Using a Newer Version of Hugo
|
## Using a newer version of Hugo
|
||||||
|
|
||||||
If you need to use a different, perhaps newer, version of Hugo than the version currently supported by AWS Amplify:
|
If you need to use a different, perhaps newer, version of Hugo than the version currently supported by AWS Amplify:
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ linktitle: Host on Firebase
|
|||||||
description: You can use Firebase's free tier to host your static website; this also gives you access to Firebase's NOSQL API.
|
description: You can use Firebase's free tier to host your static website; this also gives you access to Firebase's NOSQL API.
|
||||||
date: 2017-03-12
|
date: 2017-03-12
|
||||||
publishdate: 2017-03-12
|
publishdate: 2017-03-12
|
||||||
lastmod: 2017-03-15
|
|
||||||
categories: [hosting and deployment]
|
categories: [hosting and deployment]
|
||||||
keywords: [hosting,firebase]
|
keywords: [hosting,firebase]
|
||||||
authors: [Michel Racic]
|
authors: [Michel Racic]
|
||||||
@ -14,7 +13,6 @@ menu:
|
|||||||
weight: 20
|
weight: 20
|
||||||
weight: 20
|
weight: 20
|
||||||
sections_weight: 20
|
sections_weight: 20
|
||||||
draft: false
|
|
||||||
toc: true
|
toc: true
|
||||||
aliases: []
|
aliases: []
|
||||||
---
|
---
|
||||||
|
@ -55,7 +55,7 @@ pages:
|
|||||||
See [this list](https://gitlab.com/pages/hugo/container_registry) if you wish to use a particular Hugo version to build your site.
|
See [this list](https://gitlab.com/pages/hugo/container_registry) if you wish to use a particular Hugo version to build your site.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
## Push Your Hugo Website to GitLab
|
## Push your Hugo website to GitLab
|
||||||
|
|
||||||
Next, create a new repository on GitLab. It is *not* necessary to make the repository public. In addition, you might want to add `/public` to your .gitignore file, as there is no need to push compiled assets to GitLab or keep your output website in version control.
|
Next, create a new repository on GitLab. It is *not* necessary to make the repository public. In addition, you might want to add `/public` to your .gitignore file, as there is no need to push compiled assets to GitLab or keep your output website in version control.
|
||||||
|
|
||||||
@ -73,13 +73,13 @@ git remote add origin https://gitlab.com/YourUsername/your-hugo-site.git
|
|||||||
git push -u origin master
|
git push -u origin master
|
||||||
```
|
```
|
||||||
|
|
||||||
## Wait for Your Page to Build
|
## Wait for your page to build
|
||||||
|
|
||||||
That's it! You can now follow the CI agent building your page at `https://gitlab.com/<YourUsername>/<your-hugo-site>/pipelines`.
|
That's it! You can now follow the CI agent building your page at `https://gitlab.com/<YourUsername>/<your-hugo-site>/pipelines`.
|
||||||
|
|
||||||
After the build has passed, your new website is available at `https://<YourUsername>.gitlab.io/<your-hugo-site>/`.
|
After the build has passed, your new website is available at `https://<YourUsername>.gitlab.io/<your-hugo-site>/`.
|
||||||
|
|
||||||
## Next Steps
|
## Next steps
|
||||||
|
|
||||||
GitLab supports using custom CNAME's and TLS certificates. For more details on GitLab Pages, see the [GitLab Pages setup documentation](https://about.gitlab.com/2016/04/07/gitlab-pages-setup/).
|
GitLab supports using custom CNAME's and TLS certificates. For more details on GitLab Pages, see the [GitLab Pages setup documentation](https://about.gitlab.com/2016/04/07/gitlab-pages-setup/).
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@ menu:
|
|||||||
slug: ""
|
slug: ""
|
||||||
aliases: []
|
aliases: []
|
||||||
toc: false
|
toc: false
|
||||||
draft: false
|
|
||||||
---
|
---
|
||||||
|
|
||||||
[KeyCDN](https://www.keycdn.com/) provides a multitude of features to help accelerate and secure your Hugo site globally including Brotli compression, Let's Encrypt support, Origin Shield, and more.
|
[KeyCDN](https://www.keycdn.com/) provides a multitude of features to help accelerate and secure your Hugo site globally including Brotli compression, Let's Encrypt support, Origin Shield, and more.
|
||||||
|
@ -4,7 +4,6 @@ linktitle: Host on Netlify
|
|||||||
description: Netlify can host your Hugo site with CDN, continuous deployment, 1-click HTTPS, an admin GUI, and its own CLI.
|
description: Netlify can host your Hugo site with CDN, continuous deployment, 1-click HTTPS, an admin GUI, and its own CLI.
|
||||||
date: 2017-02-01
|
date: 2017-02-01
|
||||||
publishdate: 2017-02-01
|
publishdate: 2017-02-01
|
||||||
lastmod: 2017-03-11
|
|
||||||
categories: [hosting and deployment]
|
categories: [hosting and deployment]
|
||||||
keywords: [netlify,hosting,deployment]
|
keywords: [netlify,hosting,deployment]
|
||||||
authors: [Ryan Watters, Seth MacLeod]
|
authors: [Ryan Watters, Seth MacLeod]
|
||||||
@ -14,7 +13,6 @@ menu:
|
|||||||
weight: 10
|
weight: 10
|
||||||
weight: 10
|
weight: 10
|
||||||
sections_weight: 10
|
sections_weight: 10
|
||||||
draft: false
|
|
||||||
aliases: []
|
aliases: []
|
||||||
toc: true
|
toc: true
|
||||||
---
|
---
|
||||||
@ -39,7 +37,7 @@ Selecting GitHub will bring up an authorization modal for authentication. Select
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Create a New Site with Continuous Deployment
|
## Create a new site with continuous deployment
|
||||||
|
|
||||||
You're now already a Netlify member and should be brought to your new dashboard. Select "New site from git."
|
You're now already a Netlify member and should be brought to your new dashboard. Select "New site from git."
|
||||||
|
|
||||||
@ -59,7 +57,7 @@ Select the repo you want to use for continuous deployment. If you have a large n
|
|||||||
|
|
||||||
Once selected, you'll be brought to a screen for basic setup. Here you can select the branch you wanted published, your [build command][], and your publish (i.e. deploy) directory. The publish directory should mirror that of what you've set in your [site configuration][config], the default of which is `public`. The following steps assume you are publishing from the `master` branch.
|
Once selected, you'll be brought to a screen for basic setup. Here you can select the branch you wanted published, your [build command][], and your publish (i.e. deploy) directory. The publish directory should mirror that of what you've set in your [site configuration][config], the default of which is `public`. The following steps assume you are publishing from the `master` branch.
|
||||||
|
|
||||||
## Configure Hugo Version in Netlify
|
## Configure Hugo version in Netlify
|
||||||
|
|
||||||
You can [set Hugo version](https://www.netlify.com/blog/2017/04/11/netlify-plus-hugo-0.20-and-beyond/) for your environments in `netlify.toml` file or set `HUGO_VERSION` as a build environment variable in the Netlify console.
|
You can [set Hugo version](https://www.netlify.com/blog/2017/04/11/netlify-plus-hugo-0.20-and-beyond/) for your environments in `netlify.toml` file or set `HUGO_VERSION` as a build environment variable in the Netlify console.
|
||||||
|
|
||||||
@ -67,14 +65,14 @@ For production:
|
|||||||
|
|
||||||
{{< code file="netlify.toml" codeLang="toml" >}}
|
{{< code file="netlify.toml" codeLang="toml" >}}
|
||||||
[context.production.environment]
|
[context.production.environment]
|
||||||
HUGO_VERSION = "0.83.1"
|
HUGO_VERSION = "0.99.1"
|
||||||
{{< /code >}}
|
{{< /code >}}
|
||||||
|
|
||||||
For testing:
|
For testing:
|
||||||
|
|
||||||
{{< code file="netlify.toml" codeLang="toml" >}}
|
{{< code file="netlify.toml" codeLang="toml" >}}
|
||||||
[context.deploy-preview.environment]
|
[context.deploy-preview.environment]
|
||||||
HUGO_VERSION = "0.83.1"
|
HUGO_VERSION = "0.99.1"
|
||||||
{{< /code >}}
|
{{< /code >}}
|
||||||
|
|
||||||
The Netlify configuration file can be a little hard to understand and get right for the different environment, and you may get some inspiration and tips from this site's `netlify.toml`:
|
The Netlify configuration file can be a little hard to understand and get right for the different environment, and you may get some inspiration and tips from this site's `netlify.toml`:
|
||||||
|
@ -33,7 +33,7 @@ For any given file, data entry, etc., Hugo will look first in the project and th
|
|||||||
|
|
||||||
Hugo uses two different algorithms to merge the filesystems, depending on the file type:
|
Hugo uses two different algorithms to merge the filesystems, depending on the file type:
|
||||||
|
|
||||||
* For `i18n` and `data` files, Hugo merges deeply using the translation id and data key inside the files.
|
* For `i18n` and `data` files, Hugo merges deeply using the translation ID and data key inside the files.
|
||||||
* For `static`, `layouts` (templates), and `archetypes` files, these are merged on file level. So the left-most file will be chosen.
|
* For `static`, `layouts` (templates), and `archetypes` files, these are merged on file level. So the left-most file will be chosen.
|
||||||
|
|
||||||
The name used in the `theme` definition above must match a folder in `/your-site/themes`, e.g. `/your-site/themes/my-shortcodes`. There are plans to improve on this and get a URL scheme so this can be resolved automatically.
|
The name used in the `theme` definition above must match a folder in `/your-site/themes`, e.g. `/your-site/themes/my-shortcodes`. There are plans to improve on this and get a URL scheme so this can be resolved automatically.
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
title: Hugo Pipes Overview
|
title: Hugo Pipes Overview
|
||||||
date: 2018-07-14
|
date: 2018-07-14
|
||||||
publishdate: 2018-07-14
|
publishdate: 2018-07-14
|
||||||
lastmod: 2018-07-14
|
|
||||||
categories: [asset management]
|
categories: [asset management]
|
||||||
keywords: []
|
keywords: []
|
||||||
menu:
|
menu:
|
||||||
@ -11,5 +10,4 @@ menu:
|
|||||||
weight: 10
|
weight: 10
|
||||||
weight: 10
|
weight: 10
|
||||||
sections_weight: 10
|
sections_weight: 10
|
||||||
draft: false
|
|
||||||
---
|
---
|
@ -31,15 +31,15 @@ In Hugo `v0.75` we improved the way we resolve JS configuration and dependencies
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
module.exports = {
|
module.exports = {
|
||||||
presets: [
|
presets: [
|
||||||
[
|
[
|
||||||
require('@babel/preset-env'),
|
require("@babel/preset-env"),
|
||||||
{
|
{
|
||||||
useBuiltIns: 'entry',
|
useBuiltIns: "entry",
|
||||||
corejs: 3
|
corejs: 3,
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@ menu:
|
|||||||
weight: 60
|
weight: 60
|
||||||
weight: 60
|
weight: 60
|
||||||
sections_weight: 60
|
sections_weight: 60
|
||||||
draft: false
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Asset files of the same MIME type can be bundled into one resource using `resources.Concat` which takes two arguments, a target path and a slice of resource objects.
|
Asset files of the same MIME type can be bundled into one resource using `resources.Concat` which takes two arguments, a target path and a slice of resource objects.
|
||||||
|
@ -22,5 +22,5 @@ Any so processed asset will bear a `.Data.Integrity` property containing an inte
|
|||||||
```go-html-template
|
```go-html-template
|
||||||
{{ $js := resources.Get "js/global.js" }}
|
{{ $js := resources.Get "js/global.js" }}
|
||||||
{{ $secureJS := $js | resources.Fingerprint "sha512" }}
|
{{ $secureJS := $js | resources.Fingerprint "sha512" }}
|
||||||
<script type="text/javascript" src="{{ $secureJS.Permalink }}" integrity="{{ $secureJS.Data.Integrity }}"></script>
|
<script src="{{ $secureJS.Permalink }}" integrity="{{ $secureJS.Data.Integrity }}"></script>
|
||||||
```
|
```
|
||||||
|
@ -4,7 +4,6 @@ linkTitle: Hugo Pipes
|
|||||||
description: Hugo Pipes is Hugo's asset processing set of functions.
|
description: Hugo Pipes is Hugo's asset processing set of functions.
|
||||||
date: 2018-07-14
|
date: 2018-07-14
|
||||||
publishdate: 2018-07-14
|
publishdate: 2018-07-14
|
||||||
lastmod: 2018-07-14
|
|
||||||
categories: [asset management]
|
categories: [asset management]
|
||||||
keywords: []
|
keywords: []
|
||||||
menu:
|
menu:
|
||||||
|
@ -11,7 +11,6 @@ menu:
|
|||||||
weight: 45
|
weight: 45
|
||||||
weight: 45
|
weight: 45
|
||||||
sections_weight: 45
|
sections_weight: 45
|
||||||
draft: false
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Any JavaScript resource file can be transpiled and "tree shaken" using `js.Build` which takes for argument either a string for the filepath or a dict of options listed below.
|
Any JavaScript resource file can be transpiled and "tree shaken" using `js.Build` which takes for argument either a string for the filepath or a dict of options listed below.
|
||||||
@ -166,5 +165,5 @@ Or with options:
|
|||||||
|
|
||||||
{{ $opts := dict "targetPath" "main.js" "externals" $externals "defines" $defines }}
|
{{ $opts := dict "targetPath" "main.js" "externals" $externals "defines" $defines }}
|
||||||
{{ $built := resources.Get "scripts/main.js" | js.Build $opts }}
|
{{ $built := resources.Get "scripts/main.js" | js.Build $opts }}
|
||||||
<script type="text/javascript" src="{{ $built.RelPermalink }}" defer></script>
|
<script src="{{ $built.RelPermalink }}" defer></script>
|
||||||
```
|
```
|
||||||
|
@ -11,7 +11,6 @@ menu:
|
|||||||
weight: 50
|
weight: 50
|
||||||
weight: 50
|
weight: 50
|
||||||
sections_weight: 50
|
sections_weight: 50
|
||||||
draft: false
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Any resource of the aforementioned types can be minified using `resources.Minify` which takes for argument the resource object.
|
Any resource of the aforementioned types can be minified using `resources.Minify` which takes for argument the resource object.
|
||||||
|
@ -24,6 +24,6 @@ The following example creates a resource file containing localized variables for
|
|||||||
{{ $vars := $string | resources.FromString $targetPath }}
|
{{ $vars := $string | resources.FromString $targetPath }}
|
||||||
{{ $global := resources.Get "js/global.js" | resources.Minify }}
|
{{ $global := resources.Get "js/global.js" | resources.Minify }}
|
||||||
|
|
||||||
<script type="text/javascript" src="{{ $vars.Permalink }}"></script>
|
<script src="{{ $vars.Permalink }}"></script>
|
||||||
<script type="text/javascript" src="{{ $global.Permalink }}"></script>
|
<script src="{{ $global.Permalink }}"></script>
|
||||||
```
|
```
|
||||||
|
@ -1,28 +1,27 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
title: Hapticmedia Blog
|
title: Hapticmedia Blog
|
||||||
date: 2019-10-01
|
date: 2019-10-01
|
||||||
description: "Showcase: \"A simple, but powerful, multilingual blog.\""
|
description: "Showcase: \"A simple, but powerful, multilingual blog.\""
|
||||||
siteURL: https://hapticmedia.fr/blog/en/
|
siteURL: https://hapticmedia.fr/blog/en/
|
||||||
byline: "[Cyril Bonnet](https://github.com/monsieurnebo), Web Developer"
|
byline: "[Cyril Bonnet](https://github.com/monsieurnebo), Web Developer"
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Our goal was to create a simple, effective and multilingual blog on [3D technology](https://hapticmedia.fr/blog/en/3d-technology/) that could be managed by a non-technical profile.
|
Our goal was to create a simple, effective and multilingual blog on [3D technology](https://hapticmedia.fr/blog/en/3d-technology/) that could be managed by a non-technical profile.
|
||||||
|
|
||||||
## Why Hugo?
|
## Why Hugo?
|
||||||
|
|
||||||
Hugo addresses all these needs, coupled with [Forestry.io](https://forestry.io/) for its administration via a "turnkey" interface. We have attached particular importance to SEO, and therefore to the creation of an advanced taxonomy system. Thus, each author and tag has a dedicated page, listing the related posts.
|
Hugo addresses all these needs, coupled with [Forestry.io](https://forestry.io/) for its administration via a "turnkey" interface. We have attached particular importance to SEO, and therefore to the creation of an advanced taxonomy system. Thus, each author and tag has a dedicated page, listing the related posts.
|
||||||
|
|
||||||
|
|
||||||
## What we liked
|
## What we liked
|
||||||
|
|
||||||
- The **multilingual** content support, especially simple to setup.
|
- The **multilingual** content support, especially simple to setup.
|
||||||
- The **multiple environments** support (develop, staging, test, production, ...).
|
- The **multiple environments** support (develop, staging, test, production, ...).
|
||||||
- Although a hard start with the Go language, the power of the **Hugo's templating**.
|
- Although a hard start with the Go language, the power of the **Hugo's templating**.
|
||||||
- The **partial layouts**, including the `internals` (e.g. social meta tags).
|
- The **partial layouts**, including the `internals` (e.g. social meta tags).
|
||||||
- The **build time**, unbeatable ⚡️⚡️⚡️.
|
- The **build time**, unbeatable ⚡️⚡️⚡️.
|
||||||
|
|
||||||
|
|
||||||
## Tools & workflow
|
## Tools & workflow
|
||||||
|
|
||||||
- We used the same design as **[our website](https://hapticmedia.fr/en/)**, recreated as a Hugo HTML template.
|
- We used the same design as **[our website](https://hapticmedia.fr/en/)**, recreated as a Hugo HTML template.
|
||||||
- **[Hugo](https://gohugo.io)** for the static website generator.
|
- **[Hugo](https://gohugo.io)** for the static website generator.
|
||||||
- **[CircleCI](https://circleci.com)** for continuous integration & deployment.
|
- **[CircleCI](https://circleci.com)** for continuous integration & deployment.
|
||||||
|
@ -6,7 +6,7 @@ date: 2017-03-22
|
|||||||
publishdate: 2017-03-22
|
publishdate: 2017-03-22
|
||||||
lastmod: 2019-12-11
|
lastmod: 2019-12-11
|
||||||
categories: [templates]
|
categories: [templates]
|
||||||
keywords: ["amp","outputs","rss"]
|
keywords: ["amp", "outputs", "rss"]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
parent: "templates"
|
parent: "templates"
|
||||||
@ -22,7 +22,7 @@ This page describes how to properly configure your site with the media types and
|
|||||||
|
|
||||||
## Media Types
|
## Media Types
|
||||||
|
|
||||||
A [media type][] (also known as *MIME type* and *content type*) is a two-part identifier for file formats and format contents transmitted on the Internet.
|
A [media type][] (also known as _MIME type_ and _content type_) is a two-part identifier for file formats and format contents transmitted on the internet.
|
||||||
|
|
||||||
This is the full set of built-in media types in Hugo:
|
This is the full set of built-in media types in Hugo:
|
||||||
|
|
||||||
@ -30,10 +30,10 @@ This is the full set of built-in media types in Hugo:
|
|||||||
|
|
||||||
**Note:**
|
**Note:**
|
||||||
|
|
||||||
* It is possible to add custom media types or change the defaults; e.g., if you want to change the suffix for `text/html` to `asp`.
|
- It is possible to add custom media types or change the defaults; e.g., if you want to change the suffix for `text/html` to `asp`.
|
||||||
* `Suffixes` are the values that will be used for URLs and filenames for that media type in Hugo.
|
- `Suffixes` are the values that will be used for URLs and filenames for that media type in Hugo.
|
||||||
* The `Type` is the identifier that must be used when defining new/custom `Output Formats` (see below).
|
- The `Type` is the identifier that must be used when defining new/custom `Output Formats` (see below).
|
||||||
* The full set of media types will be registered in Hugo's built-in development server to make sure they are recognized by the browser.
|
- The full set of media types will be registered in Hugo's built-in development server to make sure they are recognized by the browser.
|
||||||
|
|
||||||
To add or modify a media type, define it in a `mediaTypes` section in your [site configuration][config], either for all sites or for a given language.
|
To add or modify a media type, define it in a `mediaTypes` section in your [site configuration][config], either for all sites or for a given language.
|
||||||
|
|
||||||
@ -70,9 +70,9 @@ This is the full set of Hugo's built-in output formats:
|
|||||||
|
|
||||||
{{< datatable "output" "formats" "name" "mediaType" "path" "baseName" "rel" "protocol" "isPlainText" "isHTML" "noUgly" "permalinkable" >}}
|
{{< datatable "output" "formats" "name" "mediaType" "path" "baseName" "rel" "protocol" "isPlainText" "isHTML" "noUgly" "permalinkable" >}}
|
||||||
|
|
||||||
* A page can be output in as many output formats as you want, and you can have an infinite amount of output formats defined **as long as they resolve to a unique path on the file system**. In the above table, the best example of this is `AMP` vs. `HTML`. `AMP` has the value `amp` for `Path` so it doesn't overwrite the `HTML` version; e.g. we can now have both `/index.html` and `/amp/index.html`.
|
- A page can be output in as many output formats as you want, and you can have an infinite amount of output formats defined **as long as they resolve to a unique path on the file system**. In the above table, the best example of this is `AMP` vs. `HTML`. `AMP` has the value `amp` for `Path` so it doesn't overwrite the `HTML` version; e.g. we can now have both `/index.html` and `/amp/index.html`.
|
||||||
* The `MediaType` must match the `Type` of an already defined media type.
|
- The `MediaType` must match the `Type` of an already defined media type.
|
||||||
* You can define new output formats or redefine built-in output formats; e.g., if you want to put `AMP` pages in a different path.
|
- You can define new output formats or redefine built-in output formats; e.g., if you want to put `AMP` pages in a different path.
|
||||||
|
|
||||||
To add or modify an output format, define it in an `outputFormats` section in your site's [configuration file](/getting-started/configuration/), either for all sites or for a given language.
|
To add or modify an output format, define it in an `outputFormats` section in your site's [configuration file](/getting-started/configuration/), either for all sites or for a given language.
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ The following is the full list of configuration options for output formats and t
|
|||||||
: Enable to override the global uglyURLs setting.
|
: Enable to override the global uglyURLs setting.
|
||||||
|
|
||||||
`notAlternative`
|
`notAlternative`
|
||||||
: enable if it doesn't make sense to include this format in an `AlternativeOutputFormats` format listing on `Page` (e.g., with `CSS`). Note that we use the term *alternative* and not *alternate* here, as it does not necessarily replace the other format. **Default:** `false`.
|
: enable if it doesn't make sense to include this format in an `AlternativeOutputFormats` format listing on `Page` (e.g., with `CSS`). Note that we use the term _alternative_ and not _alternate_ here, as it does not necessarily replace the other format. **Default:** `false`.
|
||||||
|
|
||||||
`permalinkable`
|
`permalinkable`
|
||||||
: make `.Permalink` and `.RelPermalink` return the rendering Output Format rather than main ([see below](#link-to-output-formats)). This is enabled by default for `HTML` and `AMP`. **Default:** `false`.
|
: make `.Permalink` and `.RelPermalink` return the rendering Output Format rather than main ([see below](#link-to-output-formats)). This is enabled by default for `HTML` and `AMP`. **Default:** `false`.
|
||||||
@ -131,7 +131,7 @@ The following is the full list of configuration options for output formats and t
|
|||||||
|
|
||||||
## Output Formats for Pages
|
## Output Formats for Pages
|
||||||
|
|
||||||
A `Page` in Hugo can be rendered to multiple *output formats* on the file
|
A `Page` in Hugo can be rendered to multiple _output formats_ on the file
|
||||||
system.
|
system.
|
||||||
|
|
||||||
### Default Output Formats
|
### Default Output Formats
|
||||||
@ -139,11 +139,11 @@ system.
|
|||||||
Every `Page` has a [`Kind`][page_kinds] attribute, and the default Output
|
Every `Page` has a [`Kind`][page_kinds] attribute, and the default Output
|
||||||
Formats are set based on that.
|
Formats are set based on that.
|
||||||
|
|
||||||
| Kind | Default Output Formats |
|
| Kind | Default Output Formats |
|
||||||
|--------------- |----------------------- |
|
| ---------- | ---------------------- |
|
||||||
| `page` | HTML |
|
| `page` | HTML |
|
||||||
| `home` | HTML, RSS |
|
| `home` | HTML, RSS |
|
||||||
| `section` | HTML, RSS |
|
| `section` | HTML, RSS |
|
||||||
| `taxonomy` | HTML, RSS |
|
| `taxonomy` | HTML, RSS |
|
||||||
| `term` | HTML, RSS |
|
| `term` | HTML, RSS |
|
||||||
|
|
||||||
@ -161,10 +161,8 @@ Example from site config file:
|
|||||||
page = ["HTML"]
|
page = ["HTML"]
|
||||||
{{</ code-toggle >}}
|
{{</ code-toggle >}}
|
||||||
|
|
||||||
|
Note that in the above examples, the _output formats_ for `section`,
|
||||||
Note that in the above examples, the *output formats* for `section`,
|
`taxonomy` and `term` will stay at their default value `["HTML", "RSS"]`.
|
||||||
`taxonomy` and `term` will stay at their default value `["HTML",
|
|
||||||
"RSS"]`.
|
|
||||||
|
|
||||||
{{< new-in "0.73.0" >}} We have fixed the before confusing page kinds used for taxonomies (see the listing below) to be in line with the terms used when we talk about taxonomies. We have been careful to avoid site breakage, and you should get an ERROR in the console if you need to adjust your `outputs` section.
|
{{< new-in "0.73.0" >}} We have fixed the before confusing page kinds used for taxonomies (see the listing below) to be in line with the terms used when we talk about taxonomies. We have been careful to avoid site breakage, and you should get an ERROR in the console if you need to adjust your `outputs` section.
|
||||||
|
|
||||||
@ -211,7 +209,7 @@ __from `single.json.json`:__
|
|||||||
|
|
||||||
In order for them to return the output format of the current template file instead, the given output format should have its `permalinkable` setting set to true.
|
In order for them to return the output format of the current template file instead, the given output format should have its `permalinkable` setting set to true.
|
||||||
|
|
||||||
__Same template file as above with json output format's `permalinkable` set to true:__
|
**Same template file as above with json output format's `permalinkable` set to true:**
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ .RelPermalink }} > /that-page/index.json
|
{{ .RelPermalink }} > /that-page/index.json
|
||||||
|
@ -339,7 +339,7 @@ You can then call your shortcode in your content as follows:
|
|||||||
|
|
||||||
This will output the following HTML. Note how the first two `img` shortcodes inherit the `class` value of `content-gallery` set with the call to the parent `gallery`, whereas the third `img` only uses `src`:
|
This will output the following HTML. Note how the first two `img` shortcodes inherit the `class` value of `content-gallery` set with the call to the parent `gallery`, whereas the third `img` only uses `src`:
|
||||||
|
|
||||||
```
|
```html
|
||||||
<div class="content-gallery">
|
<div class="content-gallery">
|
||||||
<img src="/images/one.jpg" class="content-gallery-image">
|
<img src="/images/one.jpg" class="content-gallery-image">
|
||||||
<img src="/images/two.jpg" class="content-gallery-image">
|
<img src="/images/two.jpg" class="content-gallery-image">
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
---
|
---
|
||||||
title: Template Debugging
|
title: Template Debugging
|
||||||
# linktitle: Template Debugging
|
|
||||||
description: You can use Go templates' `printf` function to debug your Hugo templates. These snippets provide a quick and easy visualization of the variables available to you in different contexts.
|
description: You can use Go templates' `printf` function to debug your Hugo templates. These snippets provide a quick and easy visualization of the variables available to you in different contexts.
|
||||||
date: 2017-02-01
|
date: 2017-02-01
|
||||||
publishdate: 2017-02-01
|
publishdate: 2017-02-01
|
||||||
lastmod: 2017-02-01
|
|
||||||
categories: [templates]
|
categories: [templates]
|
||||||
keywords: [debugging,troubleshooting]
|
keywords: [debugging,troubleshooting]
|
||||||
menu:
|
menu:
|
||||||
@ -13,7 +11,6 @@ menu:
|
|||||||
weight: 180
|
weight: 180
|
||||||
weight: 180
|
weight: 180
|
||||||
sections_weight: 180
|
sections_weight: 180
|
||||||
draft: false
|
|
||||||
aliases: []
|
aliases: []
|
||||||
toc: false
|
toc: false
|
||||||
---
|
---
|
||||||
@ -32,21 +29,17 @@ You can use the template syntax, `$.`, to get the top-level template context fro
|
|||||||
|
|
||||||
This will print out the value of `.Permalink`:
|
This will print out the value of `.Permalink`:
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
{{ printf "%#v" .Permalink }}
|
{{ printf "%#v" .Permalink }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
This will print out a list of all the variables scoped to the current context
|
This will print out a list of all the variables scoped to the current context
|
||||||
(`.`, aka ["the dot"][tempintro]).
|
(`.`, aka ["the dot"][tempintro]).
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
{{ printf "%#v" . }}
|
{{ printf "%#v" . }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
When developing a [homepage][], what does one of the pages you're looping through look like?
|
When developing a [homepage][], what does one of the pages you're looping through look like?
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -13,7 +13,6 @@ menu:
|
|||||||
weight: 01
|
weight: 01
|
||||||
weight: 01
|
weight: 01
|
||||||
sections_weight: 01
|
sections_weight: 01
|
||||||
draft: false
|
|
||||||
---
|
---
|
||||||
|
|
||||||
One of Hugo's greatest strengths is its passionate---and always evolving---developer community. With the exception of the `highlight` shortcode mentioned in [Syntax Highlighting][syntax], the tools and other projects featured in this section are offerings from both commercial services and open-source projects, many of which are developed by Hugo developers just like you.
|
One of Hugo's greatest strengths is its passionate---and always evolving---developer community. With the exception of the `highlight` shortcode mentioned in [Syntax Highlighting][syntax], the tools and other projects featured in this section are offerings from both commercial services and open-source projects, many of which are developed by Hugo developers just like you.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user