Skip to content

Commit

Permalink
feat: canonical param (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
peaceiris authored Sep 21, 2020
1 parent 89e8b73 commit b43ee39
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ Hugo IRIS Theme
- [Getting Started](#getting-started)
- [Get Hugo](#get-hugo)
- [Initialize New Hugo Project](#initialize-new-hugo-project)
- [Params](#params)
- [Site](#site)
- [Post Page Front Matter](#post-page-front-matter)
- [Customize Theme](#customize-theme)
- [config](#config)
- [content](#content)
Expand Down Expand Up @@ -119,6 +122,31 @@ hugo server



## Params

### Site

TBW.

### Post Page Front Matter

```yaml
title:
description:
publishdate: 2020-01-01T01:00:00.000Z
# draft: true
eyecatch: images/eyecatch.jpg
toc: true
# math: true
# weight: 1
twitter:
username: piris314
hashtags: ["Hugo"]
canonicalURL:
```
## Customize Theme
TBW.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ toc: true
twitter:
username: piris314
hashtags: ["GitHubActions"]
canonicalURL: https://github.com/peaceiris/actions-gh-pages
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ toc: true
twitter:
username: piris314
hashtags: ["GitHubActions"]
canonicalURL: https://github.com/peaceiris/actions-gh-pages
---


Expand Down
4 changes: 4 additions & 0 deletions layouts/partials/head/general.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@

<!-- Open Graph Protocol (OGP) -->
{{ partial "head/ogp" . }}

{{ with .Page.Params.canonicalURL }}
<link rel="canonical" href="{{ . | safeURL }}">
{{ end }}

0 comments on commit b43ee39

Please sign in to comment.