Files
doc.rustdesk.com/layouts/partials/schema.html
rustdesk 1736869d5f seo/geo
2026-03-20 15:16:55 +08:00

103 lines
3.0 KiB
HTML

{{- $siteDescription := .Site.Params.description | plainify | htmlUnescape | chomp -}}
{{- $description := partial "utils/page-description.html" . | plainify | htmlUnescape | chomp -}}
{{- $softwareDescription := partial "utils/software-description.html" . | plainify | htmlUnescape | chomp -}}
{{- $keywords := .Params.keywords | default .Site.Language.Params.keywords | default .Site.Params.keywords -}}
{{- $imageURL := "" -}}
{{- with .Params.images }}
{{- $imageURL = index . 0 | absURL -}}
{{- else }}
{{- with .Site.Params.images }}
{{- $imageURL = index . 0 | absURL -}}
{{- end -}}
{{- end -}}
{{- $orgID := "https://rustdesk.com/#organization" -}}
{{- $websiteID := printf "%s#website" .Site.Home.Permalink -}}
{{- $pageID := printf "%s#webpage" .Permalink -}}
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
{{- $org := dict
"@type" "Organization"
"@id" $orgID
"name" "RustDesk"
"url" "https://rustdesk.com"
"sameAs" (slice
"https://github.com/rustdesk"
"https://twitter.com/rustdesk"
"https://discord.com/invite/nDceKgxnkV"
"https://www.reddit.com/r/rustdesk/"
)
"contactPoint" (dict
"@type" "ContactPoint"
"contactType" "Support"
"email" (.Site.Params.authorEmail | default "support@rustdesk.com")
)
-}}
{{- if $imageURL -}}
{{- $org = merge $org (dict "logo" (dict "@type" "ImageObject" "url" $imageURL)) -}}
{{- end -}}
{{- $website := dict
"@type" "WebSite"
"@id" $websiteID
"url" .Site.Home.Permalink
"name" .Site.Title
"description" $siteDescription
"publisher" (dict "@id" $orgID)
"inLanguage" .Site.Language.Lang
-}}
{{- $software := dict
"@type" "SoftwareApplication"
"name" "RustDesk"
"description" $softwareDescription
"applicationCategory" "BusinessApplication"
"operatingSystem" "Windows, macOS, Linux, iOS, Android, Web"
"url" "https://rustdesk.com"
-}}
{{- $pageType := "WebPage" -}}
{{- if .IsSection -}}
{{- $pageType = "CollectionPage" -}}
{{- else if .IsPage -}}
{{- $pageType = "TechArticle" -}}
{{- end -}}
{{- $page := dict
"@type" $pageType
"@id" $pageID
"url" .Permalink
"name" .Title
"description" $description
"isPartOf" (dict "@id" $websiteID)
"publisher" (dict "@id" $orgID)
"inLanguage" .Site.Language.Lang
"about" $software
-}}
{{- if $keywords -}}
{{- $page = merge $page (dict "keywords" $keywords) -}}
{{- end -}}
{{- if $imageURL -}}
{{- $page = merge $page (dict "image" (dict "@type" "ImageObject" "url" $imageURL)) -}}
{{- end -}}
{{- if .IsPage -}}
{{- $page = merge $page (dict
"headline" .Title
"author" (dict "@id" $orgID)
"mainEntityOfPage" (dict "@type" "WebPage" "@id" $pageID)
) -}}
{{- with .PublishDate -}}
{{- $page = merge $page (dict "datePublished" (.Format $iso8601)) -}}
{{- end -}}
{{- with .Lastmod -}}
{{- $page = merge $page (dict "dateModified" (.Format $iso8601)) -}}
{{- end -}}
{{- end -}}
{{- $schema := dict
"@context" "https://schema.org"
"@graph" (slice $org $website $page)
-}}
<script type="application/ld+json">{{ $schema | jsonify | safeJS }}</script>