Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 May 2021 20:56:03 GMT
From:      Sergio Carlavilla Delgado <carlavilla@FreeBSD.org>
To:        doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org
Subject:   git: 9d3afad07d - main - Improve the SEO adding the schema.org tags
Message-ID:  <202105132056.14DKu3r9063424@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by carlavilla:

URL: https://cgit.FreeBSD.org/doc/commit/?id=9d3afad07d2b9aa473a158e504785437ff9b7184

commit 9d3afad07d2b9aa473a158e504785437ff9b7184
Author:     Sergio Carlavilla Delgado <carlavilla@FreeBSD.org>
AuthorDate: 2021-05-13 20:54:45 +0000
Commit:     Sergio Carlavilla Delgado <carlavilla@FreeBSD.org>
CommitDate: 2021-05-13 20:54:45 +0000

    Improve the SEO adding the schema.org tags
---
 .../themes/beastie/layouts/articles/baseof.html    | 10 +++++++
 .../themes/beastie/layouts/books/baseof.html       | 10 +++++++
 .../themes/beastie/layouts/partials/site-head.html | 34 ++++++++++++++--------
 3 files changed, 42 insertions(+), 12 deletions(-)

diff --git a/documentation/themes/beastie/layouts/articles/baseof.html b/documentation/themes/beastie/layouts/articles/baseof.html
index 0f8c17d313..552ece4ca6 100644
--- a/documentation/themes/beastie/layouts/articles/baseof.html
+++ b/documentation/themes/beastie/layouts/articles/baseof.html
@@ -32,6 +32,16 @@
     <meta property="og:locale" content="{{ $.Site.Language.Lang | default "en" }}" />
     <meta property="og:url" content="{{ .Permalink }}" />
     <meta property="og:site_name" content="{{ .Site.Title }}" />
+    <script type="application/ld+json">
+      {
+        "@context": "http://schema.org",
+        "@type": "WebSite",
+        "url": "{{ .Permalink }}",
+        "name": "{{ .Title }}",
+        "headline": "{{ .Title }}",
+        "description": "{{ .Description }}"
+      }
+    </script>
     <!-- END SEO -->
   </head>
   <body>
diff --git a/documentation/themes/beastie/layouts/books/baseof.html b/documentation/themes/beastie/layouts/books/baseof.html
index 0f8c17d313..1f70b7c22e 100644
--- a/documentation/themes/beastie/layouts/books/baseof.html
+++ b/documentation/themes/beastie/layouts/books/baseof.html
@@ -32,6 +32,16 @@
     <meta property="og:locale" content="{{ $.Site.Language.Lang | default "en" }}" />
     <meta property="og:url" content="{{ .Permalink }}" />
     <meta property="og:site_name" content="{{ .Site.Title }}" />
+    <script type="application/ld+json">
+      {
+        "@context": "http://schema.org",
+        "@type": "Book",
+        "url": "{{ .Permalink }}",
+        "name": "{{ .Title }}",
+        "headline": "{{ .Title }}",
+        "description": "{{ .Description }}"
+      }
+    </script>
     <!-- END SEO -->
   </head>
   <body>
diff --git a/documentation/themes/beastie/layouts/partials/site-head.html b/documentation/themes/beastie/layouts/partials/site-head.html
index 20c05cce39..8ab1b3b283 100644
--- a/documentation/themes/beastie/layouts/partials/site-head.html
+++ b/documentation/themes/beastie/layouts/partials/site-head.html
@@ -17,18 +17,28 @@
   <link rel="stylesheet" href="{{ absLangURL ($.Site.BaseURL) }}css/fixed.css">
 
   <!-- SEO -->
-    <meta name="twitter:card" content="summary"/>
-    <meta name="twitter:domain" content="docs.FreeBSD.org"/>
-    <meta name="twitter:site" content="@freebsd"/>
-    <meta name="twitter:url" content="https://twitter.com/freebsd"/>;
-    <meta property="og:title" content="{{ if .IsHome }}{{ .Site.Params.Title }}{{ else }}{{ .Title }}{{ end }}" />
-    <meta property="og:description" content="{{ if .IsHome }}{{ .Site.Params.description }}{{ else }}{{ .Description }}{{ end }}" />
-    <meta property="og:type" content="website"/>
-    <meta property="og:image" content="{{ absLangURL ($.Site.BaseURL) }}favicon.ico"/>
-    <meta property="og:image:alt" content="FreeBSD Logo">
-    <meta property="og:locale" content="{{ $.Site.Language.Lang | default "en" }}" />
-    <meta property="og:url" content="{{ .Permalink }}" />
-    <meta property="og:site_name" content="{{ .Site.Title }}" />
+  <meta name="twitter:card" content="summary"/>
+  <meta name="twitter:domain" content="docs.FreeBSD.org"/>
+  <meta name="twitter:site" content="@freebsd"/>
+  <meta name="twitter:url" content="https://twitter.com/freebsd"/>;
+  <meta property="og:title" content="{{ if .IsHome }}{{ .Site.Params.Title }}{{ else }}{{ .Title }}{{ end }}" />
+  <meta property="og:description" content="{{ if .IsHome }}{{ .Site.Params.description }}{{ else }}{{ .Description }}{{ end }}" />
+  <meta property="og:type" content="website"/>
+  <meta property="og:image" content="{{ absLangURL ($.Site.BaseURL) }}favicon.ico"/>
+  <meta property="og:image:alt" content="FreeBSD Logo">
+  <meta property="og:locale" content="{{ $.Site.Language.Lang | default "en" }}" />
+  <meta property="og:url" content="{{ .Permalink }}" />
+  <meta property="og:site_name" content="{{ .Site.Title }}" />
+  <script type="application/ld+json">
+    {
+      "@context": "http://schema.org",
+      "@type": "Article",
+      "url": "{{ .Permalink }}",
+      "name": "{{ .Site.Title }}",
+      "headline": "{{ .Site.Title }}",
+      "description": "{{ .Site.Params.description }}"
+    }
+  </script>
   <!-- END SEO -->
 
 </head>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105132056.14DKu3r9063424>