oxil-net1
Version:
Oxford Information Labs Netistrar Theme
141 lines (129 loc) • 4.88 kB
HTML
{{- define "schema" -}}
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="{{.Title}}" />
<meta name="twitter:site" content="@oxfordinfolabs" />
<meta name="twitter:creator" content="{{ if .Params.authors }}{{ range first 1 .Params.authors }}{{ with $.Site.GetPage "taxonomyTerm" (printf "authors/%s" (urlize .)) }}{{ $param := .Params.twitter }}{{if $param }}{{$param}}{{else}}{{"@oxfordinfolabs"}}{{end}}{{ end }}{{end}}{{ else }}{{"@oxfordinfolabs"}}{{end}}" />
<meta property="og:url" content="{{.Permalink}}" />
<meta property="fb:app_id" content="{{.Site.Params.facebookappid}}" />
<meta property="og:type" content="{{if .IsHome}}website{{else}}article{{end}}" />
<meta property="og:title" content="{{.Title}}" />
<meta property="og:description" content="{{ if .Description }}{{ .Description }}{{ else }}Oxford Information Labs {{.Section}} section: {{.Title}} | Published on {{dateFormat "2006-01-02 11:11" .Lastmod }} | {{.Site.Params.subtitle}}{{end}}" />
<meta property="og:image" content="
{{- if eq .Params.mediatype "image" -}}
{{- $image := .Resources.GetMatch "*featured*" -}}
{{- $image.Permalink -}}
{{- end -}}
{{- if eq .Params.mediatype "video" -}}
https://i.ytimg.com/vi/{{.Params.youtubeid}}/hqdefault.jpg
{{- end -}}
" />
<script type="application/ld+json">
{
"@context":"https://schema.org",
"@type":"NewsArticle",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": {{.Permalink}}
},
"headline": {{ .Title }},
"datePublished": "{{.Date.Format "2006-01-02T15:04:05" | plainify}}",
"dateModified": "{{.Lastmod.Format "2006-01-02T15:04:05" | plainify }}",
"publisher": {
"@type": "Organization",
"name": "{{.Site.Params.org_official_name}}",
"logo": {
"@type": "ImageObject",
"url": {{printf "%simages/%s" .Site.BaseURL .Site.Params.logo}}
}
},
"description": {{ if .Description }}{{ .Description }}{{ else }}Oxford Information Labs {{.Section}} section: {{.Title}} | Published on {{dateFormat "2006-01-02 11:11" .Lastmod }} | {{.Site.Params.subtitle}}{{end}},
{{- if .Params.tags -}}
{{- $keywords := .Params.tags}}
{{- $len := (len $keywords) -}}
{{- $keystr := "" -}}
{{- range $index, $item := $keywords -}}
{{- if (eq $index 0) -}}
{{- $keystr = $item -}}
{{- else -}}
{{- $keystr = (printf "%s,%s" $keystr $item) -}}
{{- end -}}
{{- end }}
"keywords": "{{$keystr}}",
{{- end -}}
{{- if $authors := .Params.authors }}
"author":
{{- $len := (len $authors) -}}
[{
{{- range $index, $item := $authors }}
"@type": "Person",
"name": "{{$item}}",
"sameAs": {{printf "%sauthors/%s/" $.Site.BaseURL (urlize $item)}}
{{- if ne (add $index 1) $len -}} },{ {{- end -}}
{{- end }}
}],
{{- end }}
{{- if eq .Params.mediatype "video" }}
"video": {
"@type": "VideoObject",
"name": {{.Title}},
"description": {{.Description}},
"thumbnailUrl": "https://i.ytimg.com/vi/{{.Params.youtubeid}}/hqdefault.jpg",
"embedUrl": "https://www.youtube.com/embed/{{.Params.youtubeid}}",
"uploadDate": {{.Lastmod}}
},
"image": "https://i.ytimg.com/vi/{{.Params.youtubeid}}/hqdefault.jpg"
{{- end -}}
{{- if eq .Params.mediatype "image" }}
{{- $image := .Resources.GetMatch "*featured*" }}
"image": {{- $image.Permalink -}},
{{- end }}
}
</script>
{{- end -}}
{{ define "bodytag"}}
<body id="body" class="mediabody">
{{ end }}
{{- define "main" -}}
<div class="ge">
<div class="grid px1 px2l pt1 pb2">
<div class="breadcrumb">{{- partial "breadcrumb" (dict "p1" .Page "p2" .Page) -}}</div>
<h1 class="py2">{{- .Title -}}</h1>
<div class="flex-grid">
<div class="w-60">
{{- partial "news-item" . -}}
</div>
<div class="w-40 pl3l">
<div class="white p1"><h4>Meta data</h4>
<p><b>Title:</b><br>{{- .Title -}}</p>
<p><b>Description:</b><br>{{- .Description -}}</p>
{{- with .Params.link -}}
<p><b>Link to:</b><br>{{- . | safeHTML -}}</p>
{{- end -}}
<p><b>Published:</b><br>{{- .PublishDate | dateFormat "2 Jan, 2006" -}}</p>
{{- with .Lastmod -}}
<p><b>Modified:</b><br>{{- . | dateFormat "2 Jan, 2006" -}}</p>
{{- end -}}
<p class="mb0"><b>Categories:</b></p>
<ul class="unstyled pb1">
{{ range .Params.categories }}
<li class="com lh1"><a class="inv" href="/categories/{{ . | urlize }}/">{{ . }}</a></li>
{{ end }}
</ul>
<p class="mb0"><b>Tags:</b></p>
<ul class="unstyled pb1">
{{ range .Params.tags }}
<li class="com lh1"><a class="inv" href="/tags/{{ . | urlize }}/">{{ . }}</a></li>
{{ end }}
</ul>
</div>
</div>
</div>
</div>
</div>
<div id="relatedtags" class="white py3">
<div class="grid">
<h5 class="px1 px2l uppercase">Related</h5>
{{- partial "news-related-by-tags" . -}}
</div>
</div>
{{- end -}}