mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-18 20:54:38 -04:00
Update for crp before forums release
This commit is contained in:
parent
6f3a6efd31
commit
e472140d38
@ -63,7 +63,7 @@ watch = true
|
||||
# Add GA Tracking Code Here. This leverages a built-in (ie, "internal") partial from HUGO: https://gohugo.io/extras/analytics#configuring-google-analytics
|
||||
googleanalyticstrackingcode = ""
|
||||
## Critical Render Path. If true, site style will be embedded in a <style> tag in each html <head> as part of Gulp Build. False puts a typical <link> to the stylesheet in <head>>
|
||||
usecrp = false
|
||||
usecrp = true
|
||||
## Twitter handle without the "@"
|
||||
twitterhandle = "GoHugoIO"
|
||||
## Facebook URL
|
||||
|
@ -21,7 +21,7 @@ Hugo includes support for user-defined groupings of content called **taxonomies*
|
||||
Taxonomies were previously known as *indexes* in Hugo before v0.11.
|
||||
{{% /note %}}
|
||||
|
||||
### Taxonomy Definitions
|
||||
### Definitions
|
||||
|
||||
In order to effectively work with taxonomies in Hugo, it's important to first understand the language used to described the concept.
|
||||
|
||||
@ -29,12 +29,12 @@ Taxonomy
|
||||
: a categorization that can be used to classify content
|
||||
|
||||
Term
|
||||
: A key within the taxonomy
|
||||
: a key within the taxonomy
|
||||
|
||||
Value
|
||||
: A piece of content assigned to a term
|
||||
: a piece of content assigned to a term
|
||||
|
||||
### Example Taxonomy: Movie Website
|
||||
## Example Taxonomy: Movie Website
|
||||
|
||||
Let's assume you are making a website about movies. You may want to include the following taxonomies:
|
||||
|
||||
@ -84,29 +84,18 @@ Moonrise Kingdom <- Content
|
||||
|
||||
## Hugo Taxonomy Defaults
|
||||
|
||||
Hugo natively supports taxonomies, which means there are architectural patterns and default values baked into Hugo's core. Luckily, Hugo limits these default behaviors to those that fit the most common use cases in an effort to save you time.
|
||||
Hugo natively supports taxonomies, which means there are architectural patterns for rendering your project's taxonomies baked into Hugo's core.
|
||||
|
||||
### Default Taxonomies
|
||||
<!-- See conversation between bep and rdwatters here: https://github.com/spf13/hugo/issues/3165 && https://github.com/spf13/hugo/issues/2977-->
|
||||
<!-- Luckily, Hugo limits these default behaviors to those that fit the most common use cases in an effort to save you time. -->
|
||||
|
||||
Hugo ships with *tags* and *categories* as default taxonomies. These taxonomies are common to many website systems (e.g., WordPress, Drupal, Jekyll). Unlike these systems, Hugo makes it trivial to customize the taxonomies you will be using for your website.
|
||||
<!-- ### Default Taxonomies
|
||||
|
||||
### Default Taxonomy Pages and URLs
|
||||
|
||||
When taxonomies are used---and [taxonomy templates][] are provided---Hugo will automatically create both a page listing all the taxonomy's terms and individual pages with lists of content associated with each term. For example, a `categories` taxonomy will create the following pages:
|
||||
|
||||
* A single page at `yoursite.com/categories/` that lists all the [terms within the taxonomy][taxonomy terms templates]
|
||||
* [Individual taxonomy list pages][taxonomy templates] (e.g., `/categories/development/`) for each of the terms that shows a listing of all pages marked as part of that taxonomy within any content file's [front matter][]
|
||||
Hugo ships with *tags* and *categories* as default taxonomies. These taxonomies are common to many website systems (e.g., WordPress, Drupal, Jekyll). Unlike these systems, Hugo makes it trivial to customize the taxonomies you will be using for your website. -->
|
||||
|
||||
## Configuring Taxonomies
|
||||
|
||||
Taxonomies must be defined in your [website configuration][config] before they can be
|
||||
used throughout the site. You need to provide both the plural and
|
||||
singular labels for each taxonomy.
|
||||
|
||||
Here is an example configuration in TOML and YAML
|
||||
that specifies three taxonomies (the default two, plus `series`).
|
||||
|
||||
Notice the format is `singular key = "plural value"` for TOML and `singular key: "plural value"` for YAML:
|
||||
Taxonomies must be defined in your [website configuration][config] before they can be used throughout the site. You need to provide both the plural and singular labels for each taxonomy. For example, `singular key = "plural value"` for TOML and `singular key: "plural value"` for YAML.
|
||||
|
||||
### Example: TOML Taxonomy Configuration
|
||||
|
||||
@ -126,7 +115,15 @@ taxonomies:
|
||||
series: "series"
|
||||
```
|
||||
|
||||
### Overriding Hugo's Default Taxonomies
|
||||
### Default Destinations
|
||||
|
||||
When taxonomies are used---and [taxonomy templates][] are provided---Hugo will automatically create both a page listing all the taxonomy's terms and individual pages with lists of content associated with each term. For example, a `categories` taxonomy will create the following pages:
|
||||
|
||||
* A single page at `yoursite.com/categories/` that lists all the [terms within the taxonomy][taxonomy terms templates]
|
||||
* [Individual taxonomy list pages][taxonomy templates] (e.g., `/categories/development/`) for each of the terms that shows a listing of all pages marked as part of that taxonomy within any content file's [front matter][]
|
||||
|
||||
<!-- See conversation between bep and rdwatters here: https://github.com/spf13/hugo/issues/3165 && https://github.com/spf13/hugo/issues/2977-->
|
||||
<!-- ### Overriding Hugo's Default Taxonomies
|
||||
|
||||
If you do not specify any taxonomies in your site configuration file *and* your content already includes front matter with `tags:` or `categories`, Hugo will automatically create taxonomy pages. To override this behavior, set the key-value pairs for both of the default taxonomies to empty strings in your `config` file:
|
||||
|
||||
@ -140,17 +137,22 @@ If you do not specify any taxonomies in your site configuration file *and* your
|
||||
taxonomies:
|
||||
tag: ""
|
||||
category: ""
|
||||
```
|
||||
|
||||
``` -->
|
||||
|
||||
### Preserving Taxonomy Values
|
||||
|
||||
By default, taxonomy names are hyphenated, lower-cased, normalized, and then fixed and title-ized within.
|
||||
|
||||
Therefore, if you want to have a taxonomy value with special characters such as `Gérard Depardieu` instead of `Gerard Depardieu`, set the value for `preserveTaxonomyNames` to `true` in your [site configuration][config]. Hugo will then preserve special characters in taxonomy values but will still title-ize the values for titles and normalize them in URLs.
|
||||
Therefore, if you want to have a taxonomy term with special characters such as `Gérard Depardieu` instead of `Gerard Depardieu`, set the value for `preserveTaxonomyNames` to `true` in your [site configuration][config]. Hugo will then preserve special characters in taxonomy values but will still title-ize the values for titles and normalize them in URLs.
|
||||
|
||||
Note that if you use `preserveTaxonomyNames` and intend to manually construct URLs to the archive pages, you will need to pass the taxonomy values through the [`urlize` template function][].
|
||||
|
||||
{{% note %}}
|
||||
You can add content and front matter to your taxonomy list and taxonomy terms pages. See [Content Organization](/content-management/organization/) for more information on how to add an `_index.md` for this purpose.
|
||||
|
||||
Note also that taxonomy [permalinks](/content-management/urls/) are *not* configurable.
|
||||
{{% /note %}}
|
||||
|
||||
## Adding Taxonomies to Content
|
||||
|
||||
Once a taxonomy is defined at the site level, any piece of content can be assigned to it, regardless of [content type][] or [content section][].
|
||||
@ -209,7 +211,7 @@ project_url: "https://github.com/spf13/hugo"
|
||||
}
|
||||
```
|
||||
|
||||
## Ordering Taxonomies with `weight`
|
||||
## Ordering Taxonomies
|
||||
|
||||
A content file can assign weight for each of its associate taxonomies. Taxonomic weight can be used for sorting or ordering content in [taxonomy list templates][] and is declared in a content file's [front matter][]. The convention for declaring taxonomic weight is `taxonomyname_weight`.
|
||||
|
||||
@ -242,10 +244,9 @@ categories_weight: 44
|
||||
By using taxonomic weight, the same piece of content can appear in different positions in different taxonomies.
|
||||
|
||||
{{% note "Limits to Ordering Taxonomies" %}}
|
||||
Currently taxonomies only support the default ordering of content which is weight -> date. For more information, see the documentation on [taxonomy templates](/templates/taxonomy-templates/).
|
||||
Currently taxonomies only support the [default `weight => date` ordering of list content](/templates/ordering-and-grouping/#default-weight-date). For more information, see the documentation on [taxonomy templates](/templates/taxonomy-templates/).
|
||||
{{% /note %}}
|
||||
|
||||
|
||||
[`urlize` template function]: /functions/urlize/
|
||||
[content section]: /content-section/
|
||||
[content type]: /content-type/
|
||||
|
@ -10,7 +10,7 @@ tags: [themes]
|
||||
authors: ["Michael Henderson"]
|
||||
aliases: []
|
||||
hugoversion: 18.1
|
||||
draft: false
|
||||
draft: true
|
||||
toc: true
|
||||
---
|
||||
|
||||
|
@ -5,5 +5,7 @@
|
||||
<p>Golang's speed combined with markdown's elegant simplicity mean Hugo is the first static site generator fast enough to keep up with your creativity.</p>
|
||||
</div>
|
||||
<div class="focus-svgs">
|
||||
{{ partial "svg-icons/content.svg" . }} {{ partial "svg-icons/design.svg" . }}
|
||||
{{ partial "svg-icons/hugo-home.svg" . }}
|
||||
<!-- {{ partial "svg-icons/content.svg" . }}
|
||||
{{ partial "svg-icons/design.svg" . }} -->
|
||||
</div>
|
||||
|
File diff suppressed because one or more lines are too long
@ -33,8 +33,8 @@ gulp.task('scss', function() {
|
||||
.pipe(sass({ outputStyle: 'compressed' }).on('error', sass.logError))
|
||||
.pipe(prefix('last 2 versions', '> 1%', 'ie 10', 'Android 2', 'Firefox ESR'))
|
||||
.pipe(plumber())
|
||||
// .pipe(rename('style-embed.html'))
|
||||
// .pipe(gulp.dest('../layouts/partials'))
|
||||
.pipe(rename('style-embed.html'))
|
||||
.pipe(gulp.dest('../layouts/partials'))
|
||||
.pipe(rename('style.min.css'))
|
||||
.pipe(gulp.dest('../static/css'));
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user