[gimp-web/testing] Added structured data markup



commit 323a9a051f653121fa979e1b148cbf0173b3d860
Author: Pat David <pat patdavid net>
Date:   Thu Nov 26 22:01:59 2015 -0600

    Added structured data markup
    
    Added schema.org microdata and opengraph metadata to all the
    pages.  Currently using microdata '<meta itemprop...>', but
    can consider JSON-LD at some point as well.  This is a
    rudimentary implementation and can (should?) be extended.

 themes/newgimp/templates/article.html |   16 ++++++++++++++++
 themes/newgimp/templates/base.html    |    1 +
 themes/newgimp/templates/home.html    |   19 ++++++++-----------
 themes/newgimp/templates/index.html   |    9 +++++++++
 themes/newgimp/templates/page.html    |   19 +++++++++++++++++--
 5 files changed, 51 insertions(+), 13 deletions(-)
---
diff --git a/themes/newgimp/templates/article.html b/themes/newgimp/templates/article.html
index c9d568a..5008114 100644
--- a/themes/newgimp/templates/article.html
+++ b/themes/newgimp/templates/article.html
@@ -18,6 +18,22 @@
 
     <link rel='stylesheet' type='text/css' href="/theme/css/article.css" />
 
+    <meta itemprop='url' content='{{ SITEURL }}/{{ article.url }}' />
+    <meta itemprop='name' content='{{ SITENAME }} - {{ article.title|striptags }}' />
+    <meta itemprop='image' content='{{ SITEURL }}/images/frontpage/wilber-big.png' />
+
+    <meta property='og:url' content='{{ SITEURL }}/{{ article.url }}' />
+    <meta property='og:title' content='{{ SITENAME }} - {{ article.title|striptags }}' />
+    <meta property='og:image' content='{{ SITEURL }}/images/frontpage/wilber-big.png' />
+
+    {% if article.authors %}
+    {% for author in article.authors %}
+    <meta itemprop='author' content='{{ author }}' />
+    <meta property='og:author' content='{{ author }}' />
+    {% endfor %}
+    {% endif %}
+
+
 {% endblock head %}
 
 {% block content %}
diff --git a/themes/newgimp/templates/base.html b/themes/newgimp/templates/base.html
index 78f0555..89a3b7e 100644
--- a/themes/newgimp/templates/base.html
+++ b/themes/newgimp/templates/base.html
@@ -42,6 +42,7 @@
         {% if TAG_FEED_RSS and tag %}
         <link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_RSS|format(tag.slug) }}" type="application/rss+xml" 
rel="alternate" title="{{ SITENAME }} Tags RSS Feed" />
         {% endif %}
+
         {% endblock head %}
 </head>
 
diff --git a/themes/newgimp/templates/home.html b/themes/newgimp/templates/home.html
index f17e6d7..4e8e5dc 100644
--- a/themes/newgimp/templates/home.html
+++ b/themes/newgimp/templates/home.html
@@ -8,6 +8,14 @@
 
         <meta itemprop='url' content='{{ SITEURL }}' />
         <meta itemprop='name' content='GIMP - GNU Image Manipulation Program' />
+        <meta itemprop='image' content='{{ SITEURL }}/images/frontpage/wilber-big.png' />
+
+        <meta property='og:url' content='{{ SITEURL }}/{{ page.url }}' />
+        <meta property='og:title' content='{{ SITENAME }}' />
+        <meta property='og:image' content='{{ SITEURL }}/images/frontpage/wilber-big.png' />
+        <meta property='og:type' content='website' />
+        <meta property='og:site_name' content='{{ SITENAME }}' />
+
 {% endblock head %}
 
 
@@ -38,17 +46,6 @@
                 </div>
             </div>
 
-            {#
-            <div class="container" style="background-color: white;  padding: 1rem;  background: 
repeating-linear-gradient(-45deg, transparent, transparent 40px, rgba(166,166,166,0.3) 40px, 
rgba(166,166,166,.3) 80px); width: 100%; max-width: 100%; display: none;">
-                <h2 style="color: red;">STILL WORKING</h2>
-                <p style="font-size: 0.85rem;color: red;">
-                    I am still in the process of building this site out. 
-                    Things are in a great state of flux. 
-                    For further information on the new site refer to the <a href="/about/meta">Meta</a> page.
-                </p>
-            </div>
-            #}
-
         </header><!-- /#banner -->
 
 {% endblock header %}
diff --git a/themes/newgimp/templates/index.html b/themes/newgimp/templates/index.html
index 9c85b19..65ae47c 100644
--- a/themes/newgimp/templates/index.html
+++ b/themes/newgimp/templates/index.html
@@ -6,6 +6,15 @@
 {{ super() }}
 <link rel='stylesheet' type='text/css' href="/theme/css/page.css" />
 <link rel='stylesheet' type='text/css' href="/theme/css/news-index.css" />
+
+<meta itemprop='url' content='{{ SITEURL }}/{{ articles_page.url }}' />
+<meta itemprop='name' content='{{ SITENAME }} - News' />
+<meta itemprop='image' content='{{ SITEURL }}/images/frontpage/wilber-big.png' />
+
+<meta property='og:url' content='{{ SITEURL }}/{{ articles_page.url }}' />
+<meta property='og:title' content='{{ SITENAME }} - News' />
+<meta property='og:image' content='{{ SITEURL }}/images/frontpage/wilber-big.png' />
+
 {% endblock head %}
 
 
diff --git a/themes/newgimp/templates/page.html b/themes/newgimp/templates/page.html
index 387c10f..fd4d2dd 100644
--- a/themes/newgimp/templates/page.html
+++ b/themes/newgimp/templates/page.html
@@ -4,8 +4,23 @@
 
 {% block head %}
 {{ super() }}
-<link rel='stylesheet' type='text/css' href="/theme/css/page.css" />
-<link rel='stylesheet' type='text/css' href="/theme/css/pygments-default.css" />
+        <link rel='stylesheet' type='text/css' href="/theme/css/page.css" />
+        <link rel='stylesheet' type='text/css' href="/theme/css/pygments-default.css" />
+        
+        <meta itemprop='url' content='{{ SITEURL }}/{{ page.url }}' />
+        <meta itemprop='name' content='{{ SITENAME }} - {{ page.title|striptags }}' />
+        <meta itemprop='image' content='{{ SITEURL }}/images/frontpage/wilber-big.png' />
+
+        <meta property='og:url' content='{{ SITEURL }}/{{ page.url }}' />
+        <meta property='og:title' content='{{ SITENAME }} - {{ page.title|striptags }}' />
+        <meta property='og:image' content='{{ SITEURL }}/images/frontpage/wilber-big.png' />
+
+        {% if page.authors %}
+        {% for author in page.authors %}
+        <meta itemprop='author' content='{{ author }}' />
+        <meta property='og:author' content='{{ author }}' />
+        {% endfor %}
+        {% endif %}
 
 {% endblock head %}
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]