-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathhead.html
More file actions
95 lines (82 loc) · 3.79 KB
/
head.html
File metadata and controls
95 lines (82 loc) · 3.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
{{ $style := resources.Get "/sass/main.scss" | resources.ToCSS | resources.Minify | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
<script src="/js/highlight.min.js" defer></script>
{{ $script := resources.Get "/js/main.js" | resources.Minify }}
<script src="{{ $script.RelPermalink }}" defer></script>
<link rel="icon" href="/favicon.ico" sizes="any">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<title>{{ if .Page.Title }}{{ .Page.Title }}{{ else }}{{ .Site.Title }}{{ end }}</title>
<meta name="description" content="{{ if .Page.Description }}{{ .Page.Description }}{{ else }}{{ .Site.Params.Description }}{{ end }}">
<link rel="canonical" href="{{ .Permalink }}" />
{{ $langaugesData := .Site.Data.languages }}
{{ $pageDocs := .Page.Params.Docs }}
{{ $siteBaseUrl := .Site.BaseURL }}
{{ $fileBaseName := "" }}
{{ with .File }}
{{ $fileBaseName = .ContentBaseName }}
{{ end }}
{{ $ogTitle := .Site.Title }}
{{ $ogDescription := .Site.Params.Description }}
{{ $ogImage := printf "%s/images/share-image.png" $siteBaseUrl }}
{{ with .Page.Params.ogImage }}
{{ $ogImage = printf "%s%s" $siteBaseUrl . }}
{{ end }}
{{ if and (not .IsSection) (eq .Section "modules") }}
{{ with .Page.Title }}
{{ $ogTitle = printf "Testcontainers %s Module" . }}
{{ $languages := slice }}
{{ range $pageDocs }}
{{ $language := where $langaugesData "id" .id }}
{{ $lang := index $language 0 }}
{{ $languages = $languages | append $lang.label }}
{{ end }}
{{ $ogDescription = printf "Start testing with real dependencies using the %s Module for Testcontainers for %s" . (delimit $languages ", " ", and ") }}
{{ end }}
{{ $ogImage = printf "%s/images/module-share-image.png" $siteBaseUrl }}
{{/* generated share image */}}
{{- with resources.Get (printf "/images/modules/share-logos/%s.png" $fileBaseName) }}
{{- $logoImg := . -}}
{{- $finalFilter := (images.Overlay $logoImg 814 173 ) -}}
{{- $shareImage := resources.Get "/images/modules/module-share-image.png" }}
{{ if $shareImage }}
{{- $shareImage = $shareImage | images.Filter $finalFilter -}}
{{ $ogImage = $shareImage.Permalink }}
{{- end }}
{{ end }}
{{/* local path share image */}}
{{ with .Resources.Get "share.png" }}
{{ $ogImage = .Permalink }}
{{ end }}
{{/* assets share image */}}
{{ with resources.Get (printf "/images/modules/%s-share.png" $fileBaseName) }}
{{ $ogImage = .Permalink }}
{{ end }}
{{ else if and (not .IsSection) (eq .Section "community-champions") }}
{{ $ogTitle = printf "Community Champion: %s" .Page.Title }}
{{ $ogDescription = printf "View the Testcontainers Community Champion profile for %s" .Page.Title }}
{{ $shareImage := resources.Get (printf "/images/community-champions/%s-share.png" $fileBaseName) }}
{{ if $shareImage }}
{{ $ogImage = $shareImage.Permalink }}
{{ else }}
{{ $ogImage = printf "%s/images/community-champions-share-image.png" $siteBaseUrl }}
{{ end }}
{{ else }}
{{ with .Page.Title }}
{{ $ogTitle = . }}
{{ end }}
{{ with .Page.Description }}
{{ $ogDescription = . }}
{{ end }}
{{ with .Page.Params.shareImage }}
{{ $ogImage = printf "%s/images/%s" $siteBaseUrl . }}
{{ end }}
{{ end }}
<meta property="og:title" content="{{ $ogTitle }}">
<meta property="og:site_name" content="{{ .Site.Title }}">
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:description" content="{{ $ogDescription }}">
<meta property="og:type" content=website>
<meta property="og:image" content="{{ $ogImage }}">
<script src="/search.js" defer></script>