git: aa85bf35fe - main - Improve SEO adding Open Graph and Twitter card

Sergio Carlavilla Delgado <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
The branch main has been updated by carlavilla:

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

commit aa85bf35fec1408074b046a7d8c63f9156055266
Author:     Sergio Carlavilla Delgado <[email protected]>
AuthorDate: 2021-05-09 11:29:55 +0000
Commit:     Sergio Carlavilla Delgado <[email protected]>
CommitDate: 2021-05-09 11:29:55 +0000

    Improve SEO adding Open Graph and Twitter card
---
 .../themes/beastie/layouts/articles/baseof.html    | 22 +++++++++++++++++++++-
 .../themes/beastie/layouts/books/baseof.html       | 22 +++++++++++++++++++++-
 .../themes/beastie/layouts/partials/site-head.html | 16 ++++++++++++----
 3 files changed, 54 insertions(+), 6 deletions(-)

diff --git a/documentation/themes/beastie/layouts/articles/baseof.html b/documentation/themes/beastie/layouts/articles/baseof.html
index e4e596e122..0f8c17d313 100644
--- a/documentation/themes/beastie/layouts/articles/baseof.html
+++ b/documentation/themes/beastie/layouts/articles/baseof.html
@@ -8,11 +8,31 @@
     <meta name="copyright" content="1995-2021 The FreeBSD Foundation">
     <link rel="canonical" href="{{ .Permalink }}" />
 
-    <title>{{ block "title" . }}{{ with .Params.Title }} {{ . }}{{ end }}{{ end }}</title>
+    <title>{{ block "title" . }}{{ .Site.Title }}{{ with .Params.Title }} | {{ . }}{{ end }}{{ end }}</title>
 
+    <!-- FAVICON -->
     <link rel="shortcut icon" href="{{ absLangURL ($.Site.BaseURL) }}favicon.ico">
+
+    <meta name="theme-color" content="#790000">
+    <!-- END FAVICON -->
+
     <link rel="stylesheet" href="{{ absLangURL ($.Site.BaseURL) }}css/docbook.css">
     <link rel="stylesheet" href="{{ absLangURL ($.Site.BaseURL) }}css/font-awesome-min.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 }}" />
+    <!-- END SEO -->
   </head>
   <body>
     <main>
diff --git a/documentation/themes/beastie/layouts/books/baseof.html b/documentation/themes/beastie/layouts/books/baseof.html
index e4e596e122..0f8c17d313 100644
--- a/documentation/themes/beastie/layouts/books/baseof.html
+++ b/documentation/themes/beastie/layouts/books/baseof.html
@@ -8,11 +8,31 @@
     <meta name="copyright" content="1995-2021 The FreeBSD Foundation">
     <link rel="canonical" href="{{ .Permalink }}" />
 
-    <title>{{ block "title" . }}{{ with .Params.Title }} {{ . }}{{ end }}{{ end }}</title>
+    <title>{{ block "title" . }}{{ .Site.Title }}{{ with .Params.Title }} | {{ . }}{{ end }}{{ end }}</title>
 
+    <!-- FAVICON -->
     <link rel="shortcut icon" href="{{ absLangURL ($.Site.BaseURL) }}favicon.ico">
+
+    <meta name="theme-color" content="#790000">
+    <!-- END FAVICON -->
+
     <link rel="stylesheet" href="{{ absLangURL ($.Site.BaseURL) }}css/docbook.css">
     <link rel="stylesheet" href="{{ absLangURL ($.Site.BaseURL) }}css/font-awesome-min.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 }}" />
+    <!-- END SEO -->
   </head>
   <body>
     <main>
diff --git a/documentation/themes/beastie/layouts/partials/site-head.html b/documentation/themes/beastie/layouts/partials/site-head.html
index 0cc0013fdf..20c05cce39 100644
--- a/documentation/themes/beastie/layouts/partials/site-head.html
+++ b/documentation/themes/beastie/layouts/partials/site-head.html
@@ -11,16 +11,24 @@
   <!-- FAVICON -->
   <link rel="shortcut icon" href="{{ absLangURL ($.Site.BaseURL) }}favicon.ico">
 
-
   <meta name="theme-color" content="#790000">
   <!-- END FAVICON -->
 
-
   <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 }}" />
   <!-- END SEO -->
 
 </head>
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-doc-all
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.