This commit is contained in:
rustdesk
2026-03-20 15:16:55 +08:00
parent b6655924d6
commit 1736869d5f
462 changed files with 1479 additions and 124 deletions

View File

@@ -1,74 +1,102 @@
{{/* Schema.org JSON-LD structured data */}}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "{{ if .IsPage }}Article{{ else }}WebSite{{ end }}",
"name": "{{ .Title }}",
"headline": "{{ .Title }}",
{{- if .IsPage }}
"description": "{{ with .Description }}{{ . }}{{ else }}{{ .Summary }}{{ end }}",
"author": {
"@type": "Organization",
"name": "{{ .Site.Params.author }}",
"url": "https://rustdesk.com"
},
"publisher": {
"@type": "Organization",
"name": "{{ .Site.Params.author }}",
"url": "https://rustdesk.com",
{{- with .Site.Params.images }}
"logo": {
"@type": "ImageObject",
"url": "{{ index . 0 | absURL }}"
}
{{- end }}
},
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
{{- with .PublishDate }}"datePublished": "{{ .Format $iso8601 }}",{{ end }}
{{- with .Lastmod }}"dateModified": "{{ .Format $iso8601 }}",{{ end }}
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "{{ .Permalink }}"
},
{{- else }}
"description": "{{ .Site.Params.description }}",
"publisher": {
"@type": "Organization",
"name": "{{ .Site.Params.author }}",
"url": "https://rustdesk.com"
},
{{- end }}
"url": "{{ .Permalink }}",
{{- $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 }}
"image": {
"@type": "ImageObject",
"url": "{{ index . 0 | absURL }}"
},
{{- end }}
"inLanguage": "{{ .Site.Language.Lang }}",
"keywords": [
{{- if .Params.keywords -}}
{{- range $i, $keyword := .Params.keywords -}}
{{- if $i }}, {{ end }}"{{ $keyword }}"
{{- end -}}
{{- else if .Site.Language.Params.keywords -}}
{{- range $i, $keyword := .Site.Language.Params.keywords -}}
{{- if $i }}, {{ end }}"{{ $keyword }}"
{{- end -}}
{{- else if .Site.Params.keywords -}}
{{- range $i, $keyword := .Site.Params.keywords -}}
{{- if $i }}, {{ end }}"{{ $keyword }}"
{{- end -}}
{{- end }}
],
"about": {
"@type": "SoftwareApplication",
"name": "RustDesk",
"description": "Open source remote desktop software",
"applicationCategory": "BusinessApplication",
"operatingSystem": "Windows, macOS, Linux, iOS, Android",
"softwareVersion": "latest",
"url": "https://rustdesk.com"
}
}
</script>
{{- $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>