mirror of
https://github.com/qdrant/landing_page.git
synced 2026-09-25 22:18:30 +02:00
* fallback logic for social preview images * fallback logic for preview images
203 lines
6.8 KiB
HTML
203 lines
6.8 KiB
HTML
{{ if .Params.description }}
|
|
<meta name="description" content="{{ .Params.Description }}">
|
|
{{ else }}
|
|
<meta name="description" content="{{ .Site.Params.Description }}">
|
|
{{ end }}
|
|
|
|
{{ if .Params.keywords }}
|
|
<meta name="keywords" content="{{ range .Params.Keywords }}{{ . }}, {{ end }} qdrant">
|
|
{{ else }}
|
|
<meta name="keywords" content="{{ range .Site.Params.Keywords }}{{ . }}, {{ end }} qdrant">
|
|
{{ end }}
|
|
|
|
{{ if .IsHome }}
|
|
<script type="application/ld+json">
|
|
{
|
|
"@context": "https://schema.org",
|
|
"@type": "Organization",
|
|
"name": "Qdrant",
|
|
"legalName" : "Qdrant Solutions GmbH",
|
|
"url": "https://qdrant.tech",
|
|
"email": "info@qdrant.com",
|
|
"@id": "https://qdrant.tech",
|
|
"logo": "https://qdrant.tech/images/logo_with_text.png",
|
|
"headline" : "{{ .Title }}",
|
|
"description" : "{{ .Site.Params.description }}",
|
|
"keywords" : [ {{ range .Site.Params.Keywords }}"{{ . }}", {{ end }} "Qdrant" ],
|
|
"foundingDate": "2021",
|
|
"founders": [
|
|
{
|
|
"@type": "Person",
|
|
"name": "{{ .Site.Params.Author }}"
|
|
}, {
|
|
"@type": "Person",
|
|
"name": "Andre Zayarni"
|
|
}
|
|
],
|
|
"location": "Berlin, Germany",
|
|
"address": {
|
|
"@type": "PostalAddress",
|
|
"streetAddress": "Chausseestraße 86",
|
|
"addressLocality": "Berlin",
|
|
"addressRegion": "Berlin",
|
|
"postalCode": "10115",
|
|
"addressCountry": "DE"
|
|
},
|
|
"contactPoint": {
|
|
"@type": "ContactPoint",
|
|
"contactType": "customer support",
|
|
"telephone": "+49 3040797694",
|
|
"email": "info@qdrant.com"
|
|
},
|
|
"sameAs": [
|
|
{{ .Site.Params.github }},
|
|
{{ .Site.Params.twitter }},
|
|
{{ .Site.Params.linkedin }},
|
|
{{ .Site.Params.discord }}
|
|
],
|
|
"mainEntityOfPage": {
|
|
"@type": "SoftwareApplication",
|
|
"name": "Qdrant",
|
|
"applicationCategory": "Vector Search Engine",
|
|
"operatingSystem": "linux, macOS",
|
|
"downloadUrl": "https://github.com/qdrant/qdrant",
|
|
"installUrl": "https://hub.docker.com/r/qdrant/qdrant",
|
|
"abstract": "{{ .Site.Params.description }}",
|
|
"image": "https://qdrant.tech/images/logo_with_text.png"
|
|
}
|
|
}
|
|
</script>
|
|
{{ else if .Params.seo_schema }}
|
|
<!-- todo: use as default option -->
|
|
<script type="application/ld+json">
|
|
{{ .Params.seo_schema }}
|
|
</script>
|
|
{{ else if and (eq .Section "articles") .IsPage }}
|
|
<script type="application/ld+json">
|
|
{
|
|
"@context": "https://schema.org",
|
|
"@type": "Article",
|
|
"headline": "{{ .Params.title }}",
|
|
"image": [
|
|
{{ .Params.social_preview_image | absURL }},
|
|
],
|
|
"abstract": {{ .Params.description }},
|
|
"datePublished": {{ .Params.date }},
|
|
"dateModified": {{ .Params.date }},
|
|
"author": [{
|
|
"@type": "Person",
|
|
"name": {{ .Params.author }},
|
|
"url": {{ .Params.author_link }}
|
|
}]
|
|
}
|
|
</script>
|
|
{{ else if and (eq .Section "case-studies") .IsPage }}
|
|
<script type="application/ld+json">
|
|
{
|
|
"@context": "https://schema.org",
|
|
"@type": "Article",
|
|
"headline": "{{ .Params.title }}",
|
|
"image": [
|
|
{{ .Params.social_preview_image | absURL }},
|
|
],
|
|
"abstract": {{ .Params.description }},
|
|
"datePublished": {{ .Params.date }},
|
|
"dateModified": {{ .Params.date }}
|
|
}
|
|
</script>
|
|
{{ end }}
|
|
|
|
{{ $url := urls.Parse .Site.BaseURL }}
|
|
{{ $domain := index (split $url.Host ".") 0 }}
|
|
|
|
{{ $title := .Title }}
|
|
{{ if and ($.IsNode) (eq $.Section "") }}
|
|
{{ else }}
|
|
{{ $title = printf "%s - Qdrant" $title }}
|
|
{{ end }}
|
|
|
|
<!-- Facebook Meta Tags -->
|
|
<meta property="og:url" content="{{ .Permalink }}">
|
|
<meta property="og:type" content="website">
|
|
<meta property="og:title" content="{{ $title }}">
|
|
|
|
<!-- Twitter Meta Tags -->
|
|
<meta name="twitter:card" content="summary_large_image">
|
|
<meta name="twitter:domain" content="{{ $domain }}">
|
|
<meta name="twitter:url" content="{{ .Permalink }}">
|
|
<meta name="twitter:title" content="{{ $title }}">
|
|
|
|
{{ if .Params.description }}
|
|
<meta property="og:description" content="{{ .Params.description }}">
|
|
<meta name="twitter:description" content="{{ .Params.description }}">
|
|
{{ else }}
|
|
<meta property="og:description" content="{{ .Site.Params.description }}">
|
|
<meta name="twitter:description" content="{{ .Site.Params.description }}">
|
|
{{ end }}
|
|
|
|
<!-- Preview Image -->
|
|
{{ $image := index (.Site.Params.preview_images | shuffle ) 0 }}
|
|
|
|
<!-- Check image exist in `static` path -->
|
|
{{ with .File }}
|
|
{{ $preview_image_base := path.Join "static" .File.Dir .File.ContentBaseName }}
|
|
{{ $preview_image := printf "%s-social-preview.png" $preview_image_base }}
|
|
{{ $preview_image_exists := fileExists $preview_image }}
|
|
|
|
{{ if not $preview_image_exists }}
|
|
{{ $preview_image = printf "%s-social-preview.jpg" $preview_image_base }}
|
|
{{ $preview_image_exists = fileExists $preview_image }}
|
|
{{ end }}
|
|
|
|
{{ if not $preview_image_exists }}
|
|
{{ $preview_image = path.Join "static" .File.Dir .File.ContentBaseName "preview" "social_preview.jpg" }}
|
|
{{ $preview_image_exists = fileExists $preview_image }}
|
|
{{ end }}
|
|
|
|
{{ if not $preview_image_exists }}
|
|
{{ $preview_image = path.Join "static" .File.Dir .File.ContentBaseName "preview" "social_preview.png" }}
|
|
{{ $preview_image_exists = fileExists $preview_image }}
|
|
{{ end }}
|
|
|
|
|
|
{{ if not $preview_image_exists }}
|
|
<!-- If there are no image for document, check preview for the section -->
|
|
{{ $preview_image_base = path.Join "static" .File.Dir }}
|
|
{{ $preview_image = path.Join $preview_image_base "social-preview.png" }}
|
|
{{ $preview_image_exists = fileExists $preview_image }}
|
|
{{ end }}
|
|
|
|
{{ if $preview_image_exists }}
|
|
{{ $preview_image = strings.TrimPrefix "static/" $preview_image }}
|
|
{{ $preview_image = strings.TrimPrefix "/static" $preview_image }}
|
|
{{ $image = $preview_image }}
|
|
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
|
|
{{ if .Params.social_preview_image }}
|
|
{{ $image = .Params.social_preview_image }}
|
|
{{ end }}
|
|
|
|
|
|
<meta name="image" property="og:image" content="{{ $image | absURL }}">
|
|
<meta name="image" property="og:image:secure_url" content="{{ $image | absURL }}">
|
|
<meta property="og:image:type" content="image/jpeg" />
|
|
<meta property="og:image:width" content="1200" />
|
|
<meta property="og:image:height" content="630" />
|
|
<meta name="twitter:image:src" content="{{ $image | absURL }}">
|
|
|
|
<!-- Author -->
|
|
{{ if .Params.author }}
|
|
<meta name="author" content="{{ .Params.author }}">
|
|
{{ end }}
|
|
|
|
<!-- Canonical URL -->
|
|
{{ if (eq .Section "documentation") }}
|
|
{{ if .Params.canonicalUrl }}
|
|
<link rel="canonical" href="{{ .Params.canonicalUrl }}">
|
|
{{ else }}
|
|
<link rel="canonical" href="{{ .Permalink }}">
|
|
{{ end }}
|
|
{{ end }} |