Selaa lähdekoodia

config: Allow twitter social icon to be commented out

Breaking change:
`twitter` option added to `config.toml` for social sharing metadata
George Cushen 6 vuotta sitten
vanhempi
commit
99e0edf9bb
2 muutettua tiedostoa jossa 4 lisäystä ja 3 poistoa
  1. 1 0
      exampleSite/config.toml
  2. 3 3
      layouts/partials/header.html

+ 1 - 0
exampleSite/config.toml

@@ -70,6 +70,7 @@ enableGitInfo = false
   address = "Building 1 Room 1, Stanford University, California, 90210, USA"
   office_hours = "Monday 10:00 to 13:00 or email for appointment"
   phone = "888 888 88 88"
+  twitter = ""
   skype = "echo123"
   telegram = ""
 

+ 3 - 3
layouts/partials/header.html

@@ -118,9 +118,9 @@
   <link rel="canonical" href="{{ .Permalink }}">
 
   <meta property="twitter:card" content="summary_large_image">
-  {{ range where $.Site.Params.social ".icon" "twitter" }}
-  <meta property="twitter:site" content="@{{ replaceRE "^//twitter.com/([^/]+)" "$1" .link }}">
-  <meta property="twitter:creator" content="@{{ replaceRE "^//twitter.com/([^/]+)" "$1" .link  }}">
+  {{ with .Site.Params.twitter }}
+  <meta property="twitter:site" content="@{{ . }}">
+  <meta property="twitter:creator" content="@{{ . }}">
   {{ end }}
   <meta property="og:site_name" content="{{ .Site.Title }}">
   <meta property="og:url" content="{{ .Permalink }}">