7
1
mirror of https://gitlab.com/ansol/web-ansol.org.git synced 2024-11-28 08:47:42 +00:00
web-ansol.org/themes/academic/layouts/partials/site_head.html

83 lines
3.6 KiB
HTML
Raw Normal View History

2020-06-11 11:46:16 +00:00
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
2021-10-28 14:52:49 +00:00
<meta name="author" content="ANSOL - Associação Nacional para o Software Livre">
2020-06-11 11:46:16 +00:00
{{ $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 -}}
2020-06-11 11:46:16 +00:00
<meta name="description" content="{{ $desc }}">
{{ partial "functions/parse_theme" . -}}
{{ $css := site.Data.assets.css -}}
{{ $js := site.Data.assets.js -}}
2020-06-11 11:46:16 +00:00
{{ if ne ($scr.Get "primary") "#fff" }}
<meta name="theme-color" content="{{ $scr.Get "primary" }}">
{{ end -}}
2020-06-11 11:46:16 +00:00
{{ if or .Params.math site.Params.math -}}
{{ $mathjax_config := resources.Get "js/mathjax-config.js" -}}
2020-06-11 11:46:16 +00:00
<script src="{{ $mathjax_config.RelPermalink }}"></script>
{{ end -}}
2020-06-11 11:46:16 +00:00
{{ 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 -}}
2020-06-11 11:46:16 +00:00
{{ if eq site.Params.search.engine 2 -}}
2021-10-28 14:52:49 +00:00
{{ 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 -}}
2020-06-11 11:46:16 +00:00
{{ $css_options := dict "targetPath" "css/ansol.css" -}}
2020-06-11 11:46:16 +00:00
{{- 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 -}}
2020-06-11 11:46:16 +00:00
{{- if (eq (getenv "HUGO_ENV") "production") -}}
{{- $style = $style | minify | fingerprint "md5" -}}
{{- end -}}
2021-10-28 16:32:48 +00:00
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
2020-06-11 11:46:16 +00:00
{{ $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 }}">
2020-06-11 11:46:16 +00:00
{{ with .OutputFormats.Get "RSS" -}}
2020-06-11 11:46:16 +00:00
<link rel="alternate" href="{{.RelPermalink}}" type="application/rss+xml" title="{{site.Title}}">
{{ end -}}
2020-06-11 11:46:16 +00:00
<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" . }}
2020-06-11 11:46:16 +00:00
{{ partial "jsonld/main" (dict "page" . "summary" $desc) }}
{{ partial "custom_head" . }}
<title>{{ if not .IsHome }}{{ .Title }} | {{ end }}{{ site.Title }}</title>
</head>