浏览代码

Add support for Chrome theme color

See https://developers.google.com/web/fundamentals/design-and-ux/browser-customization/#meta_theme_color_for_chrome_and_opera

Close #402
George Cushen 7 年之前
父节点
当前提交
09daca6b7d
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      layouts/partials/header.html

+ 3 - 0
layouts/partials/header.html

@@ -18,6 +18,9 @@
   {{ $scr := .Scratch }}
   {{ partial "css/parse_theme.css" . }}
   {{ $sri := .Site.Data.sri }}
+  {{ if ne ($scr.Get "primary") "#fff" }}
+  <meta name="theme-color" content="{{ $scr.Get "primary" }}">
+  {{ end }}
   {{/* Default to enabling highlighting, but allow the user to override it in .Params or .Site.Params.
        Use $scr to store "highlight_enabled", so that we can read it again in footer.html. */}}
   {{ $scr.Set "highlight_enabled" true }}