Skip to content

Commit

Permalink
separated og, schema and twitter into separate microformat partials
Browse files Browse the repository at this point in the history
  • Loading branch information
growdigital committed Aug 8, 2018
1 parent 5ef9e26 commit e85bbce
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 27 deletions.
2 changes: 1 addition & 1 deletion themes/starter/layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ define "main" }}
<main itemscope itemtype="https://schema.org/WebPage">
{{ partial "micro-schema.html" . }}
{{ partial "microformat-schema.html" . }}
{{ .Content }}
</main>
{{ end }}
2 changes: 1 addition & 1 deletion themes/starter/layouts/blog/single.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ define "main" }}
<main>
<article class="h-entry" itemscope itemtype="https://schema.org/Article">
{{ partial "micro-schema.html" . }}
{{ partial "microformat-schema.html" . }}
<h1 class="p-name">{{ .Title }}</h1>
<time class="dt-published" pubdate itemprop="datePublished" content="{{ .Date.Format "2006-01-02" }}">
{{ .Date.Format "Monday" }}, {{ .Date.Format "2" | humanize}} {{ .Date.Format "January 2006" }}
Expand Down
3 changes: 2 additions & 1 deletion themes/starter/layouts/partials/metahead.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no" />
<link rel="stylesheet" href="/assets/app.css">
<link rel="shortcut icon" href="/assets/img/favicon.ico">
{{- partial "micro-twitog.html" . -}}
{{- partial "microformat-twitter.html" . -}}
{{- partial "microformat-og.html" . -}}
</head>
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
<!-- Twitter -->
<meta name="twitter:site" content="@{{ .Site.Params.twitter }}">
{{ if eq .Type "status" }}
<meta name="twitter:title" content="{{ .Date.Format "Monday, 2 January 2006" }}">
<meta name="twitter:description" content="{{ .Summary }}">
{{ else }}
<meta name="twitter:title" content="{{ .Title }}">
<meta name="twitter:description" content="{{ .Description }}">
{{ end }}
{{ if .Params.Image }}
<!-- Twitter Summary Card with Large Image data -->
<!-- Aspect ratio 2:1, minimum dimension 300x157 -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="{{ .Params.Image }}">
<meta name="twitter:image:alt" content="{{ .Params.ImageAlt }}">
{{ else }}
<!-- Twitter Summary Card -->
<!-- Aspect ratio 1:1, minimum dimension 144x144 -->
<!-- Defaulting to publisher logo -->
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="{{ .Site.BaseURL }}{{ .Site.Params.publisherLogo }}">
<meta name="twitter:image:alt" content="{{ .Site.Params.publisher }} logo">
{{ end }}
<!-- Open Graph data -->
<meta property="fb:app_id" content="{{ .Site.Params.fbapp_id }}">
<meta property="og:locale" content="{{ .Site.Language.Lang }}">
Expand Down
23 changes: 23 additions & 0 deletions themes/starter/layouts/partials/microformat-twitter.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!-- Twitter -->
<meta name="twitter:site" content="@{{ .Site.Params.twitter }}">
{{ if eq .Type "status" }}
<meta name="twitter:title" content="{{ .Date.Format "Monday, 2 January 2006" }}">
<meta name="twitter:description" content="{{ .Summary }}">
{{ else }}
<meta name="twitter:title" content="{{ .Title }}">
<meta name="twitter:description" content="{{ .Description }}">
{{ end }}
{{ if .Params.Image }}
<!-- Twitter Summary Card with Large Image data -->
<!-- Aspect ratio 2:1, minimum dimension 300x157 -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="{{ .Params.Image }}">
<meta name="twitter:image:alt" content="{{ .Params.ImageAlt }}">
{{ else }}
<!-- Twitter Summary Card -->
<!-- Aspect ratio 1:1, minimum dimension 144x144 -->
<!-- Defaulting to publisher logo -->
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="{{ .Site.BaseURL }}{{ .Site.Params.publisherLogo }}">
<meta name="twitter:image:alt" content="{{ .Site.Params.publisher }} logo">
{{ end }}
2 changes: 1 addition & 1 deletion themes/starter/layouts/status/single.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ define "main" }}
<main>
<article class="h-entry" itemscope itemtype="https://schema.org/Article">
{{ partial "micro-schema.html" . }}
{{ partial "microformat-schema.html" . }}
<h1 class="p-name">
{{ .Date.Format "Monday" }}, {{ .Date.Format "2" | humanize}} {{ .Date.Format "January 2006 03:04pm" }}
</h1>
Expand Down
Empty file modified themes/starter/static/assets/app.css
100644 → 100755
Empty file.

0 comments on commit e85bbce

Please sign in to comment.