mirror of https://github.com/jpanther/congo.git
✨ Add option to exclude pages from sitemap
parent
60a0d89dde
commit
73218ce192
32
README.md
32
README.md
|
@ -45,6 +45,8 @@ Congo is designed to be a fast, lightweight theme for Hugo. It's based upon Tail
|
||||||
- [Configuration](#configuration)
|
- [Configuration](#configuration)
|
||||||
- [Getting started](#getting-started)
|
- [Getting started](#getting-started)
|
||||||
- [Organising content](#organising-content)
|
- [Organising content](#organising-content)
|
||||||
|
- [Parameters](#parameters)
|
||||||
|
- [Front Matter](#front-matter)
|
||||||
- [Shortcodes](#shortcodes)
|
- [Shortcodes](#shortcodes)
|
||||||
- [Alert](#alert)
|
- [Alert](#alert)
|
||||||
- [Icon](#icon)
|
- [Icon](#icon)
|
||||||
|
@ -147,7 +149,9 @@ It's also useful to set the author configuration in the `config/_default/author.
|
||||||
|
|
||||||
[author]
|
[author]
|
||||||
name = "Your name"
|
name = "Your name"
|
||||||
twitter = "https://twitter.com/username"
|
links = [
|
||||||
|
{ twitter = "https://twitter.com/username" }
|
||||||
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Organising content
|
### Organising content
|
||||||
|
@ -182,6 +186,32 @@ When you create a new taxonomy, you will need to adjust the navigation links on
|
||||||
weight = 20
|
weight = 20
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Congo provides a large number of configuration parameters that control how the theme functions. The table below outlines every available parameter in the `config/_default/params.toml` file.
|
||||||
|
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
|Name|Type|Default|Description|
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
|`article.showDate`|boolean|`true`|Whether or not the article date is displayed.|
|
||||||
|
|`article.dateFormat`|string|`"2 January 2006"`|How the article date is formatted. Refer to the [Hugo docs](https://gohugo.io/functions/format/#gos-layout-string) for acceptable formats.|
|
||||||
|
|`article.showReadingTime`|boolean|`true`|Whether or not reading time is displayed.|
|
||||||
|
|`article.showAuthor`|boolean|`true`|Whether or not the author box is displayed in the article footer.|
|
||||||
|
|`article.showPagination`|boolean|`true`|Whether or not the next/previous article links are displayed in the article footer.|
|
||||||
|
|`taxonomy.showTermCount`|boolean|`true`|Whether or not the number of articles within a taxonomy term is displayed on the taxonomy listing.|
|
||||||
|
|`sitemap.excludedKinds`|array of strings|`["taxonomy", "term"]`|Kinds of content that should be excluded from the generated `sitemap.xml` file. Refer to the [Hugo docs](https://gohugo.io/templates/section-templates/#page-kinds) for acceptable values.|
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
|
||||||
|
## Front Matter
|
||||||
|
|
||||||
|
In addition to the default Hugo front matter parameters, Congo adds a number of additional options to customise the presentation of individual articles. All the available theme parameters are listed below. Keep in mind that you only need to specify these parameters in your front matter when you want to override the default.
|
||||||
|
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
|Name|Type|Default|Description|
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
|`xml`|boolean|`true`|Whether or not this article is included in the generated sitemap.xml file.|
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
|
||||||
## Shortcodes
|
## Shortcodes
|
||||||
|
|
||||||
In addition to all the [default Hugo shortcodes](https://gohugo.io/content-management/shortcodes/), Congo adds a few extras for additional functionality.
|
In addition to all the [default Hugo shortcodes](https://gohugo.io/content-management/shortcodes/), Congo adds a few extras for additional functionality.
|
||||||
|
|
|
@ -12,6 +12,9 @@
|
||||||
[taxonomy]
|
[taxonomy]
|
||||||
showTermCount = true
|
showTermCount = true
|
||||||
|
|
||||||
|
[sitemap]
|
||||||
|
excludedKinds = ["taxonomy", "term"]
|
||||||
|
|
||||||
# -- Site Verification --
|
# -- Site Verification --
|
||||||
# Provide the verification strings for the providers below and the
|
# Provide the verification strings for the providers below and the
|
||||||
# corresponding meta tags will be added to the site <head>.
|
# corresponding meta tags will be added to the site <head>.
|
||||||
|
|
|
@ -4,6 +4,7 @@ date: "2019-03-09"
|
||||||
draft: true
|
draft: true
|
||||||
description: "Lorem Ipsum Dolor Si Amet"
|
description: "Lorem Ipsum Dolor Si Amet"
|
||||||
tags: ["markdown", "text"]
|
tags: ["markdown", "text"]
|
||||||
|
xml: false
|
||||||
---
|
---
|
||||||
|
|
||||||
Lorem est tota propiore conpellat pectoribus de pectora summo. <!--more-->Redit teque digerit hominumque toris verebor lumina non cervice subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc caluere tempus inhospita parcite confusaque translucet patri vestro qui optatis lumine cognoscere flos nubis! Fronde ipsamque patulos Dryopen deorum.
|
Lorem est tota propiore conpellat pectoribus de pectora summo. <!--more-->Redit teque digerit hominumque toris verebor lumina non cervice subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc caluere tempus inhospita parcite confusaque translucet patri vestro qui optatis lumine cognoscere flos nubis! Fronde ipsamque patulos Dryopen deorum.
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
|
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
|
||||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
|
||||||
xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
||||||
{{ $excludedKinds := slice "taxonomy" "term" }}
|
|
||||||
{{ range .Data.Pages }}
|
{{ range .Data.Pages }}
|
||||||
{{ if not (in $excludedKinds .Kind) }}
|
{{ if not (in .Site.Params.sitemap.excludedKinds .Kind) }}
|
||||||
{{ if not (isset .Params "externalurl") }}
|
{{ if and (.Param "xml" | default true) (not (isset .Params "externalurl")) }}
|
||||||
{{- if .Permalink -}}
|
{{- if .Permalink -}}
|
||||||
<url>
|
<url>
|
||||||
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
|
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
|
||||||
|
|
Loading…
Reference in New Issue