cupper-hugo-theme/layouts/partials/head.html
lucasradaelli 8984ca9d6a
Custom css and localization support (#28)
* Adds i18n support for theme

* Adds a way for sites to have custom css.

This change adds a param to the theme (called customCss), which allows sites to
provide extra css under static/, so that they don't need to copy the theme's css
whole file.

If no custom css is in the params, this change is NOP.
2020-06-01 13:47:51 -05:00

45 lines
1.6 KiB
HTML

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
{{ hugo.Generator }}
<link rel="canonical" href="{{ .Permalink }}">
{{ if .IsHome }}
{{ with .Site.Params.homeMetaContent }}
<meta name="description" content="{{ . | plainify }}">
{{ end }}
{{ end }}
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#000000">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="theme-color" content="#ffffff">
<link rel="stylesheet" href="{{ "css/prism.css" | absURL }}" media="none" onload="this.media='all';">
{{ $templateStyles := resources.Get "css/template-styles.css" }}
{{ $styles := $templateStyles | resources.ExecuteAsTemplate "css/styles.css" . }}
<link rel="stylesheet" type="text/css" href="{{ $styles.Permalink }}">
{{ range .Site.Params.customCss -}}
<link rel="stylesheet" href="{{ . | absURL }}">
{{- end }}
<style id="inverter" media="none">
.intro-and-nav, .main-and-footer { filter: invert(100%) }
* { background-color: inherit }
img:not([src*=".svg"]), .colors, iframe, .demo-container { filter: invert(100%) }
</style>
{{ $title := print .Title " | " .Site.Title }}
{{ if .IsHome }}
{{ $title = .Site.Title }}
{{ end }}
<title>{{ $title }}</title>
</head>