microdata => rdfa so I make academics happy

This commit is contained in:
Peter Molnar 2019-02-03 16:40:08 +00:00
parent da02d9ba95
commit d19efb6c68
6 changed files with 126 additions and 136 deletions

View file

@ -33,7 +33,7 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<main class="content-body h-feed hfeed {{ category.name }}"> <main class="content-body h-feed hfeed {{ category.name }}" vocab="http://schema.org/" typeof="Blog WebPage">
<header> <header>
<p> <p>
<svg width="128" height="128"><use xlink:href="#icon-{{ category.name }}" /></svg> <svg width="128" height="128"><use xlink:href="#icon-{{ category.name }}" /></svg>
@ -53,12 +53,12 @@
{% endif %} {% endif %}
{% set _ = year.append(post.year)%} {% set _ = year.append(post.year)%}
<article class="h-entry hentry singular" lang="{{ post.lang }}" itemprop="blogPost" itemscope="" itemtype="http://schema.org/BlogPosting" itemref="author"> <article class="h-entry hentry singular" lang="{{ post.lang }}" property="blogPost" typeof="BlogPosting">
<header> <header>
{% if category.display == 'flat' %} {% if category.display == 'flat' %}
<h3 class="p-name entry-title" itemprop="name headline" > <h3 class="p-name entry-title" property="headline">
{% else %} {% else %}
<h2 class="p-name entry-title" itemprop="name headline" > <h2 class="p-name entry-title" property="headline">
{% endif %} {% endif %}
{% if post.is_reply %} {% if post.is_reply %}
<svg class="icon" width="16" height="16"> <svg class="icon" width="16" height="16">
@ -80,11 +80,11 @@
{% else %} {% else %}
</h2> </h2>
{% endif %} {% endif %}
<a href="{{ post.url }}" itemprop="url mainEntityOfPage" class="u-url bookmark"></a> <a href="{{ post.url }}" property="url mainEntityOfPage" class="u-url bookmark"></a>
</header> </header>
{% if post.summary %} {% if post.summary %}
<div class="e-summary entry-summary" itemprop="description"> <div class="e-summary entry-summary" property="description">
{{ post.html_summary }} {{ post.html_summary }}
<p class="more"> <p class="more">
<a href="{{ post.url }}"> <a href="{{ post.url }}">
@ -93,36 +93,12 @@
</p> </p>
</div> </div>
{% else %} {% else %}
<div class="e-content entry-content" itemprop="articleBody"> <div class="e-content entry-content" property="articleBody">
{{ post.html_content }} {{ post.html_content }}
</div> </div>
{% endif %} {% endif %}
<footer aria-hidden="true" hidden="hidden"> {% include 'meta-publisher.j2.html' %}
<span class="published updated">
<time class="dt-published dt-updated" datetime="{{ post.pubtime }}" itemprop="dateModified datePublished">{{ post.pubdate }}</time>
</span>
{% if not post.has_mainimg %}
<img src="{{ author.avatar }}"
itemprop="image"
width="0"
height="0"
alt="Photo of {{ author.name }}" />
{% endif %}
<p class="p-author h-card vcard">
<img class="photo avatar u-photo u-avatar"
src="{{ author.avatar }}"
alt="Photo of {{ author.name }}" />
<a class="fn p-name url u-url u-uid"
href="{{ author.url }}"
rel="author">
{{ author.name }}
</a>
<a class="u-email email" href="mailto:{{ author.email }}">
{{ author.email }}
</a>
</p>
</footer>
</article> </article>
{% if loop.last %} {% if loop.last %}
</section> </section>

View file

@ -14,83 +14,59 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<main class="content-body h-feed hfeed"> <main class="content-body h-feed hfeed" vocab="http://schema.org/" typeof="Blog WebPage">
<aside> <aside>
<div> <div>
{{ post.html_content }} {{ post.html_content }}
</div> </div>
</aside> </aside>
{% for category, latest in elements %} {% for category, post in elements %}
<section> <section>
<h2>Latest in <h2>post in
<a href="{{ category.url }}/"> <a href="{{ category.url }}/">
<svg width="16" height="16"><use xlink:href="#icon-{{ category.name }}" /></svg> <svg width="16" height="16"><use xlink:href="#icon-{{ category.name }}" /></svg>
{{ category.name }} {{ category.name }}
</a> </a>
</h2> </h2>
<article class="h-entry hentry singular" lang="{{ latest.lang }}" itemprop="blogPost" itemscope="" itemtype="http://schema.org/BlogPosting" itemref="author"> <article class="h-entry hentry singular" lang="{{ post.lang }}" property="blogPost" typeof="BlogPosting">
<header> <header>
<h3 class="p-name entry-title" itemprop="name headline" > <h3 class="p-name entry-title" property="name headline" >
{% if latest.is_reply %} {% if post.is_reply %}
<svg class="icon" width="16" height="16"> <svg class="icon" width="16" height="16">
<use xlink:href="#icon-reply" /> <use xlink:href="#icon-reply" />
</svg> </svg>
<a href="{{ latest.url }}/"> <a href="{{ post.url }}/">
RE: RE:
</a> </a>
<a href="{{ latest.is_reply }}" class="u-in-reply-to"> <a href="{{ post.is_reply }}" class="u-in-reply-to">
{{ latest.is_reply }} {{ post.is_reply }}
</a> </a>
{% else %} {% else %}
<a href="{{ latest.url }}"> <a href="{{ post.url }}">
<span class="entry-title p-name">{{ latest.title }}</span> <span class="entry-title p-name">{{ post.title }}</span>
</a> </a>
{% endif %} {% endif %}
</h3> </h3>
<a href="{{ post.url }}" itemprop="url mainEntityOfPage" class="u-url bookmark"></a> <a href="{{ post.url }}" property="url mainEntityOfPage" class="u-url bookmark"></a>
</header> </header>
{% if latest.summary %} {% if post.summary %}
<div class="e-summary entry-summary" itemprop="description"> <div class="e-summary entry-summary" property="description">
{{ latest.html_summary }} {{ post.html_summary }}
<span class="more"> <span class="more">
<a href="{{ latest.url }}"> <a href="{{ post.url }}">
{% if latest.lang == 'hu' %}Tovább »{% else %}Continue »{% endif %} {% if post.lang == 'hu' %}Tovább »{% else %}Continue »{% endif %}
</a> </a>
</span> </span>
</div> </div>
{% else %} {% else %}
<div class="e-content entry-content" itemprop="articleBody"> <div class="e-content entry-content" property="articleBody">
{{ latest.html_content }} {{ post.html_content }}
</div> </div>
{% endif %} {% endif %}
<footer aria-hidden="true" hidden="hidden"> {% include 'meta-publisher.j2.html' %}
<span class="published updated">
<time class="dt-published dt-updated" datetime="{{ latest.pubtime }}" itemprop="dateModified datePublished">{{ latest.pubdate }}</time>
</span>
{% if not latest.has_mainimg %}
<img src="{{ author.avatar }}"
itemprop="image"
width="0"
height="0"
alt="Photo of {{ author.name }}" />
{% endif %}
<p class="p-author h-card vcard">
<img class="photo avatar u-photo u-avatar"
src="{{ author.avatar }}"
alt="Photo of {{ author.name }}" />
<a class="fn p-name url u-url u-uid"
href="{{ author.url }}"
rel="author">
{{ author.name }}
</a>
<a class="u-email email" href="mailto:{{ author.email }}">
{{ author.email }}
</a>
</p>
</footer>
</article> </article>
</section> </section>
{% endfor %} {% endfor %}

View file

@ -33,10 +33,10 @@
{% else %} {% else %}
{% set mftype = 'h-entry' %} {% set mftype = 'h-entry' %}
{% endif %} {% endif %}
<main role="main"> <main role="main" vocab="http://schema.org/" typeof="Blog WebPage">
<article class="{{ mftype }} hentry singular" lang="{{ post.lang }}" itemscope="" itemprop="blogPost" itemtype="http://schema.org/BlogPosting" itemref="author"> <article class="{{ mftype }} hentry singular" lang="{{ post.lang }}" property="blogPost" typeof="BlogPosting">
<header> <header>
<h1 class="entry-title p-name" itemprop="name headline"> <h1 class="entry-title p-name" property="headline">
{% if post.is_reply %} {% if post.is_reply %}
<span> <span>
<svg width="16" height="16"> <svg width="16" height="16">
@ -50,7 +50,7 @@
</a> </a>
</span> </span>
{% else %} {% else %}
<a href="{{ post.url }}" title="{{ post.title }}"> <a href="{{ post.url }}">
<span>{{ post.title }}</span> <span>{{ post.title }}</span>
</a> </a>
{% endif %} {% endif %}
@ -58,38 +58,43 @@
</header> </header>
{% if post.review %} {% if post.review %}
<div class="h-review hreview" itemprop="review" itemscope="" itemtype="http://schema.org/Review"> <div class="h-review hreview" property="review" typeof="http://schema.org/Review">
<strong>Review summary of: <a href="{{ post.review.url }}" class="item fn p-name u-url p-item h-product">{{ post.review.title }}</a></strong> <strong>Review summary of: <a href="{{ post.review.url }}" class="item fn p-name u-url p-item h-product">{{ post.review.title }}</a></strong>
<p> <p>
By By
<span class="p-author h-card vcard reviewer" itemprop="author" itemscope="" itemtype="http://schema.org/Person"> <span class="p-author h-card vcard reviewer" property="author" typeof="Person">
<a class="fn p-name url u-url u-uid" href="{{ author.url }}" itemprop="url"> <a class="fn p-name url u-url u-uid" href="{{ author.url }}" property="url">
<span itemprop="name">{{ author.name }}</span> <span property="name">{{ author.name }}</span>
</a></span> at <time class="dt-published dtreviewed" datetime="{{ post.pubtime }}" itemprop="datePublished">{{ post.pubdate }}</time> </a></span> at <time class="dt-published dtreviewed" datetime="{{ post.pubtime }}" property="datePublished">{{ post.pubdate }}</time>
</p> </p>
<p> <p>
<span class="rating" itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"> <span class="rating" property="reviewRating" itemscope typeof="Rating">
<meta itemprop="worstRating" content = "1"> <meta property="worstRating" content = "1">
<span class="value" itemprop="ratingValue">{{ post.review.rated }}</span> <span class="value" property="ratingValue">{{ post.review.rated }}</span>
out of out of
<span class="best" itemprop="bestRating">{{ post.review.outof }}</span> <span class="best" property="bestRating">{{ post.review.outof }}</span>
</span> </span>
</p> </p>
<p class="p-summary summary" itemprop="reviewBody">{{ post.review.summary }}</p> <p class="p-summary summary" property="reviewBody">{{ post.review.summary }}</p>
</div> </div>
{% endif %} {% endif %}
{% if post.summary %} {% if post.summary %}
<div class="e-summary entry-summary" itemprop="description"> <div class="e-summary entry-summary" property="description">
{{ post.html_summary }} {{ post.html_summary }}
</div> </div>
{% endif %} {% endif %}
<div class="e-content entry-content" itemprop="articleBody"> <div class="e-content entry-content" property="articleBody">
{{ post.html_content }} {{ post.html_content }}
</div> </div>
<footer> <footer>
{% if not post.enclosure %}
<img aria-hidden="true" hidden="hidden" class="u-featured hidden" property="image" src="{{ author.avatar }}" />
{% else %}
<img aria-hidden="true" hidden="hidden" class="u-featured hidden" property="image" src="{{ post.enclosure.url }}" />
{% endif %}
<dl> <dl>
{% if post.event %} {% if post.event %}
<dt>Trip details</dt> <dt>Trip details</dt>
@ -109,34 +114,35 @@
{% endif %} {% endif %}
<dt>Author</dt> <dt>Author</dt>
<dd class="p-author h-card vcard" itemprop="author" itemscope="" itemtype="http://schema.org/Person"> <dd>
<span class="p-author h-card vcard" property="author" typeof="Person">
<img class="photo avatar u-photo u-avatar" <img class="photo avatar u-photo u-avatar"
src="{{ author.avatar }}" src="{{ author.avatar }}"
alt="Photo of {{ author.name }}" alt="Photo of {{ author.name }}"
itemprop="image" /> property="image" />
<a class="fn p-name url u-url u-uid" <a class="fn p-name url u-url u-uid org"
href="{{ author.url }}" href="{{ author.url }}"
rel="author" property="url">
itemprop="url"> <span property="name">{{ author.name }}</span>
<span itemprop="name">{{ author.name }}</span>
</a> </a>
<a class="u-email email" href="mailto:{{ author.email }}"> <a class="u-email email" href="mailto:{{ author.email }}">
<span itemprop="email">{{ author.email }}</span> {{ author.email }}
</a> </a>
<p aria-hidden="true" hidden="hidden" class="hidden" itemprop="publisher" itemscope="" itemtype="https://schema.org/Organization">
<span itemprop="name">{{ site.domain }}</span>
<a href="{{ site.url }}" itemprop="url">{{ site.url }}</a>
<span itemprop="logo" itemscope="" itemtype="https://schema.org/ImageObject">
<img src="{{ author.avatar }}" alt="" itemprop="url" />
</span> </span>
</p> <span aria-hidden="true" hidden="hidden" property="publisher" typeof="Organization">
<span property="name">{{ site.domain }}</span>
<a href="{{ site.url }}" property="url">{{ site.url }}</a>
<span property="logo" typeof="ImageObject">
<img src="{{ author.avatar }}" alt="" property="url" />
</span>
</span>
</dd> </dd>
<dt>Published</dt> <dt>Published</dt>
<dd class="published updated"> <dd class="published updated">
<time class="dt-published dt-updated" <time class="dt-published dt-updated"
datetime="{{ post.pubtime }}" datetime="{{ post.pubtime }}"
itemprop="dateModified datePublished" property="dateModified datePublished"
>{{ post.pubdate }}</time> >{{ post.pubdate }}</time>
</dd> </dd>
@ -144,7 +150,7 @@
<dt>License</dt> <dt>License</dt>
<dd class="license"> <dd class="license">
{% if post.licence == 'CC-BY-4.0' %} {% if post.licence == 'CC-BY-4.0' %}
<a rel="license" href="https://creativecommons.org/licenses/by/4.0/" class="u-license" itemprop="license"> <a rel="license" href="https://creativecommons.org/licenses/by/4.0/" class="u-license" property="license">
{{ post.licence }} {{ post.licence }}
</a> </a>
<ul> <ul>
@ -155,7 +161,7 @@
<li>you always need to make a link back here</li> <li>you always need to make a link back here</li>
</ul> </ul>
{% elif post.licence == 'CC-BY-NC-4.0' %} {% elif post.licence == 'CC-BY-NC-4.0' %}
<a rel="license" href="https://creativecommons.org/licenses/by-nc/4.0/" class="u-license" itemprop="license"> <a rel="license" href="https://creativecommons.org/licenses/by-nc/4.0/" class="u-license" property="license">
{{ post.licence }} {{ post.licence }}
</a> </a>
<ul> <ul>
@ -167,7 +173,7 @@
</ul> </ul>
For commercial use, please contact me. For commercial use, please contact me.
{% elif post.licence == 'CC-BY-NC-ND-4.0' %} {% elif post.licence == 'CC-BY-NC-ND-4.0' %}
<a rel="license" href="https://creativecommons.org/licenses/by-nc-nd/4.0/" class="u-license" itemprop="license"> <a rel="license" href="https://creativecommons.org/licenses/by-nc-nd/4.0/" class="u-license" property="license">
{{ post.licence }} {{ post.licence }}
</a> </a>
<ul> <ul>
@ -183,10 +189,7 @@
<dt>Entry URL</dt> <dt>Entry URL</dt>
<dd> <dd>
{% if not post.has_mainimg %} <a class="u-url u-uuid" href="{{ post.url }}" property="url">
<img aria-hidden="true" src="{{ author.avatar }}" itemprop="image" hidden="hidden" class="hidden" />
{% endif %}
<a class="u-url u-uuid" rel="bookmark" href="{{ post.url }}" itemprop="url mainEntityOfPage">
{{ post.url }} {{ post.url }}
</a> </a>
</dd> </dd>
@ -198,7 +201,7 @@
{% if post.syndicate|length %} {% if post.syndicate|length %}
<section class="syndication"> <section class="syndication">
{% for url in post.syndicate %} {% for url in post.syndicate %}
<a href="{{ url }}" class="u-syndication" itemprop="u-syndication"></a> <a href="{{ url }}" class="u-syndication"></a>
{% endfor %} {% endfor %}
</section> </section>
{% endif %} {% endif %}
@ -206,14 +209,21 @@
<section class="encourage"> <section class="encourage">
<h2>Encourage creation!</h2> <h2>Encourage creation!</h2>
<p> <p>
If this entry helped you, or you simply liked it, leave a tip via <br> If this entry helped you, or you simply liked it, leave a tip via <br />
{% for provider, info in author.tips.items() %} {% for provider, info in author.tips.items() %}
<span typeof="DonateAction" property="potentialAction">
{% if loop.last and not loop.first %} or {% endif %} {% if loop.last and not loop.first %} or {% endif %}
<a rel="payment" href="{{ info.url }}"> <a property="url" href="{{ info.url }}">
<svg width="16" height="16"> <svg width="16" height="16">
<use xlink:href="#icon-{{ provider }}"></use> <use xlink:href="#icon-{{ provider }}"></use>
</svg> {{ info.text }}</a> </svg> {{ info.text }}</a>
{% if not loop.last and not loop.first %}, {% endif %} {% if not loop.last and not loop.first %}, {% endif %}
<span aria-hidden="true" hidden="hidden" property="recipient" typeof="Person">
for
<span property="name">{{ author.name }}</span>
(<span property="email">{{ author.email }}</span>)
</span>
</span>
{% endfor %} {% endfor %}
</p> </p>
</section> </section>

View file

@ -2,7 +2,7 @@
{% if href != src %} {% if href != src %}
<a href="{{ href }}"> <a href="{{ href }}">
{% endif %} {% endif %}
<img src="{{ src }}" title="{{ title }}" alt="" width="{{ width }}" height="{{ height }}" {% if is_mainimg %}itemprop="image" class="u-featured"{% endif %} /> <img src="{{ src }}" title="{{ title }}" alt="" width="{{ width }}" height="{{ height }}" />
{% if href != src %} {% if href != src %}
</a> </a>
{% endif %} {% endif %}

View file

@ -23,7 +23,7 @@
</style> </style>
</head> </head>
<body itemscope="" itemtype="http://schema.org/Blog http://schema.org/WebPage"> <body>
{% macro activemenu(name) %} {% macro activemenu(name) %}
{% if (post is defined and post.slug == name ) {% if (post is defined and post.slug == name )
@ -62,15 +62,15 @@
<label for="lightscheme">light</label> <label for="lightscheme">light</label>
</span> </span>
</form> </form>
<form role="search" method="get" action="{{ site.search }}" itemprop="potentialAction" itemscope="" itemtype="https://schema.org/SearchAction"> <form role="search" method="get" action="{{ site.search }}" property="potentialAction" typeof="SearchAction" vocab="http://schema.org/">
<meta itemprop="target" content="{{ site.search }}?q={q}"/> <meta property="target" content="{{ site.search }}?q={q}"/>
<label for="qsub"> <label for="qsub">
<input type="submit" value="search" id="qsub" name="qsub" /> <input type="submit" value="search" id="qsub" name="qsub" />
<svg width="16" height="16"> <svg width="16" height="16">
<use xlink:href="#icon-search"></use> <use xlink:href="#icon-search"></use>
</svg> </svg>
</label> </label>
<input itemprop="query-input" type="search" placeholder="search..." value="" name="q" id="q" title="Search for:" required="required" /> <input type="search" placeholder="search..." value="" name="q" id="q" title="Search for:" required="required" property="query-input" />
</form> </form>
</div> </div>
</section> </section>
@ -82,25 +82,22 @@
{% block pagination %} {% block pagination %}
{% endblock %} {% endblock %}
<footer class="p-author h-card vcard" id="author" itemprop="author publisher" itemscope="" itemtype="https://schema.org/Person https://schema.org/Organization"> <footer class="p-author h-card vcard">
<p> <p>
<a href="https://creativecommons.org/">CC</a>, <a href="https://creativecommons.org/">CC</a>,
1999-2019, 1999-2019,
<span itemprop="logo" itemscope="" itemtype="https://schema.org/ImageObject">
<img class="photo avatar u-photo u-avatar" <img class="photo avatar u-photo u-avatar"
src="{{ author.avatar }}" src="{{ author.avatar }}"
alt="Photo of {{ author.name }}" alt="Photo of {{ author.name }}" />
itemprop="image url" /> <a class="fn p-name url u-url u-uid org" rel="me" href="{{ site.url }}">
</span> {{ author.name }}
<a class="fn p-name url u-url u-uid" rel="me" href="{{ site.url }}">
<span itemprop="name">{{ author.name }}</span>
</a> </a>
<a class="u-email email" rel="me" href="mailto:{{ author.email }}"> <a class="u-email email" rel="me" href="mailto:{{ author.email }}">
<svg width="16" height="16"> <svg width="16" height="16">
<title>email</title> <title>email</title>
<use xlink:href="#icon-mail"></use> <use xlink:href="#icon-mail"></use>
</svg> </svg>
<span itemprop="email">{{ author.email }}</span> {{ author.email }}
</a> </a>
</p> </p>
<nav> <nav>

View file

@ -0,0 +1,31 @@
<footer aria-hidden="true" hidden="hidden">
<span class="published updated">
<time datetime="{{ post.pubtime }}" class="dt-published dt-updated" property="dateModified datePublished">{{ post.pubdate }}</time>
</span>
{% if not post.enclosure %}
<img aria-hidden="true" hidden="hidden" class="u-featured hidden" property="image" src="{{ author.avatar }}" />
{% else %}
<img aria-hidden="true" hidden="hidden" class="u-featured hidden" property="image" src="{{ post.enclosure.url }}" />
{% endif %}
<p class="p-author h-card vcard" property="author" typeof="Person">
<img class="photo avatar u-photo u-avatar"
src="{{ author.avatar }}"
alt="Photo of {{ author.name }}"
property="image" />
<a class="fn p-name url u-url u-uid org"
href="{{ author.url }}"
property="url">
<span property="name">{{ author.name }}</span>
</a>
<a class="u-email email" href="mailto:{{ author.email }}">
{{ author.email }}
</a>
</p>
<span property="publisher" typeof="Organization">
<span property="name">{{ site.domain }}</span>
<a href="{{ site.url }}" property="url">{{ site.url }}</a>
<span property="logo" typeof="ImageObject">
<img src="{{ author.avatar }}" alt="" property="url" />
</span>
</span>
</footer>