post.html 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <script type="application/ld+json"> {
  2. "@context" : "http://schema.org",
  3. "@type" : "BlogPosting",
  4. {{ if .Params.categories }}{{ range .Params.categories }}"articleSection" : "{{ . }}",{{ end }}{{ end }}
  5. "name" : "{{ .Title | safeJS }}",
  6. "headline" : "{{ .Title | safeJS }}",
  7. "mainEntityOfPage": {
  8. "@type": "WebPage",
  9. "@id": "{{ .Permalink }}"
  10. },
  11. "description" : "{{ if .Description }}{{ .Description | plainify }}{{ else }}{{if .IsPage}}{{ .Summary | plainify }}{{ end }}{{ end }}",
  12. "inLanguage" : "{{ .Lang }}",
  13. {{ if .Params.author -}}
  14. "author": {
  15. "@type": "Person",
  16. "name": "{{ .Params.author }}"
  17. },
  18. {{- else if .Site.Params.author.name -}}
  19. "author": {
  20. "@type": "Person",
  21. "name": "{{ .Site.Params.author.name }}"
  22. },
  23. {{- end }}
  24. "copyrightYear" : "{{ .Site.Params.since }} - {{ .Site.Lastmod.Format "2006" }}",
  25. {{ if not .PublishDate.IsZero -}}
  26. "datePublished": "{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTML }}",
  27. {{- else if not .Date.IsZero -}}
  28. "datePublished": "{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}",
  29. {{- end }}
  30. {{ with .Lastmod -}}
  31. "dateModified": "{{ .Format "2006-01-02T15:04:05-07:00" | safeHTML }}",
  32. {{- end }}
  33. "url" : "{{ .Permalink }}",
  34. "wordCount" : "{{ .WordCount }}",
  35. "image" : "{{ .Site.Params.logo | absURL }}",
  36. "keywords" : [ "{{ range $i, $e := .Params.tags }}{{ if $i }}, {{ end }}{{ $e }}{{ end }}" ],
  37. "publisher" : {
  38. "@type": "Organization",
  39. "name" : "{{ .Site.BaseURL }}",
  40. "logo" : {
  41. "@type" : "ImageObject",
  42. "url" : "{{ .Site.Params.logo | absURL }}",
  43. "height" : 60 ,
  44. "width" : 60
  45. }
  46. }
  47. } </script>