-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #206 from kinow/add-schemaorg
Closes #153 add Schema.org JSON-LD
- Loading branch information
Showing
12 changed files
with
505 additions
and
115 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
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,11 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
{{ partial "head.html" . -}} | ||
{{ partial "head.html" . }} | ||
<body> | ||
{{ partial "header.html" . -}} | ||
{{ block "main" . }} | ||
{{ .Content }} | ||
{{ end }} | ||
{{- partial "footer.html" . -}} | ||
{{ partial "footer.html" . -}} | ||
</body> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{{- define "main" -}} | ||
<main class="content"> | ||
{{- .Content -}} | ||
{{- range .Pages.ByPublishDate.Reverse -}} | ||
<div class="post-link"> | ||
<a class="title" href="{{ .RelPermalink }}">{{- .Title -}}</a> | ||
{{- partial "metadata.html" . -}} | ||
</div> | ||
{{- end -}} | ||
</main> | ||
<main class="content"> | ||
{{- .Content -}} | ||
{{- range .Pages.ByPublishDate.Reverse -}} | ||
<div class="post-link"> | ||
<a class="title" href="{{ .RelPermalink }}">{{- .Title -}}</a> | ||
{{- partial "metadata.html" . -}} | ||
</div> | ||
{{- end -}} | ||
</main> | ||
{{- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,42 @@ | ||
{{ define "main" }} | ||
<main> | ||
<article class="content"> | ||
{{ if ne .Params.noheading true }} | ||
<h1>{{ .Title }}</h1> | ||
{{- partial "metadata.html" . -}} | ||
{{ end }} | ||
<aside> | ||
{{ .TableOfContents }} | ||
</aside> | ||
|
||
{{ .Content }} | ||
|
||
{{ $taxonomy := "categories" }} | ||
{{ with .GetTerms $taxonomy }} | ||
<p> | ||
{{ (site.GetPage $taxonomy).LinkTitle }}: | ||
{{ range $k, $_ := . -}} | ||
{{ if $k }}, {{ end }} | ||
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a> | ||
{{- end }} | ||
</p> | ||
{{ end }} | ||
{{ $taxonomy := "tags" }} | ||
{{ with .GetTerms $taxonomy }} | ||
<p> | ||
{{ (site.GetPage $taxonomy).LinkTitle }}: | ||
{{ range $k, $_ := . -}} | ||
{{ if $k }}, {{ end }} | ||
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a> | ||
{{- end }} | ||
</p> | ||
{{ end }} | ||
|
||
<aside class="links"> | ||
{{ with .PrevInSection }} | ||
<a class="previous" href="{{ .Permalink }}">« Previous</a> | ||
{{ end }} | ||
{{ with .NextInSection }} | ||
<a class="next" href="{{ .Permalink }}">Next »</a> | ||
{{ end }} | ||
</aside> | ||
|
||
</article> | ||
</main> | ||
{{ end }} | ||
<main> | ||
<article class="content"> | ||
{{- if ne .Params.noheading true }} | ||
<h1>{{ .Title }}</h1> | ||
{{ partial "metadata.html" . -}} | ||
{{- end }} | ||
<aside> | ||
{{ .TableOfContents }} | ||
</aside> | ||
{{ .Content }} | ||
{{- $taxonomy := "categories" -}} | ||
{{- with .GetTerms $taxonomy }} | ||
<p> | ||
{{ (site.GetPage $taxonomy).LinkTitle }}: | ||
{{- range $k, $_ := . -}} | ||
{{ if $k }}, {{ end }} | ||
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a> | ||
{{- end }} | ||
</p> | ||
{{- end -}} | ||
{{- $taxonomy := "tags" -}} | ||
{{- with .GetTerms $taxonomy }} | ||
<p> | ||
{{ (site.GetPage $taxonomy).LinkTitle }}: | ||
{{- range $k, $_ := . -}} | ||
{{ if $k }}, {{ end }} | ||
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a> | ||
{{- end }} | ||
</p> | ||
{{- end }} | ||
<aside class="links"> | ||
{{ with .PrevInSection -}} | ||
<a class="previous" href="{{ .Permalink }}">« Previous</a> | ||
{{- end }} | ||
{{- with .NextInSection -}} | ||
<a class="next" href="{{ .Permalink }}">Next »</a> | ||
{{- end }} | ||
</aside> | ||
</article> | ||
</main> | ||
{{- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
{{ template "_internal/opengraph.html" . }} | ||
{{- range .AlternativeOutputFormats }} | ||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} | ||
{{ end -}} | ||
{{- $sass := resources.Get "sass/main.scss" -}} | ||
{{- $style := $sass | resources.ToCSS | resources.Fingerprint -}} | ||
<link rel="stylesheet" type="text/css" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}"> | ||
{{- $title := print .Site.Title " | " .Title }} | ||
{{ if .IsHome }}{{ $title = .Site.Title }}{{ end -}} | ||
<title>{{ $title }}</title> | ||
</head> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
{{ partial "opengraph.html" . -}} | ||
{{- range .AlternativeOutputFormats -}} | ||
{{ printf ` <link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} | ||
{{ end -}} | ||
{{- $sass := resources.Get "sass/main.scss" -}} | ||
{{- $style := $sass | resources.ToCSS | resources.Fingerprint -}} | ||
<link rel="stylesheet" type="text/css" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}"> | ||
{{- $title := print .Site.Title " | " .Title }} | ||
{{ if .IsHome }}{{ $title = .Site.Title }}{{ end -}} | ||
<title>{{ $title }}</title> | ||
{{- partial "site_schema.html" . }} | ||
</head> |
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,27 +1,27 @@ | ||
<header role="banner" class="content"> | ||
<nav id="nav" aria-label="Main" role="navigation" class="content"> | ||
<ul> | ||
{{- $currentPage := . -}} | ||
{{- range .Site.Menus.main -}} | ||
{{- $menu_item_url := .URL | relLangURL -}} | ||
{{- $page_url:= $currentPage.RelPermalink | relLangURL -}} | ||
<li> | ||
<a | ||
href="{{- .URL -}}" | ||
{{ if eq $menu_item_url $page_url }} | ||
class="active" | ||
aria-current="true" | ||
<header role="banner" class="content"> | ||
<nav id="nav" aria-label="Main" role="navigation" class="content"> | ||
<ul> | ||
{{- $currentPage := . -}} | ||
{{- range .Site.Menus.main -}} | ||
{{- $menu_item_url := .URL | relLangURL -}} | ||
{{- $page_url:= $currentPage.RelPermalink | relLangURL -}} | ||
<li> | ||
<a | ||
href="{{- .URL -}}" | ||
{{ if eq $menu_item_url $page_url }} | ||
class="active" | ||
aria-current="true" | ||
{{- end -}} | ||
> | ||
{{- if .Pre -}} | ||
{{- $icon := printf "<i data-feather=\"%s\"></i> " .Pre | safeHTML -}} | ||
{{- $icon -}} | ||
{{- end -}} | ||
> | ||
{{- if .Pre -}} | ||
{{- $icon := printf "<i data-feather=\"%s\"></i> " .Pre | safeHTML -}} | ||
{{- $icon -}} | ||
{{- end -}} | ||
{{- $text := print .Name | safeHTML -}} | ||
{{- $text -}} | ||
</a> | ||
</li> | ||
{{- end }} | ||
</ul> | ||
</nav> | ||
</header> | ||
{{- $text := print .Name | safeHTML -}} | ||
{{- $text -}} | ||
</a> | ||
</li> | ||
{{- end }} | ||
</ul> | ||
</nav> | ||
</header> |
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,13 +1,6 @@ | ||
<div class="metadata"> | ||
{{ $dateTime := .PublishDate.Format "2006-01-02" }} | ||
{{ $dateFormat := .Site.Params.dateFormat | default "Jan 2, 2006" }} | ||
<i data-feather="calendar"></i> | ||
<time datetime="{{ $dateTime }}">{{ .PublishDate.Format $dateFormat }}</time> | ||
<!--{{ with .Params.tags }}--> | ||
<!-- <i data-feather="tag"></i>--> | ||
<!-- {{ range . }}--> | ||
<!-- {{ $href := print (absURL "tags/") (urlize .) }}--> | ||
<!-- <a class="btn btn-sm btn-outline-dark tag-btn" href="{{ $href }}">{{ . }}</a>--> | ||
<!-- {{ end }}--> | ||
<!--{{ end }}--> | ||
</div> | ||
<div class="metadata"> | ||
{{- $dateTime := .PublishDate.Format "2006-01-02" -}} | ||
{{- $dateFormat := .Site.Params.dateFormat | default "Jan 2, 2006" }} | ||
<i data-feather="calendar"></i> | ||
<time datetime="{{ $dateTime }}">{{ .PublishDate.Format $dateFormat }}</time> | ||
</div> |
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,72 @@ | ||
<meta property="og:url" content="{{ .Permalink }}"> | ||
|
||
{{- with or site.Title site.Params.title | plainify }} | ||
<meta property="og:site_name" content="{{ . }}"> | ||
{{- end }} | ||
|
||
{{- with or .Title site.Title site.Params.title | plainify}} | ||
<meta property="og:title" content="{{ . }}"> | ||
{{- end }} | ||
|
||
{{- with or .Description .Summary site.Params.description | plainify }} | ||
<meta property="og:description" content="{{ . }}"> | ||
{{- end }} | ||
|
||
{{- with or .Params.locale site.Language.LanguageCode site.Language.Lang }} | ||
<meta property="og:locale" content="{{ . }}"> | ||
{{- end }} | ||
|
||
{{- if .IsPage }} | ||
<meta property="og:type" content="article"> | ||
<meta property="article:section" content="{{ .Section }}"> | ||
{{- $ISO8601 := "2006-01-02T15:04:05-07:00" }} | ||
{{- with .PublishDate }} | ||
<meta property="article:published_time" {{ .Format $ISO8601 | printf "content=%q" | safeHTMLAttr }}> | ||
{{- end }} | ||
{{- with .Lastmod }} | ||
<meta property="article:modified_time" {{ .Format $ISO8601 | printf "content=%q" | safeHTMLAttr }}> | ||
{{- end }} | ||
{{- range .GetTerms "tags" | first 6 }} | ||
<meta property="article:tag" content="{{ .Page.Title | plainify }}"> | ||
{{- end }} | ||
{{- else }} | ||
<meta property="og:type" content="website"> | ||
{{- end }} | ||
|
||
{{- with partial "_funcs/get-page-images" . }} | ||
{{- range . | first 6 }} | ||
<meta property="og:image" content="{{ .Permalink }}"> | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- with .Params.audio }} | ||
{{- range . | first 6 }} | ||
<meta property="og:audio" content="{{ . | absURL }}"> | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- with .Params.videos }} | ||
{{- range . | first 6 }} | ||
<meta property="og:video" content="{{ . | absURL }}"> | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- range .GetTerms "series" }} | ||
{{- range .Pages | first 7 }} | ||
{{- if ne $ . }} | ||
<meta property="og:see_also" content="{{ .Permalink }}"> | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- with site.Params.social }} | ||
{{- if reflect.IsMap . }} | ||
{{- with .facebook_app_id }} | ||
<meta property="fb:app_id" content="{{ . }}"> | ||
{{- else }} | ||
{{- with .facebook_admin }} | ||
<meta property="fb:admins" content="{{ . }}"> | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.