diff options
Diffstat (limited to 'docs')
32 files changed, 186 insertions, 19 deletions
diff --git a/docs/content/en/content-management/build-options.md b/docs/content/en/content-management/build-options.md new file mode 100644 index 000000000..f402b9014 --- /dev/null +++ b/docs/content/en/content-management/build-options.md @@ -0,0 +1,94 @@ +--- +title: Build Options +linktitle: Build Options +description: Build options help define how Hugo must treat a given page when building the site. +date: 2020-03-02 +publishdate: 2020-03-02 +keywords: [build,content,front matter, page resources] +categories: ["content management"] +menu: + docs: + parent: "content-management" + weight: 31 +weight: 31 #rem +draft: false +aliases: [/content/build-options/] +toc: true +--- + +They are stored in a reserved Front Matter object named `_build` with the following defaults: + +```yaml +_build: + render: true + list: true + publishResources: true +``` + +#### render +If true, the page will be treated as a published page, holding its dedicated output files (`index.html`, etc...) and permalink. + +#### list +If true, the page will be treated as part of the project's collections and, when appropriate, returned by Hugo's listing methods (`.Pages`, `.RegularPages` etc...). + +#### publishResources + +If set to true the [Bundle's Resources]({{< relref "content-management/page-bundles" >}}) will be published. +Setting this to false will still publish Resources on demand (when a resource's `.Permalink` or `.RelPermalink` is invoked from the templates) but will skip the others. + +{{% note %}} +Any page, regardless of their build options, will always be available using the [`.GetPage`]({{< relref "functions/GetPage" >}}) methods. +{{% /note %}} + +------ + +### Illustrative use cases + +#### Not publishing a page +Project needs a "Who We Are" content file for Front Matter and body to be used by the homepage but nowhere else. + +```yaml +# content/who-we-are.md` +title: Who we are +_build: + list: false + render: false +``` + +```go-html-template +{{/* layouts/index.html */}} +<section id="who-we-are"> +{{ with site.GetPage "who-we-are" }} + {{ .Content }} +{{ end }} +</section> +``` + +#### Listing pages without publishing them + +Website needs to showcase a few of the hundred "testimonials" available as content files without publishing any of them. + +To avoid setting the build options on every testimonials, one can use [`cascade`]({{< relref "/content-management/front-matter#front-matter-cascade" >}}) on the testimonial section's content file. + +```yaml +#content/testimonials/_index.md +title: Testimonials +# section build options: +_build: + render: true +# children build options with cascade +cascade: + _build: + render: false + list: true # default +``` + +```go-html-template +{{/* layouts/_defaults/testimonials.html */}} +<section id="testimonials"> +{{ range first 5 .Pages }} + <blockquote cite="{{ .Params.cite }}"> + {{ .Content }} + </blockquote> +{{ end }} +</section>
\ No newline at end of file diff --git a/docs/content/en/content-management/image-processing/index.md b/docs/content/en/content-management/image-processing/index.md index 0b9bcf323..9efb3b6bf 100644 --- a/docs/content/en/content-management/image-processing/index.md +++ b/docs/content/en/content-management/image-processing/index.md @@ -101,6 +101,17 @@ TAG: {{ $k }}: {{ $v }} {{ end }} ``` +Or individually access EXIF data with dot access, e.g.: + +```go-html-template +{{ with $img.Exif }} +Date: {{ .Date }} +Lat/Long: {{ .Lat }}/{{ .Long }} +Aperture: {{ .Tags.ApertureValue }} +Focal Length: {{ .Tags.FocalLength }} +{{ end }} +``` + #### Exif fields Date diff --git a/docs/content/en/content-management/shortcodes.md b/docs/content/en/content-management/shortcodes.md index fbcd10c86..1c19726af 100644 --- a/docs/content/en/content-management/shortcodes.md +++ b/docs/content/en/content-management/shortcodes.md @@ -59,7 +59,7 @@ You can pass multiple lines as parameters to a shortcode by using raw string lit ``` {{</* myshortcode `This is some <b>HTML</b>, -and a new line with a "quouted string".` */>}} +and a new line with a "quoted string".` */>}} ``` ### Shortcodes with Markdown diff --git a/docs/content/en/contribute/development.md b/docs/content/en/contribute/development.md index 70cb90069..bd76f9bbe 100644 --- a/docs/content/en/contribute/development.md +++ b/docs/content/en/contribute/development.md @@ -151,7 +151,7 @@ go install ``` -Hugo relies on [mage](github.com/magefile/mage) for some convenient build and test targets. If you don't already have it, get it: +Hugo relies on [mage](https://github.com/magefile/mage) for some convenient build and test targets. If you don't already have it, get it: ``` go get github.com/magefile/mage diff --git a/docs/content/en/getting-started/configuration-markup.md b/docs/content/en/getting-started/configuration-markup.md index c69bbb6ed..09816676a 100644 --- a/docs/content/en/getting-started/configuration-markup.md +++ b/docs/content/en/getting-started/configuration-markup.md @@ -134,7 +134,7 @@ PlainText Here is a code example for how the render-link.html template could look: {{< code file="layouts/_default/_markup/render-link.html" >}} -<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank"{{ end }}>{{ .Text }}</a> +<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank"{{ end }}>{{ .Text | safeHTML }}</a> {{< /code >}} #### Image Markdown example: diff --git a/docs/content/en/getting-started/configuration.md b/docs/content/en/getting-started/configuration.md index 1f1551937..33445a63c 100644 --- a/docs/content/en/getting-started/configuration.md +++ b/docs/content/en/getting-started/configuration.md @@ -138,7 +138,7 @@ enableEmoji (false) enableGitInfo (false) : Enable `.GitInfo` object for each page (if the Hugo site is versioned by Git). This will then update the `Lastmod` parameter for each page using the last git commit date for that content file. -enableInlineShortcodes +enableInlineShortcodes (false) : Enable inline shortcode support. See [Inline Shortcodes](/templates/shortcode-templates/#inline-shortcodes). enableMissingTranslationPlaceholders (false) diff --git a/docs/content/en/hugo-modules/use-modules.md b/docs/content/en/hugo-modules/use-modules.md index b5f9deadd..85417b5bf 100644 --- a/docs/content/en/hugo-modules/use-modules.md +++ b/docs/content/en/hugo-modules/use-modules.md @@ -124,7 +124,7 @@ Also see the [CLI Doc](/commands/hugo_mod_clean/). 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](/configuration/#configure-file-caches). +Note that you can also configure the `modules` cache with a `maxAge`, see [File Caches](/hugo-modules/configuration/#configure-file-caches). diff --git a/docs/content/en/hugo-pipes/minification.md b/docs/content/en/hugo-pipes/minification.md index ce090752f..c8136c040 100755 --- a/docs/content/en/hugo-pipes/minification.md +++ b/docs/content/en/hugo-pipes/minification.md @@ -22,4 +22,6 @@ Any resource of the aforementioned types can be minifed using `resources.Minify` ```go-html-template {{ $css := resources.Get "css/main.css" }} {{ $style := $css | resources.Minify }} -```
\ No newline at end of file +``` + +Note that you can also minify the final HTML output to `/public` by running `hugo --minify`. diff --git a/docs/content/en/news/0.65.0-relnotes/hugo-65-poster-featured.png b/docs/content/en/news/0.65.0-relnotes/hugo-65-poster-featured.png Binary files differnew file mode 100644 index 000000000..a311df0cb --- /dev/null +++ b/docs/content/en/news/0.65.0-relnotes/hugo-65-poster-featured.png diff --git a/docs/content/en/news/0.65.0-relnotes/index.md b/docs/content/en/news/0.65.0-relnotes/index.md index 65d7e9eec..1a2edb907 100644 --- a/docs/content/en/news/0.65.0-relnotes/index.md +++ b/docs/content/en/news/0.65.0-relnotes/index.md @@ -1,12 +1,12 @@ --- date: 2020-02-20 -title: "0.65.0" -description: "0.65.0" +title: "0.65.0: Hugo Reloaded!" +description: "Draft, expire, resource bundling, and fine grained publishing control for any page. And it's faster." categories: ["Releases"] --- - **Hugo 0.65** generalizes how a page is packaged and published to be applicable to **any page**. This should solve some of the most common issues we see people ask and talk about on the [issue tracker](https://github.com/gohugoio/hugo/issues) and on the [forum](https://discourse.gohugo.io/). +**Hugo 0.65** generalizes how a page is packaged and published to be applicable to **any page**. This should solve some of the most common issues we see people ask and talk about on the [issue tracker](https://github.com/gohugoio/hugo/issues) and on the [forum](https://discourse.gohugo.io/). ## Release Highlights @@ -39,6 +39,16 @@ Note that all front matter keywords can be set in the [cascade](https://gohugo.i We have also upgraded to the latest LibSass (v3.6.3). Nothing remarkable functional new here, but it makes Hugo ready for the upcoming [Dart Backport](https://github.com/sass/libsass/pull/2918). +And finally, we have added a `GetTerms` method on `Page`, making listing the terms defined on this page in the given taxonomy much simpler: + +```go-html-template +<ul> + {{ range (.GetTerms "tags") }} + <li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li> + {{ end }} +</ul> +``` + ### New in Hugo Modules There are several improvements to the tooling used in [Hugo Modules](https://gohugo.io/hugo-modules/). One bug fix, but also some improvements to make it easier to manage: diff --git a/docs/content/en/news/0.65.0-relnotes/pg-admin-tos.png b/docs/content/en/news/0.65.0-relnotes/pg-admin-tos.png Binary files differnew file mode 100644 index 000000000..fc2f4e34d --- /dev/null +++ b/docs/content/en/news/0.65.0-relnotes/pg-admin-tos.png diff --git a/docs/content/en/news/0.66.0-relnotes/hugo-66-poster-featured.png b/docs/content/en/news/0.66.0-relnotes/hugo-66-poster-featured.png Binary files differnew file mode 100644 index 000000000..fcdc707ce --- /dev/null +++ b/docs/content/en/news/0.66.0-relnotes/hugo-66-poster-featured.png diff --git a/docs/content/en/news/0.66.0-relnotes/index.md b/docs/content/en/news/0.66.0-relnotes/index.md index 75ee5e7b7..6fdeec948 100644 --- a/docs/content/en/news/0.66.0-relnotes/index.md +++ b/docs/content/en/news/0.66.0-relnotes/index.md @@ -1,19 +1,19 @@ --- date: 2020-03-03 -title: "0.66.0" -description: "0.66.0" +title: "Hugo 0.66.0: PostCSS Edition" +description: "Native inline, recursive import support in PostCSS/Tailwind, \"dependency-less\" builds, and more …" categories: ["Releases"] --- - This relase adds [inline `@import`](http://localhost:1313/hugo-pipes/postcss/#options) support to `resources.PostCSS`, with imports relative to Hugo's virtual, composable file system. Another useful addition is the new `build` [configuration section](http://localhost:1313/getting-started/configuration/#configure-build). As an example in `config.toml`: +This release adds [inline `@import`](/hugo-pipes/postcss/#options) support to `resources.PostCSS`, with imports relative to Hugo's virtual, composable file system. Another useful addition is the new `build` [configuration section](/getting-started/configuration/#configure-build). As an example in `config.toml`: ```toml [build] useResourceCacheWhen = "always" ``` -The above will tell Hugo to _always_ used the cached build resources inside `resources/_gen` for the build steps requiring a non-standard dependency (PostCSS and SCSS/SASS). Valid values are `never`, `always` and `fallback` (default). +The above will tell Hugo to _always_ use the cached build resources inside `resources/_gen` for the build steps requiring a non-standard dependency (PostCSS and SCSS/SASS). Valid values are `never`, `always` and `fallback` (default). This release represents **27 contributions by 8 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 [@anthonyfok](https://github.com/anthonyfok), [@carlmjohnson](https://github.com/carlmjohnson), and [@sams96](https://github.com/sams96) for their ongoing contributions. diff --git a/docs/content/en/showcase/aether/bio.md b/docs/content/en/showcase/aether/bio.md new file mode 100644 index 000000000..be1533367 --- /dev/null +++ b/docs/content/en/showcase/aether/bio.md @@ -0,0 +1,9 @@ + +[**Aether**](https://getaether.net) is an open-source peer-to-peer network that hosts self-moderating online-communities. + +[**Aether Pro**](https://aether.app), based on Aether, is a collaboration tool for remote-friendly companies. + +The site is built by: + +* [Burak Nehbit](https://twitter.com/nehbit) + diff --git a/docs/content/en/showcase/aether/featured.png b/docs/content/en/showcase/aether/featured.png Binary files differnew file mode 100644 index 000000000..509f938c7 --- /dev/null +++ b/docs/content/en/showcase/aether/featured.png diff --git a/docs/content/en/showcase/aether/index.md b/docs/content/en/showcase/aether/index.md new file mode 100644 index 000000000..bd6116e8d --- /dev/null +++ b/docs/content/en/showcase/aether/index.md @@ -0,0 +1,39 @@ +--- + +title: Aether +date: 2020-02-26 +description: "Showcase: \"Hugo is not just a static site generator for us, it's the core framework at the heart of our entire web front-end.\"" + +# The URL to the site on the internet. +siteURL: https://getaether.net + +# Add credit to the article author. Leave blank or remove if not needed/wanted. +byline: "[Burak Nehbit](https://twitter.com/nehbit), Maintainer, Aether" + +--- + +To say that this website, our main online presence, needed to do a lot would be an understatement. + +Our site is home to both *Aether* and *Aether Pro*, our **knowledgebase for each product**, a **server for static assets that we use in our emails**, the **interactive sign-up flows**, **payments client**, **downloads provider**, and even a **mechanism for delivering auto-update notifications** to our native clients. We are using a single Hugo site for all these — it's not a static site generator for us, it's the core framework at the heart of our *entire* web front-end. + +Not only that, this had to work with one developer crunched for time who spends most of his time working on two separate apps across 3 desktop platforms — someone whose main job is very far from building static websites. We only had scraps of time to design and build this Hugo site, make it performant and scalable, and Hugo did a phenomenal job delivering on that promise. + +The last piece is, funnily enough, moving our blog to Hugo, which it is not as of now. This was an inherited mistake we are currently rectifying. Soon, our entire web footprint will be living in Hugo. + +### Structure + +Our website is built in such a way that there is a separate Vue.js instance for each of the contexts since we are no using JS-based single-page navigation. We use Hugo for navigation and to build most pages. For the pages we need to make interactive, we use Vue.js to build individual, self-contained single-page Javascript apps. One such example is our sign-up flow at [aether.app](https://aether.app), an individual Vue app living within a Hugo page, with its own JS-based navigation. + +This is a relatively complex setup, and somewhat out of the ordinary. Yet, even with this custom setup, using Hugo was painless. + +### Tools + +**CMS**: Hugo + +**Theme**: Custom-designed + +**Hosting**: Netlify, pushed to production via `git push`. + +**Javascript runtime**: Vue.js + + diff --git a/docs/content/en/templates/internal.md b/docs/content/en/templates/internal.md index 004401fda..4e750216c 100644 --- a/docs/content/en/templates/internal.md +++ b/docs/content/en/templates/internal.md @@ -184,7 +184,7 @@ images = ["post-cover.png"] {{</ code-toggle >}} If `images` aren't specified in the page front-matter, then hugo searches for [image page resources](/content-management/image-processing/) with `feature`, `cover`, or `thumbnail` in their name. -If no image resources with those names are found, the images defined in the [site config](getting-started/configuration/) are used instead. +If no image resources with those names are found, the images defined in the [site config](/getting-started/configuration/) are used instead. If no images are found at all, then an image-less Twitter `summary` card is used instead of `summary_large_image`. Hugo uses the page title and description for the card's title and description fields. The page summary is used if no description is given. diff --git a/docs/content/en/templates/output-formats.md b/docs/content/en/templates/output-formats.md index 50337a20c..cbc667da3 100644 --- a/docs/content/en/templates/output-formats.md +++ b/docs/content/en/templates/output-formats.md @@ -239,7 +239,7 @@ Hugo will look for the name given, so you can name it whatever you want. But if [partial name].[OutputFormat].[suffix] ``` -The partial below is a plain text template (Outpuf Format is `CSV`, and since this is the only output format with the suffix `csv`, we don't need to include the Output Format's `Name`): +The partial below is a plain text template (Output Format is `CSV`, and since this is the only output format with the suffix `csv`, we don't need to include the Output Format's `Name`): ``` {{ partial "mytextpartial.csv" . }} diff --git a/docs/content/en/tools/migrations.md b/docs/content/en/tools/migrations.md index 9a48d1df0..3959d1d21 100644 --- a/docs/content/en/tools/migrations.md +++ b/docs/content/en/tools/migrations.md @@ -49,10 +49,12 @@ Alternatively, you can use the new [Jekyll import command](/commands/hugo_import - [wordpress-to-hugo-exporter](https://github.com/SchumacherFM/wordpress-to-hugo-exporter) - A one-click WordPress plugin that converts all posts, pages, taxonomies, metadata, and settings to Markdown and YAML which can be dropped into Hugo. (Note: If you have trouble using this plugin, you can [export your site for Jekyll](https://wordpress.org/plugins/jekyll-exporter/) and use Hugo's built in Jekyll converter listed above.) - [exitwp-for-hugo](https://github.com/wooni005/exitwp-for-hugo) - A python script which works with the xml export from Wordpress and converts Wordpress pages and posts to Markdown and YAML for hugo. - [blog2md](https://github.com/palaniraja/blog2md) - Works with [exported xml](https://en.support.wordpress.com/export/) file of your free YOUR-TLD.wordpress.com website. It also saves approved comments to `YOUR-POST-NAME-comments.md` file along with posts. +- [wordhugopress](https://github.com/nantipov/wordhugopress) - A small utility written in Java, exports the entire WordPress site from the database and resource (e.g. images) files stored locally or remotelly. Therefore, migration from the backup files is possible. Supports merging of the multiple WordPress sites into a single Hugo one. ## Medium - [medium2md](https://github.com/gautamdhameja/medium-2-md) - A simple Medium to Hugo exporter able to import stories in one command, including Front Matter. +- [medium-to-hugo](https://github.com/bgadrian/medium-to-hugo) - CLI tool written in Go to export medium posts into a Hugo compatible Markdown format. Tags and images are included. All images will be downloaded locally and linked appropriately. ## Tumblr diff --git a/docs/netlify.toml b/docs/netlify.toml index 7b9b92285..89e95c3c5 100644 --- a/docs/netlify.toml +++ b/docs/netlify.toml @@ -3,7 +3,7 @@ publish = "public" command = "hugo --gc --minify" [context.production.environment] -HUGO_VERSION = "0.64.1" +HUGO_VERSION = "0.66.0" HUGO_ENV = "production" HUGO_ENABLEGITINFO = "true" @@ -11,20 +11,20 @@ HUGO_ENABLEGITINFO = "true" command = "hugo --gc --minify --enableGitInfo" [context.split1.environment] -HUGO_VERSION = "0.64.1" +HUGO_VERSION = "0.66.0" HUGO_ENV = "production" [context.deploy-preview] command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL" [context.deploy-preview.environment] -HUGO_VERSION = "0.64.1" +HUGO_VERSION = "0.66.0" [context.branch-deploy] command = "hugo --gc --minify -b $DEPLOY_PRIME_URL" [context.branch-deploy.environment] -HUGO_VERSION = "0.64.1" +HUGO_VERSION = "0.66.0" [context.next.environment] HUGO_ENABLEGITINFO = "true" diff --git a/docs/resources/_gen/images/news/0.44-relnotes/featured-hugo-44-poster_hu6505d1982bab71bfe9c6c7adcedfd7f7_77631_640x0_resize_catmullrom_2.png b/docs/resources/_gen/images/news/0.44-relnotes/featured-hugo-44-poster_hu6505d1982bab71bfe9c6c7adcedfd7f7_77631_640x0_resize_catmullrom_2.png Binary files differdeleted file mode 100644 index 841552fa2..000000000 --- a/docs/resources/_gen/images/news/0.44-relnotes/featured-hugo-44-poster_hu6505d1982bab71bfe9c6c7adcedfd7f7_77631_640x0_resize_catmullrom_2.png +++ /dev/null diff --git a/docs/resources/_gen/images/news/0.45-relnotes/featured-hugo-45-poster_huea79995576e3b93a3041ae824a391758_66863_640x0_resize_catmullrom_2.png b/docs/resources/_gen/images/news/0.45-relnotes/featured-hugo-45-poster_huea79995576e3b93a3041ae824a391758_66863_640x0_resize_catmullrom_2.png Binary files differdeleted file mode 100644 index b259f357d..000000000 --- a/docs/resources/_gen/images/news/0.45-relnotes/featured-hugo-45-poster_huea79995576e3b93a3041ae824a391758_66863_640x0_resize_catmullrom_2.png +++ /dev/null diff --git a/docs/resources/_gen/images/news/0.46-relnotes/featured-hugo-46-poster_hue04c7655caa254a1835311c9409185d8_68614_640x0_resize_catmullrom_2.png b/docs/resources/_gen/images/news/0.46-relnotes/featured-hugo-46-poster_hue04c7655caa254a1835311c9409185d8_68614_640x0_resize_catmullrom_2.png deleted file mode 100644 index 5c039e4b8..000000000 --- a/ |