UNPKG

oxil-net1

Version:
155 lines (122 loc) 4.94 kB
{{- 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}}" /> {{- $m := where .Site.RegularPages.ByLastmod.Reverse "Section" "media" -}} {{- range $m | first 1 }} {{- $i := . -}} {{- with eq $i.Params.mediatype "video" }} <meta property="og:image" content="https://i.ytimg.com/vi/{{$i.Params.youtubeid}}/hqdefault.jpg" /> {{- end -}} {{- with eq $i.Params.mediatype "image" }} {{- $image := $i.Resources.GetMatch "*featured*" }} <meta property="og:image" content="{{$image.Permalink}}" /> {{- end -}} {{- end }} <script type="application/ld+json"> { "@context":"https://schema.org", "@type":"Article", "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 $match := .Resources.GetMatch "*featured*" -}}{{ $medium := $match.Resize "1200x" }}{{ $permalink := $medium.Permalink }}"image": ["{{$permalink}}"],{{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 }} {{- $m := where .Site.RegularPages.ByLastmod.Reverse "Section" "news" -}} {{- range $m | first 1 }} {{- $i := . -}} {{- with eq $i.Params.mediatype "video" }} "video": { "@type": "VideoObject", "name": {{$i.Title}}, "description": {{$i.Description}}, "thumbnailUrl": "https://i.ytimg.com/vi/{{$i.Params.youtubeid}}/hqdefault.jpg", "embedUrl": "https://www.youtube.com/embed/{{$i.Params.youtubeid}}", "uploadDate": {{$i.Lastmod}} }, "image": "https://i.ytimg.com/vi/{{$i.Params.youtubeid}}/hqdefault.jpg", {{- end -}} {{- with eq $i.Params.mediatype "image" }} {{- $image := $i.Resources.GetMatch "*featured*" }} "image": {{- $image.Permalink -}}, {{- end -}} {{- end }} "about": { "@type":"ItemList", "itemListElement":[{ {{- $len := (len $m) -}} {{- range $index, $i := $m }} "@type":"ListItem", "position":{{add $index 1}}, "url": {{$i.Permalink}} {{- if ne (add $index 1) $len -}} },{ {{- end -}} {{- end -}} }] } } </script> {{- end -}} {{ define "bodytag"}} <body id="body" class="newsbody"> {{ end }} {{- define "main" -}} <div class="brand pb1 py2l flex flex-col align-center minherolg justify-center"> <h1 class="white-text text-center">{{- .Title -}}</h1> <h4 class="w-60 thin gc-text text-center">{{- .Description -}}</h4> </div> <div class="ge pb5"> <div id="mediawrap" class="grid grid-desktop px1 pt4 " > <div class="flex flex-wrap flex-row-reverse"> <div class="sidebar w-33 pt5l "> <h4 class="gf9 py025 px125">{{- with .Params.sidebartitle -}}{{.}}{{- end -}}</h4> {{- partial "news-panel-1" -}} <section class="gf9 mb1 sticky highlights" > <h6 class="p075 uppercase">Highlights</h6> <div class="pl075 flex" > {{- partial "news-data-highlight" . -}} </div> </section> {{- partial "news-panel-2" -}} {{- partial "news-panel-3" -}} </div> <div class="flex1 pr1l"> <h5 class="uppercase normal">Media Latest</h5> <div class=" mediastack" > {{- partial "news-data" . -}} </div> <!-- end mediastack--> </div> </div> </div> </div> {{- end -}}