mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-27 21:02:11 +00:00
Merge commit '05e42bc643f1840ed2ad9c2eff82a269d1381683'
This commit is contained in:
commit
df1677a6e8
16 changed files with 84 additions and 56 deletions
|
@ -88,7 +88,7 @@ The `figure` shortcode can use the following named parameters:
|
|||
* `attr` (i.e., attribution)
|
||||
* `attrlink`
|
||||
* `alt`
|
||||
* `height`
|
||||
* `width`
|
||||
|
||||
#### Example `figure` Input
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ hl_lines
|
|||
: Highlight a space separated list of line numbers. For Chroma, you can provide a list of ranges, i.e. "3-8 10-20".
|
||||
|
||||
|
||||
The full set of supported options for Pygments is: `encoding`, `outencoding`, `nowrap`, `full`, `title`, `style`, `noclasses`, `classprefix`, `cssclass`, `cssstyles`, `prestyles`, `linenos`, `hl_lines`, `linenostart`, `linenostep`, `linenospecial`, `nobackground`, `lineseparator`, `lineanchors`, `linespans`, `anchorlinenos`, `startinline`. See the [Pygments Documentation](http://pygments.org/) for details.
|
||||
The full set of supported options for Pygments is: `encoding`, `outencoding`, `nowrap`, `full`, `title`, `style`, `noclasses`, `classprefix`, `cssclass`, `cssstyles`, `prestyles`, `linenos`, `hl_lines`, `linenostart`, `linenostep`, `linenospecial`, `nobackground`, `lineseparator`, `lineanchors`, `linespans`, `anchorlinenos`, `startinline`. See the [Pygments HTML Formatter Documentation](http://pygments.org/docs/formatters/#HtmlFormatter) for details.
|
||||
|
||||
|
||||
## Generate Syntax Highlighter CSS
|
||||
|
|
|
@ -54,26 +54,26 @@ To continue with the example of a movie site, the following demonstrates content
|
|||
```
|
||||
Actor <- Taxonomy
|
||||
Bruce Willis <- Term
|
||||
The Sixth Sense <- Content
|
||||
Unbreakable <- Content
|
||||
Moonrise Kingdom <- Content
|
||||
The Sixth Sense <- Value
|
||||
Unbreakable <- Value
|
||||
Moonrise Kingdom <- Value
|
||||
Samuel L. Jackson <- Term
|
||||
Unbreakable <- Content
|
||||
The Avengers <- Content
|
||||
xXx <- Content
|
||||
Unbreakable <- Value
|
||||
The Avengers <- Value
|
||||
xXx <- Value
|
||||
```
|
||||
|
||||
From the perspective of the content, the relationships would appear differently, although the data and labels used are the same:
|
||||
|
||||
```
|
||||
Unbreakable <- Content
|
||||
Unbreakable <- Value
|
||||
Actors <- Taxonomy
|
||||
Bruce Willis <- Term
|
||||
Samuel L. Jackson <- Term
|
||||
Director <- Taxonomy
|
||||
M. Night Shyamalan <- Term
|
||||
...
|
||||
Moonrise Kingdom <- Content
|
||||
Moonrise Kingdom <- Value
|
||||
Actors <- Taxonomy
|
||||
Bruce Willis <- Term
|
||||
Bill Murray <- Term
|
||||
|
|
|
@ -43,7 +43,7 @@ permalinks:
|
|||
post = "/:year/:month/:title/"
|
||||
{{< /code >}}
|
||||
|
||||
Only the content under `post/` will have the new URL structure. For example, the file `content/post/sample-entry.md` with `date: 2017-02-27T19:20:00-05:00` in its front matter will render to `public/2017/02/sample-entry/index.html` at build time and therefore be reachable at `https://example.com/2013/11/sample-entry/`.
|
||||
Only the content under `post/` will have the new URL structure. For example, the file `content/post/sample-entry.md` with `date: 2017-02-27T19:20:00-05:00` in its front matter will render to `public/2017/02/sample-entry/index.html` at build time and therefore be reachable at `https://example.com/2017/02/sample-entry/`.
|
||||
|
||||
You can also configure permalinks of taxonomies with the same syntax, by using the plural form of the taxonomy instead of the section. You will probably only want to use the configuration values `:slug` or `:title`.
|
||||
|
||||
|
@ -75,6 +75,9 @@ The following is a list of values that can be used in a `permalink` definition i
|
|||
`:section`
|
||||
: the content's section
|
||||
|
||||
`:sections`
|
||||
: the content's sections hierarchy
|
||||
|
||||
`:title`
|
||||
: the content's title
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ min_version = 0.13
|
|||
|
||||
{{% note %}}
|
||||
1. This is different from the `theme.toml` file created by `hugo new theme` in Hugo versions before v0.14.
|
||||
2. Only `theme.toml` is accepted; ie. not `theme.yaml` andnot `theme.json`.
|
||||
2. Only `theme.toml` is accepted; ie. not `theme.yaml` and `theme.json`.
|
||||
{{% /note %}}
|
||||
|
||||
### Images
|
||||
|
@ -147,4 +147,4 @@ If you add screenshots to the README, please make use of absolute file paths ins
|
|||
{{% /note %}}
|
||||
|
||||
[artistexample]: https://github.com/digitalcraftsman/hugo-artists-theme/tree/master/exampleSite
|
||||
[themeissuenew]: https://github.com/gohugoio/hugoThemes/issues/new
|
||||
[themeissuenew]: https://github.com/gohugoio/hugoThemes/issues/new
|
||||
|
|
|
@ -252,7 +252,7 @@ googleAnalytics = ""
|
|||
hasCJKLanguage = false
|
||||
languageCode = ""
|
||||
# the length of text to show in a .Summary
|
||||
summaryLength: 70
|
||||
summaryLength = 70
|
||||
layoutDir = "layouts"
|
||||
# Enable Logging
|
||||
log = false
|
||||
|
|
|
@ -455,12 +455,10 @@ sudo pacman -Sy hugo
|
|||
|
||||
### Fedora, CentOS, and Red Hat
|
||||
|
||||
* <https://copr.fedorainfracloud.org/coprs/spf13/Hugo/> (updated to Hugo v0.16)
|
||||
* <https://copr.fedorainfracloud.org/coprs/daftaupe/hugo/> (updated to Hugo v0.22); usually released a few days after the official Hugo release.
|
||||
* <https://copr.fedorainfracloud.org/coprs/daftaupe/hugo/>
|
||||
|
||||
See the [related discussion in the Hugo forums][redhatforum].
|
||||
|
||||
|
||||
## Upgrade Hugo
|
||||
|
||||
Upgrading Hugo is as easy as downloading and replacing the executable you’ve placed in your `PATH` or run `brew upgrade hugo` if using Homebrew.
|
||||
|
|
|
@ -21,8 +21,6 @@ toc: true
|
|||
|
||||
![hugo with nanobox](/images/hosting-and-deployment/deployment-with-nanobox/hugo-with-nanobox.png)
|
||||
|
||||
## Before You Begin
|
||||
|
||||
Nanobox provides an entire end-to-end workflow for developing and deploying applications. Using Nanobox to deploy also means you'll use it to develop your application.
|
||||
|
||||
{{% note %}}
|
||||
|
@ -39,14 +37,15 @@ To get started you'll just need the following three items:
|
|||
* [A Nanobox Account](https://nanobox.io) - Signup is free
|
||||
* [Nanobox Desktop](https://dashboard.nanobox.io/download) - The free desktop development tool
|
||||
* An account with a hosting provider such as:
|
||||
- [AWS](https://aws.amazon.com/)
|
||||
- [DigitalOcean](https://www.digitalocean.com/)
|
||||
- [Linode](https://www.linode.com/)
|
||||
- Azure (coming)
|
||||
- Google (coming)
|
||||
- [AWS](https://docs.nanobox.io/providers/hosting-accounts/aws/)
|
||||
- [Google](https://docs.nanobox.io/providers/hosting-accounts/gcp/)
|
||||
- [Azure](https://docs.nanobox.io/providers/hosting-accounts/azure/)
|
||||
- [DigitalOcean](https://docs.nanobox.io/providers/hosting-accounts/digitalocean/)
|
||||
- [Linode](https://docs.nanobox.io/providers/hosting-accounts/linode/)
|
||||
- [More...](https://docs.nanobox.io/providers/hosting-accounts/)
|
||||
- [Roll Your Own](https://docs.nanobox.io/providers/create/)
|
||||
|
||||
### Before We Begin
|
||||
### Before You Begin
|
||||
|
||||
There are a few things to get out of the way before diving into the guide. To deploy, you'll need to make sure you have connected a host account to your Nanobox account, and launched a new application.
|
||||
|
||||
|
@ -56,7 +55,7 @@ Nanobox lets you choose where to host your application (AWS, DigitalOcean, Googl
|
|||
|
||||
#### Launch a New Application on Nanobox
|
||||
|
||||
[Launching a new app on Nanobox](https://docs.nanobox.io/workflow/launch-app/) is very simple. Navigate to [Launch New App](https://dashboard.nanobox.io/apps/new) in the dashboard, and follow the steps there. You'll be asked to name your app, and select a host and region.
|
||||
[Launching a new app on Nanobox](https://docs.nanobox.io/workflow/launch-app/) is very simple. Navigate to [Launch New App](https://dashboard.nanobox.io/apps/new) in the dashboard, and follow the steps there. You'll be asked to name your app, and to select a host and region.
|
||||
|
||||
With those out of the way you're ready to get started!
|
||||
|
||||
|
@ -67,7 +66,7 @@ With those out of the way you're ready to get started!
|
|||
If you already have a functioning Hugo app, you can skip to [Configure Hugo to run with Nanobox](#configure-hugo-to-run-with-nanobox)
|
||||
{{% /note %}}
|
||||
|
||||
To get started, all you'll need an empty project directory. Create a directory wherever you want your application to live and `cd` into it:
|
||||
To get started, all you'll need is an empty project directory. Create a directory wherever you want your application to live and `cd` into it:
|
||||
|
||||
`mkdir path/to/project && cd path/to/project`
|
||||
|
||||
|
@ -101,14 +100,14 @@ deploy.config:
|
|||
{{< /code >}}
|
||||
|
||||
{{% note %}}
|
||||
If you already have a functioning Hugo app, which should now be configured, you can skip to [Deploying Hugo with Nanobox](#deploying-hugo-with-nanobox).
|
||||
If you already have a functioning Hugo app, after adding the boxfile, you can skip to [Deploying Hugo with Nanobox](#deploying-hugo-with-nanobox).
|
||||
{{% /note %}}
|
||||
|
||||
### Installing Hugo
|
||||
|
||||
Nanobox uses Docker to create instant, isolated, development environments. Because of this, you'll need to make sure that during development you have Hugo available.
|
||||
|
||||
Do this by add a custom install script at the root of your project that will install Hugo automatically for you:
|
||||
Do this by adding a custom install script at the root of your project that will install Hugo automatically for you:
|
||||
|
||||
{{< code file="install.sh" >}}
|
||||
|
||||
|
@ -131,7 +130,7 @@ If the install script fails during `nanobox run` you may need to make it executa
|
|||
|
||||
### Generating a New Hugo App
|
||||
|
||||
You'll generate your new application from inside a Nanobox console (this is why you don't need to worry about having Golang or Hugo installed).
|
||||
You'll generate your new application from inside the Nanobox VM (this is why you don't need to worry about having Golang or Hugo installed).
|
||||
|
||||
Run the following command to drop into a Nanobox console (inside the VM) where your codebase is mounted:
|
||||
|
||||
|
@ -141,7 +140,7 @@ nanobox run
|
|||
|
||||
![nanobox run](/images/hosting-and-deployment/deployment-with-nanobox/nanobox-run.png)
|
||||
|
||||
Once inside here use the following steps to create a new Hugo application:
|
||||
Once inside the console use the following steps to create a new Hugo application:
|
||||
|
||||
```
|
||||
# cd into the /tmp dir to create an app
|
||||
|
|
|
@ -114,6 +114,22 @@ cd themes
|
|||
git submodule add https://github.com/<THEMECREATOR>/<THEMENAME>
|
||||
```
|
||||
|
||||
It is recommended to only use stable versions of a theme (if it’s versioned) and always check the changelog. This can be done by checking out a specific release within the theme's directory.
|
||||
|
||||
Switch to the theme's directory and list all available versions:
|
||||
|
||||
```
|
||||
cd themes/<theme>
|
||||
git tag
|
||||
# exit with q
|
||||
```
|
||||
|
||||
You can checkout a specific version as follows:
|
||||
|
||||
```
|
||||
git checkout tags/<version-name>
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
You now have a live website served over https, distributed through CDN, and configured for continuous deployment. Dig deeper into the Netlify documentation:
|
||||
|
|
|
@ -10,14 +10,14 @@ images:
|
|||
---
|
||||
|
||||
|
||||
Hugo `0.30` is the **Race Car Edition**. Hugo is already very very fast, but much wants more. So we added **Fast Render Mode**. It is hard to explain, so start the Hugo development server with `hugo server` and start editing. Live reloads just got so much faster! The "how and what" is discussed in lenghts [other places](https://github.com/gohugoio/hugo/pull/3959), but the short version is that we now re-render only the parts of the site that you are working on.
|
||||
Hugo `0.30` is the **Race Car Edition**. Hugo is already very very fast, but much wants more. So we added **Fast Render Mode**. It is hard to explain, so start the Hugo development server with `hugo server` and start editing. Live reloads just got so much faster! The "how and what" is discussed at length in [other places](https://github.com/gohugoio/hugo/pull/3959), but the short version is that we now re-render only the parts of the site that you are working on.
|
||||
|
||||
The second performance related feature is a follow up to the Template Metrics added in Hugo `0.29`. Now, if you add the flag `--templateMetricsHints`, we will calculate a score for how your partials can be cached (with the `partialCached` template func).
|
||||
The second performance-related feature is a follow-up to the Template Metrics added in Hugo `0.29`. Now, if you add the flag `--templateMetricsHints`, we will calculate a score for how your partials can be cached (with the `partialCached` template func).
|
||||
|
||||
This release also more or less makes the really fast Chroma highlighter a complete alternative to Pygments. Most noteable is the new table `linenos` support ([7c30e2cb](https://github.com/gohugoio/hugo/commit/7c30e2cbb08fdf0e61f80c7f1aa29909aeca4211) [@bep](https://github.com/bep) [#3915](https://github.com/gohugoio/hugo/issues/3915)), which makes copy-and-paste code blocks much easier.
|
||||
|
||||
This release represents **31 contributions by 10 contributors** to the main Hugo code base.
|
||||
[@bep](https://github.com/bep) leads the Hugo development with a significant amount of contributions, but also a big shoutout to [@moorereason](https://github.com/moorereason), [@digitalcraftsman](https://github.com/digitalcraftsman), and [@bmon](https://github.com/bmon) for their ongoing contributions.
|
||||
[@bep](https://github.com/bep) leads the Hugo development with a significant amount of contribution, but also a big shoutout to [@moorereason](https://github.com/moorereason), [@digitalcraftsman](https://github.com/digitalcraftsman), and [@bmon](https://github.com/bmon) for their ongoing contributions.
|
||||
And as always a big thanks to [@digitalcraftsman](https://github.com/digitalcraftsman) for his relentless work on keeping the documentation and the themes site in pristine condition.
|
||||
|
||||
Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs),
|
||||
|
@ -32,7 +32,7 @@ Hugo now has:
|
|||
## Notes
|
||||
|
||||
* Running `hugo server` will now run with the new "Fast Render Mode" default on. To turn it off, run `hugo server --disableFastRender` or set `disableFastRender=true` in your site config.
|
||||
* There have been several fixes and enhancements in the Chroma highlighter. One is that it now creates Pygments compatible CSS classes, which means that you may want ot re-generate the stylesheet. See the [Syntax Highlighting Doc](https://gohugo.io/content-management/syntax-highlighting/).
|
||||
* There have been several fixes and enhancements in the Chroma highlighter. One is that it now creates Pygments compatible CSS classes, which means that you may want to re-generate the stylesheet. See the [Syntax Highlighting Doc](https://gohugo.io/content-management/syntax-highlighting/).
|
||||
|
||||
## Enhancements
|
||||
|
||||
|
@ -60,5 +60,5 @@ Hugo now has:
|
|||
|
||||
## Fixes
|
||||
|
||||
* Make sure `Date` and `PublishDate` is always set to a value if one is available [6a30874f](https://github.com/gohugoio/hugo/commit/6a30874f19610a38e846e120aac03c68e12f9b7b) [@bep](https://github.com/bep) [#3854](https://github.com/gohugoio/hugo/issues/3854)
|
||||
* Make sure `Date` and `PublishDate` are always set to a value if one is available [6a30874f](https://github.com/gohugoio/hugo/commit/6a30874f19610a38e846e120aac03c68e12f9b7b) [@bep](https://github.com/bep) [#3854](https://github.com/gohugoio/hugo/issues/3854)
|
||||
* Add correct config file name to verbose server log [15ec031d](https://github.com/gohugoio/hugo/commit/15ec031d9818d239bfbff525c00cd99cc3118a96) [@mdhender](https://github.com/mdhender)
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
|
||||
---
|
||||
date: 2017-10-19
|
||||
title: "0.30.1"
|
||||
description: "0.30.1"
|
||||
date: 2017-10-19T00:00:00+02:00
|
||||
title: "0.30.1: Two Important Bugfixes!"
|
||||
description: "Fixes `hugo -w` and validator-broken Sitemap."
|
||||
categories: ["Releases"]
|
||||
slug: 0.30.1-relnotes
|
||||
images:
|
||||
- images/blog/hugo-bug-poster.png
|
||||
---
|
||||
|
||||
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
|
||||
---
|
||||
date: 2017-10-19
|
||||
title: "0.30.2"
|
||||
description: "0.30.2"
|
||||
date: 2017-10-19T12:00:00+02:00
|
||||
title: "0.30.2: One More Bugfix"
|
||||
description: "Fixes Fast Render mode when having sub-path in `baseURL`."
|
||||
slug: "0.30.2"
|
||||
categories: ["Releases"]
|
||||
images:
|
||||
- images/blog/hugo-bug-poster.png
|
||||
|
||||
---
|
||||
|
||||
This release fixes Fast Render mode with sub-path in baseURL [31641033](https://github.com/gohugoio/hugo/commit/3164103310fbca1211cfa9ce4a5eb7437854b6ad) [@bep](https://github.com/bep) [#3981](https://github.com/gohugoio/hugo/issues/3981).
|
||||
This release fixes Fast Render mode with sub-path in baseURL [31641033](https://github.com/gohugoio/hugo/commit/3164103310fbca1211cfa9ce4a5eb7437854b6ad) [@bep](https://github.com/bep) [#3981](https://github.com/gohugoio/hugo/issues/3981).
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -51,17 +51,15 @@
|
|||
|
||||
`extensions`
|
||||
: default: **`[]`** <br>
|
||||
Blackfriday flag: **`EXTENSION_*`** <br>
|
||||
Purpose: Enable one or more Blackfriday's Markdown extensions (if they aren't Hugo defaults). <br>
|
||||
Purpose: Enable one or more Blackfriday's Markdown extensions (**`EXTENSION_*`**). <br>
|
||||
Example: Include `hardLineBreak` in the list to enable Blackfriday's `EXTENSION_HARD_LINK_BREAK`. <br>
|
||||
*See [Blackfriday extensions](#blackfriday-extensions) section for more information.*
|
||||
*See [Blackfriday extensions](#blackfriday-extensions) section for information on all extensions.*
|
||||
|
||||
`extensionsmask`
|
||||
: default: **`[]`** <br>
|
||||
Blackfriday flag: **`EXTENSION_*`** <br>
|
||||
Purpose: Enable one or more of Blackfriday's Markdown extensions (if they aren't Hugo defaults). <br>
|
||||
Purpose: Disable one or more of Blackfriday's Markdown extensions (**`EXTENSION_*`**). <br>
|
||||
Example: Include `autoHeaderIds` as `false` in the list to disable Blackfriday's `EXTENSION_AUTO_HEADER_IDS`. <br>
|
||||
*See [Blackfriday extensions](#blackfriday-extensions) section for more information.*
|
||||
*See [Blackfriday extensions](#blackfriday-extensions) section for information on all extensions.*
|
||||
|
||||
## Blackfriday extensions
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ You could then include the following as part of your shortcode templating:
|
|||
<img src="{{.Get "src" }}" alt="">
|
||||
{{ else }}
|
||||
<img src="{{.Get 0}}" alt="">
|
||||
{{ end }}.
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
See the [example Vimeo shortcode][vimeoexample] below for `.IsNamedParams` in action.
|
||||
|
@ -150,7 +150,7 @@ Let's assume you would like to keep mentions of your copyright year current in y
|
|||
```
|
||||
|
||||
{{< code file="/layouts/shortcodes/year.html" >}}
|
||||
{{ .Page.Now.Year }}
|
||||
{{ now.Format "2006" }}
|
||||
{{< /code >}}
|
||||
|
||||
### Single Positional Example: `youtube`
|
||||
|
|
|
@ -32,6 +32,9 @@ See [`.Scratch`](/functions/scratch/) for page-scoped, writable variables.
|
|||
`.Content`
|
||||
: the content itself, defined below the front matter.
|
||||
|
||||
`.CurrentSection`
|
||||
: the page's current section. The value can be the page itself if it is a section or the homepage.
|
||||
|
||||
`.Data`
|
||||
: the data specific to this type of page.
|
||||
|
||||
|
@ -41,12 +44,18 @@ See [`.Scratch`](/functions/scratch/) for page-scoped, writable variables.
|
|||
`.Description`
|
||||
: the description for the page.
|
||||
|
||||
`.Dir`
|
||||
: the path of the folder containing this content file. The path is relative to the `content` folder.
|
||||
|
||||
`.Draft`
|
||||
: a boolean, `true` if the content is marked as a draft in the front matter.
|
||||
|
||||
`.ExpiryDate`
|
||||
: the date on which the content is scheduled to expire; `.ExpiryDate` pulls from the `expirydate` field in a content's front matter. See also `.PublishDate`, `.Date`, and `.Lastmod`.
|
||||
|
||||
`.File`
|
||||
: filesystem-related data for this content file. See also [File Variables][].
|
||||
|
||||
`.FuzzyWordCount`
|
||||
: the approximate number of words in the content.
|
||||
|
||||
|
@ -142,6 +151,9 @@ http://remarkjs.com)
|
|||
`.Section`
|
||||
: the [section](/content-management/sections/) this content belongs to.
|
||||
|
||||
`.Sections`
|
||||
: the [sections](/content-management/sections/) below this content.
|
||||
|
||||
`.Site`
|
||||
: see [Site Variables](/variables/site/).
|
||||
|
||||
|
@ -273,3 +285,4 @@ The top-level key will be preferred. Therefore, the following method, when appli
|
|||
```
|
||||
|
||||
[gitinfo]: /variables/git/
|
||||
[File Variables]: /variables/files/
|
||||
|
|
|
@ -3,15 +3,15 @@
|
|||
command = "hugo"
|
||||
|
||||
[context.production.environment]
|
||||
HUGO_VERSION = "0.30"
|
||||
HUGO_VERSION = "0.30.2"
|
||||
HUGO_ENV = "production"
|
||||
HUGO_ENABLEGITINFO = "true"
|
||||
|
||||
[context.deploy-preview.environment]
|
||||
HUGO_VERSION = "0.30"
|
||||
HUGO_VERSION = "0.30.2"
|
||||
|
||||
[context.branch-deploy.environment]
|
||||
HUGO_VERSION = "0.30"
|
||||
HUGO_VERSION = "0.30.2"
|
||||
|
||||
[context.next.environment]
|
||||
HUGO_BASEURL = "https://next--gohugoio.netlify.com/"
|
||||
|
|
Loading…
Reference in a new issue