Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
112 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## 2017.12.09 Version 1.0 | ||
|
||
- [x] Support twitter card. | ||
- [x] Remove name in `.Site.Params`. It's duplicate with `.Site.title`. | ||
- [x] Add `author` in `.Site.Params`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{{ partial "head.html" . }} | ||
{{ partial "head.html" . }} | ||
<body> | ||
{{ partial "nav.html" . }} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<ul id="post-list" class="archive readmore"> | ||
<h3>{{ with .Site.Params.readMore }}{{ . }}{{ else }}Read more{{ end }}</h3> | ||
{{ range first 10 (where .Site.Pages "Params.hidden" "ne" "true") }} | ||
{{ $url := replace .Permalink .Site.BaseURL "" }} | ||
{{ if and (ne $url "about/") }} | ||
<h3>{{ .Site.Params.readMore | default "Read more" }}</h3> | ||
|
||
{{ $kind := where .Site.RegularPages "Section" "!=" "" }} | ||
{{ $othr := where $kind "URL" "!=" .URL }} | ||
{{ range first 10 $othr }} | ||
<li> | ||
<a href="{{ .Permalink }}">{{ .Title }}<aside class="dates">{{ .Date.Format "Jan 2" }}</aside></a> | ||
<a href="{{ .URL }}">{{ .LinkTitle }}<aside class="dates">{{ .Date.Format "Jan 2 2006" }}</aside></a> | ||
</li> | ||
{{ end }} | ||
{{ end }} | ||
</ul> | ||
{{ end }} | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{{ if .IsPage }} | ||
{{ with .Params.images }} | ||
<!-- Twitter summary card with large image must be at least 280x150px --> | ||
<meta name="twitter:card" content="summary_large_image"/> | ||
<meta name="twitter:image:src" content="{{ index . 0 | absURL }}"/> | ||
{{ else }} | ||
<meta name="twitter:card" content="summary"/> | ||
{{ if .Site.Params.twitterCardImage }} | ||
<meta name="twitter:image" content="{{ .Site.Params.twitterCardImage | absURL }}" /> | ||
{{ else }} | ||
<meta name="twitter:image" content="{{ .Site.BaseURL }}images/avatar.png" /> | ||
{{ end }} | ||
{{ end }} | ||
<!-- Twitter Card data --> | ||
<meta name="twitter:title" content="{{ .Title }}"/> | ||
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}"/> | ||
{{ with .Site.Params.twitter }} | ||
<meta name="twitter:site" content="@{{ . }}"/> | ||
{{ end }} | ||
{{ range .Site.Authors }} | ||
{{ with .twitter }} | ||
<meta name="twitter:creator" content="@{{ . }}"/> | ||
{{ end }} | ||
{{ end }} | ||
<!-- no post authors, show site author --> | ||
{{ if eq (len .Site.Authors) 0 }} | ||
<meta name="twitter:creator" content="@{{ .Site.Params.author }}"/> | ||
{{ end }} | ||
|
||
{{ else }} | ||
|
||
<meta name="twitter:card" content="summary" /> | ||
{{ with .Site.Params.twitter }} | ||
<meta name="twitter:site" content="@{{ . }}"/> | ||
{{ end }} | ||
{{ with .Site.Params.author }} | ||
<meta name="twitter:creator" content="@{{ . }}"/> | ||
{{ end }} | ||
<meta name="twitter:title" content="{{ .Site.Title }}"/> | ||
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}"/> | ||
{{ if .Site.Params.twitterCardImage }} | ||
<meta name="twitter:image" content="{{ .Site.Params.twitterCardImage | absURL }}" /> | ||
{{ else }} | ||
<meta name="twitter:image" content="{{ .Site.BaseURL }}images/avatar.png" /> | ||
{{ end }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters