Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: canonical param #198

Merged
merged 1 commit into from
Sep 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}