SEOOptimierungenAlex07092025

This commit is contained in:
astosic 2025-09-08 01:15:11 +02:00
parent 6828c3f835
commit b7f8f2ac5e
34 changed files with 4426 additions and 253 deletions

View file

@ -1,87 +1,122 @@
{{ partial "seo.html" . }}
<meta charset="utf-8">
<title>{{.Title | default site.Title}}</title>
<!-- base url -->
<title>
{{- if .IsHome -}}
Ingenieurbüro für PV, Speicher & Ladeinfrastruktur | AMPERION
{{- else -}}
{{- with .Params.meta_title -}}
{{ . }}
{{- else -}}
{{ .Title }} | AMPERION
{{- end -}}
{{- end -}}
</title>
<!-- base url (vom Theme genutzt, belassen) -->
{{ if or (eq site.BaseURL "/") (eq site.BaseURL "http://localhost:1313/") (eq site.BaseURL "http://examplesite.org/") (eq site.BaseURL "https://examplesite.org/") (eq site.BaseURL "http://examplesite.com/") (eq site.BaseURL "https://examplesite.com/")}}{{else}}
<base href="{{ .Permalink }}">
{{ end }}
<!-- multilingual SEO optimizations -->
{{ if .IsTranslated }}
{{ range .AllTranslations }}
<link rel="alternate" hreflang="{{.Lang}}" href="{{ .RelPermalink | absLangURL }}">
{{ end }}
<link rel="alternate" hreflang="x-default" href="{{ .RelPermalink | absLangURL }}">
<!-- Canonical + self-referential hreflang -->
<link rel="canonical" href="{{ .Permalink }}">
<link rel="alternate" hreflang="{{ site.LanguageCode | default `de-AT` }}" href="{{ .Permalink }}">
{{ if not .IsTranslated }}
<link rel="alternate" hreflang="x-default" href="{{ .Permalink }}">
{{ end }}
<!-- mobile responsive meta -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
<meta name="description" content="{{ .Params.Description | default site.Params.description }}">
{{ with site.Params.author }}
<meta name="author" content="{{ . }}">{{ end }}
<!-- Multilingual alternates -->
{{ if .IsTranslated }}
{{ range .AllTranslations }}
<link rel="alternate" hreflang="{{ .Lang }}" href="{{ .RelPermalink | absLangURL }}">
{{ end }}
<link rel="alternate" hreflang="x-default" href="{{ .RelPermalink | absLangURL }}">
{{ end }}
<!-- Viewport: nur EIN Tag -->
<meta name="viewport" content="width=device-width, initial-scale=1">
{{ with site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
{{ hugo.Generator }}
<!-- theme meta -->
<!-- Optional: manuelles Preload von Bildern pro Seite -->
{{ with .Params.preload_images }}
{{ range . }}
<link rel="preload" as="image" href="{{ . | relURL }}">
{{ end }}
{{ end }}
{{ with .Params.robots }}<meta name="robots" content="{{ . }}">{{ end }}
<!-- Theme / Manifest / Favicons -->
<meta name="theme-name" content="airspace-hugo" />
<!-- favicon -->
{{ $favicon:= site.Params.favicon }}
{{ $favicon := site.Params.favicon }}
{{ if $favicon }}
{{ if fileExists (add `assets/` $favicon) }}
{{ $favicon:= resources.Get $favicon }}
{{ $favicon_16:= $favicon.Resize "16x png"}}
{{ $favicon_32:= $favicon.Resize "32x png"}}
{{ $favicon_180:= $favicon.Resize "180x png"}}
<link rel="shortcut icon" href="{{$favicon_32.RelPermalink}}" type="image/x-icon">
<link rel="icon" href="{{$favicon_32.RelPermalink}}" type="image/x-icon">
<link rel="icon" type="image/png" sizes="16x16" href="{{$favicon_16.RelPermalink}}">
<link rel="icon" type="image/png" sizes="32x32" href="{{$favicon_32.RelPermalink}}">
<link rel="apple-touch-icon" sizes="180x180" href="{{$favicon_180.RelPermalink}}">
{{ if fileExists (add `assets/` $favicon) }}
{{ $fav := resources.Get $favicon }}
{{ $f16 := $fav.Resize "16x png" }}
{{ $f32 := $fav.Resize "32x png" }}
{{ $f180 := $fav.Resize "180x png" }}
<link rel="shortcut icon" href="{{ $f32.RelPermalink }}" type="image/x-icon">
<link rel="icon" href="{{ $f32.RelPermalink }}" type="image/x-icon">
<link rel="icon" type="image/png" sizes="16x16" href="{{ $f16.RelPermalink }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ $f32.RelPermalink }}">
<link rel="apple-touch-icon" sizes="180x180" href="{{ $f180.RelPermalink }}">
{{ end }}
{{ end }}
{{ end }}
<link rel="manifest" href="{{`manifest.webmanifest` | relLangURL }}">
<meta name="msapplication-TileColor" content="{{site.Params.variables.color_primary | default `#da532c`}}">
<meta name="theme-color" content="{{site.Params.variables.body_color | default `#ffffff` }}">
<link rel="manifest" href="{{ `manifest.webmanifest` | relLangURL }}">
<meta name="msapplication-TileColor" content="{{ site.Params.variables.color_primary | default `#da532c` }}">
<meta name="theme-color" content="{{ site.Params.variables.body_color | default `#ffffff` }}">
<!-- Open Graph image and Twitter Card meta-data -->
<!-- OG/Twitter: Bild + Maße + Card (einheitlich, ohne Duplikate) -->
{{ $image_path := .Params.image | default site.Params.image }}
{{ $image_path_local := printf "assets/%s" $image_path }}
{{ $image_path_local := printf "assets/%s" $image_path }}
{{ $image_ext := trim (path.Ext $image_path | lower) "." }}
{{/* Titel & Beschreibung für OG/Twitter */}}
{{ $ogt := cond .IsHome "Ingenieurbüro für PV, Speicher & Ladeinfrastruktur | AMPERION" (cond .Params.meta_title .Params.meta_title (printf "%s | AMPERION" .Title)) }}
{{ $desc := .Params.meta_description | default site.Params.description }}
{{ $isArticle := in (slice "post" "posts" "blog" "blogs" "news") .Section }}
<meta property="og:type" content="{{ if $isArticle }}article{{ else }}website{{ end }}">
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:title" content="{{ $ogt }}">
{{ with $desc }}<meta property="og:description" content="{{ . | plainify }}">{{ end }}
{{ if fileExists $image_path_local }}
<meta property="og:image" content="{{ $image_path | absURL }}" />
<!-- If not SVG, read image aspect ratio and define Twitter Card and Open Graph width and height -->
{{ if ne $image_ext "svg" }}
{{ with (imageConfig $image_path_local) }}
{{ if (and (gt .Width 144) (gt .Height 144)) }}
<meta name="twitter:image" content="{{ $image_path | absURL }}" />
<meta name="twitter:card"
content="summary{{ if (and (gt .Width 300) (gt .Height 157) (not (eq .Width .Height))) }}_large_image{{ end }}">
{{ end }}
<meta property="og:image:width" content="{{ .Width }}">
<meta property="og:image:height" content="{{ .Height }}">
{{ end }}
<meta property="og:image" content="{{ $image_path | absURL }}">
{{ if ne $image_ext "svg" }}
{{ with (imageConfig $image_path_local) }}
{{ if (and (gt .Width 144) (gt .Height 144)) }}
<meta name="twitter:image" content="{{ $image_path | absURL }}">
{{ end }}
<meta property="og:image:width" content="{{ .Width }}">
<meta property="og:image:height" content="{{ .Height }}">
{{ end }}
{{ end }}
{{ end }}
{{ end }}
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="{{ $ogt }}">
{{ with $desc }}<meta name="twitter:description" content="{{ . | plainify }}">{{ end }}
{{ template "_internal/opengraph.html" . }}
<!-- AOS Animation CSS -->
<link rel="stylesheet" href="https://unpkg.com/aos@next/dist/aos.css" />
<!-- AOS CSS + Bootstrap (defer) -->
<link rel="stylesheet" href="https://unpkg.com/aos@next/dist/aos.css">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" defer></script>
<!-- Hugo SCSS Pipeline mit Template-Parsing -->
{{- $scss := resources.Get "scss/style.scss" | resources.ExecuteAsTemplate "scss/style.scss" . | toCSS (dict "targetPath" "css/style.css") | minify -}}
<link rel="stylesheet" href="{{ $scss.RelPermalink }}">
<!-- Styles: werden über partial "style.html" eingebunden (nicht hier erneut) -->
<!-- Strukturierte Daten: Organization -->
{{ if templates.Exists "partials/ld-org.html" }}
{{ partial "ld-org.html" . }}
{{ end }}
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
@ -92,4 +127,4 @@
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
<!-- End Matomo -->