7
1
mirror of https://gitlab.com/ansol/web-ansol.org.git synced 2024-11-12 17:45:46 +00:00
web-ansol.org/themes/academic/layouts/partials/site_head.html

83 lines
3.6 KiB
HTML

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="author" content="ANSOL - Associação Nacional para o Software Livre">
{{ $scr := .Scratch -}}
{{ $desc := "" -}}
{{ if .Params.summary -}}
{{ $desc = .Params.summary -}}
{{ else if .Params.abstract -}}
{{ $desc = .Params.abstract -}}
{{ else if .IsPage -}}
{{ $desc = .Summary -}}
{{ else if site.Params.description -}}
{{ $desc = site.Params.description -}}
{{ end -}}
{{ .Scratch.Set "desc" $desc -}}
<meta name="description" content="{{ $desc }}">
{{ partial "functions/parse_theme" . -}}
{{ $css := site.Data.assets.css -}}
{{ $js := site.Data.assets.js -}}
{{ if ne ($scr.Get "primary") "#fff" }}
<meta name="theme-color" content="{{ $scr.Get "primary" }}">
{{ end -}}
{{ if or .Params.math site.Params.math -}}
{{ $mathjax_config := resources.Get "js/mathjax-config.js" -}}
<script src="{{ $mathjax_config.RelPermalink }}"></script>
{{ end -}}
{{ if or (eq site.Params.map.engine 2) (eq site.Params.map.engine 3) -}}
{{/* printf "<link rel=\"stylesheet\" href=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\">" (printf $css.leaflet.url $css.leaflet.version) $css.leaflet.sri | safeHTML */}}
{{ end -}}
{{ if eq site.Params.search.engine 2 -}}
{{ printf "<link rel=\"stylesheet\" href=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\">" (printf $css.instantsearch.url $css.instantsearch.version) $css.instantsearch.sri | safeHTML }}
{{ printf "<link rel=\"stylesheet\" href=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\">" (printf $css.instantsearchTheme.url $css.instantsearchTheme.version) $css.instantsearchTheme.sri | safeHTML }}
{{ end -}}
{{ $css_options := dict "targetPath" "css/ansol.css" -}}
{{- if (in (slice (getenv "HUGO_ENV") hugo.Environment) "production") -}}
{{- $css_options = merge $css_options (dict "outputStyle" "compressed") -}}
{{- end -}}
{{ $sass_template := resources.Get "scss/ansol.scss" -}}
{{ $style := $sass_template | resources.ExecuteAsTemplate "ansol_parsed.scss" . | toCSS $css_options -}}
{{- if (eq (getenv "HUGO_ENV") "production") -}}
{{- $style = $style | minify | fingerprint "md5" -}}
{{- end -}}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
{{ $css_options := dict "targetPath" "css/fonts.css" -}}
{{- if (in (slice (getenv "HUGO_ENV") hugo.Environment) "production") -}}
{{- $css_options = merge $css_options (dict "outputStyle" "compressed") -}}
{{- end -}}
{{ $sass_template := resources.Get "scss/fonts.scss" -}}
{{ $style := $sass_template | resources.ExecuteAsTemplate "ansol_parsed.scss" . | toCSS $css_options -}}
{{- if (eq (getenv "HUGO_ENV") "production") -}}
{{- $style = $style | minify | fingerprint "md5" -}}
{{- end -}}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
{{ with .OutputFormats.Get "RSS" -}}
<link rel="alternate" href="{{.RelPermalink}}" type="application/rss+xml" title="{{site.Title}}">
{{ end -}}
<link rel="manifest" href="{{ "index.webmanifest" | relLangURL }}">
<link rel="icon" type="image/png" href="{{(partial "functions/get_icon" 32).RelPermalink}}">
<link rel="apple-touch-icon" type="image/png" href="{{(partial "functions/get_icon" 192).RelPermalink}}">
<link rel="canonical" href="{{ .Permalink }}">
{{ partial "open_graph" . }}
{{ partial "jsonld/main" (dict "page" . "summary" $desc) }}
{{ partial "custom_head" . }}
<title>{{ if not .IsHome }}{{ .Title }} | {{ end }}{{ site.Title }}</title>
</head>