- removed google things, for now, it's not useful

- relurl filter is ready, but not yet in use, because it's a mess
- reworked yearly archives: all page shows all years, no prev/next
- removed property= mf2 tags
- cleanups in markup
- added searchaction schema.org thing
- removed everything-the-same-size-font from style
This commit is contained in:
Peter Molnar 2019-01-31 22:23:16 +01:00
parent ce9c806274
commit da02d9ba95
7 changed files with 245 additions and 220 deletions

248
nasg.py
View file

@ -68,14 +68,23 @@ RE_PRECODE = re.compile(
r'<pre class="([^"]+)"><code>' r'<pre class="([^"]+)"><code>'
) )
#def relurl(url, base=settings.site.get('url')): RE_MYURL= re.compile(
#return url r'"?(?P<url>%s/?[^\"]+)"?' % (settings.site.get('url'))
##out = os.path.relpath(url, base) )
##if not re.match(r'.*\.[a-z]{2,4}', out):
##out = "%s/index.html" % out
##return out
#J2.filters['relurl'] = relurl def relurl(txt, baseurl):
for url in RE_MYURL.findall(txt):
logger.debug('found URL candidate %s', url)
logger.debug('baseurl is %s', baseurl)
out = os.path.relpath(url, baseurl)
logger.debug('result is %s', out)
if not re.match(r'.*\.[a-z]{2,4}', out):
out = "%s/index.html" % out
#logger.debug('replacing %s with %s', url, out)
txt = txt.replace(url, out)
return txt
J2.filters['relurl'] = relurl
def utfyamldump(data): def utfyamldump(data):
return yaml.dump( return yaml.dump(
@ -586,15 +595,15 @@ class Singular(MarkdownDoc):
pass pass
return lang return lang
@property # @property
def classification(self): # def classification(self):
c = GoogleClassifyText(self.fpath, self.content, self.lang) # c = GoogleClassifyText(self.fpath, self.content, self.lang)
k = '/Arts & Entertainment/Visual Art & Design/Photographic & Digital Arts' # k = '/Arts & Entertainment/Visual Art & Design/Photographic & Digital Arts'
if self.is_photo and k not in c.keys(): # if self.is_photo and k not in c.keys():
c.update({ # c.update({
k : '1.0' # k : '1.0'
}) # })
return c # return c
@property @property
def url(self): def url(self):
@ -669,7 +678,6 @@ class Singular(MarkdownDoc):
'review': self.review, 'review': self.review,
'has_code': self.has_code, 'has_code': self.has_code,
'event': self.event, 'event': self.event,
'classification': self.classification.keys()
} }
if (self.is_photo): if (self.is_photo):
v.update({ v.update({
@ -757,7 +765,7 @@ class Singular(MarkdownDoc):
return return
logger.info("rendering %s", self.name) logger.info("rendering %s", self.name)
r = J2.get_template(self.template).render({ r = J2.get_template(self.template).render({
#'baseurl': self.url, 'baseurl': self.url,
'post': self.tmplvars, 'post': self.tmplvars,
'site': settings.site, 'site': settings.site,
'menu': settings.menu, 'menu': settings.menu,
@ -801,7 +809,7 @@ class Home(Singular):
return return
logger.info("rendering %s", self.name) logger.info("rendering %s", self.name)
r = J2.get_template(self.template).render({ r = J2.get_template(self.template).render({
#'baseurl': settings.site.get('url'), 'baseurl': settings.site.get('url'),
'post': self.tmplvars, 'post': self.tmplvars,
'site': settings.site, 'site': settings.site,
'menu': settings.menu, 'menu': settings.menu,
@ -852,7 +860,6 @@ class WebImage(object):
'exif': self.exif, 'exif': self.exif,
'is_photo': self.is_photo, 'is_photo': self.is_photo,
'is_mainimg': self.is_mainimg, 'is_mainimg': self.is_mainimg,
'onlinecopies': self.onlinecopies
} }
def __str__(self): def __str__(self):
@ -861,17 +868,17 @@ class WebImage(object):
tmpl = J2.get_template("%s.j2.html" % (self.__class__.__name__)) tmpl = J2.get_template("%s.j2.html" % (self.__class__.__name__))
return tmpl.render(self.tmplvars) return tmpl.render(self.tmplvars)
@cached_property # @cached_property
def visionapi(self): # def visionapi(self):
return GoogleVision(self.fpath, self.src) # return GoogleVision(self.fpath, self.src)
@property # @property
def onlinecopies(self): # def onlinecopies(self):
copies = {} # copies = {}
for m in self.visionapi.onlinecopies: # for m in self.visionapi.onlinecopies:
if settings.site.get('domain') not in m: # if settings.site.get('domain') not in m:
copies[m] = True # copies[m] = True
return copies.keys() # return copies.keys()
@cached_property @cached_property
def meta(self): def meta(self):
@ -1007,12 +1014,12 @@ class WebImage(object):
with wand.image.Image(filename=wmarkfile) as wmark: with wand.image.Image(filename=wmarkfile) as wmark:
if self.width > self.height: if self.width > self.height:
w = self.width * 0.2 w = self.width * 0.3
h = wmark.height * (w / wmark.width) h = wmark.height * (w / wmark.width)
x = self.width - w - (self.width * 0.01) x = self.width - w - (self.width * 0.01)
y = self.height - h - (self.height * 0.01) y = self.height - h - (self.height * 0.01)
else: else:
w = self.height * 0.16 w = self.height * 0.24
h = wmark.height * (w / wmark.width) h = wmark.height * (w / wmark.width)
x = self.width - h - (self.width * 0.01) x = self.width - h - (self.width * 0.01)
y = self.height - w - (self.height * 0.01) y = self.height - w - (self.height * 0.01)
@ -1287,7 +1294,7 @@ class Search(PHPFile):
async def _render(self): async def _render(self):
r = J2.get_template(self.templatefile).render({ r = J2.get_template(self.templatefile).render({
#'baseurl': settings.site.get('search'), 'baseurl': settings.site.get('search'),
'post': {}, 'post': {},
'site': settings.site, 'site': settings.site,
'menu': settings.menu, 'menu': settings.menu,
@ -1382,7 +1389,7 @@ class MicropubPHP(PHPFile):
class Category(dict): class Category(dict):
def __init__(self, name=''): def __init__(self, name=''):
self.name = name self.name = name
self.page = 1 #self.page = 1
self.trange = 'YYYY' self.trange = 'YYYY'
def __setitem__(self, key, value): def __setitem__(self, key, value):
@ -1438,9 +1445,28 @@ class Category(dict):
else: else:
return settings.paths.get('build') return settings.paths.get('build')
@property
def newest_year(self):
return int(self[self.sortedkeys[0]].published.format(self.trange))
@property
def years(self):
years = {}
for k in self.sortedkeys:
y = int(self[k].published.format(self.trange))
if y not in years:
if y == self.newest_year:
url = self.url
else:
url = "%s%d/" % (self.url, y)
years.update({
y: url
})
return years
@property @property
def mtime(self): def mtime(self):
return arrow.get(self[self.sortedkeys[0]].published).timestamp return self[self.sortedkeys[0]].published.timestamp
@property @property
def rssfeedfpath(self): def rssfeedfpath(self):
@ -1482,17 +1508,6 @@ class Category(dict):
) )
return s[0] return s[0]
def navlink(self, ts):
label = ts.format(self.trange)
if arrow.utcnow().format(self.trange) == label:
url = self.url
else:
url = "%s%s/" % (self.url, label)
return {
'url': url,
'label': label
}
@property @property
def ctmplvars(self): def ctmplvars(self):
return { return {
@ -1503,19 +1518,12 @@ class Category(dict):
'title': self.title, 'title': self.title,
} }
def tmplvars(self, posts=[], c=False, p=False, n=False): def tmplvars(self, posts=[], year=False):
if p: baseurl = self.url
p = self.navlink(p) if year:
baseurl = '%s/%s/' % (baseurl, year)
if n:
n = self.navlink(n)
if not c:
post = self[list(self.keys()).pop()]
c = post.published.format(self.trange)
return { return {
#'baseurl': self.url, 'baseurl': baseurl,
'site': settings.site, 'site': settings.site,
'menu': settings.menu, 'menu': settings.menu,
'author': settings.author, 'author': settings.author,
@ -1528,12 +1536,10 @@ class Category(dict):
'url': self.url, 'url': self.url,
'feed': self.feedurl, 'feed': self.feedurl,
'title': self.title, 'title': self.title,
'current': c, 'year': year,
'previous': p, 'years': self.years,
'next': n,
'currentyear': arrow.utcnow().format('YYYY')
}, },
'posts': posts 'posts': posts,
} }
def indexfpath(self, subpath=None): def indexfpath(self, subpath=None):
@ -1634,58 +1640,92 @@ class Category(dict):
writepath(self.indexfpath(), r) writepath(self.indexfpath(), r)
async def render_archives(self): async def render_archives(self):
by_time = {} for year in self.years.keys():
for key in self.sortedkeys: if year == self.newest_year:
trange = arrow.get(key).format(self.trange)
if trange not in by_time:
by_time.update({
trange: []
})
by_time[trange].append(key)
keys = list(by_time.keys())
for p, c, n in zip([None] + keys[:-1], keys, keys[1:] + [None]):
form = c.format(self.trange)
if max(keys) == form:
fpath = self.indexfpath() fpath = self.indexfpath()
else: else:
fpath = self.indexfpath(form) fpath = self.indexfpath("%d" % (year))
y = arrow.get("%d" % year, self.trange).to('utc')
tsmin = y.floor('year').timestamp
tsmax = y.ceil('year').timestamp
start = len(self.sortedkeys)
end = 0
try: for index, value in enumerate(self.sortedkeys):
findex = self.sortedkeys.index(by_time[c][0]) if value <= tsmax and index < start:
lindex = self.sortedkeys.index(by_time[c][-1]) start = index
newest = self.newest(findex, lindex) if value >= tsmin and index > end:
except Exception as e: end = index
logger.error(
'calling newest failed with %s for %s',
self.name,
c
)
continue
if self.is_uptodate(fpath, newest): if self.is_uptodate(fpath, self[self.sortedkeys[start]].dt):
logger.info( logger.info("%s / %d is up to date", self.name, year)
'%s/%s index is up to date',
self.name,
form
)
continue
else: else:
logger.info( logger.info("updating %s / %d", self.name, year)
'%s/%s index is outdated, generating new', logger.info("getting posts from %d to %d", start, end)
self.name,
form
)
r = J2.get_template(self.template).render( r = J2.get_template(self.template).render(
self.tmplvars( self.tmplvars(
[self[k].tmplvars for k in by_time[c]], # I don't know why end needs the +1, but without that
c=c, # some posts disappear
p=p, # TODO figure this out...
n=n self.get_posts(start, end+1),
year
) )
) )
writepath(fpath, r) writepath(fpath, r)
#async def render_archives(self):
#by_time = {}
#for key in self.sortedkeys:
#trange = arrow.get(key).format(self.trange)
#if trange not in by_time:
#by_time.update({
#trange: []
#})
#by_time[trange].append(key)
#keys = list(by_time.keys())
#for p, c, n in zip([None] + keys[:-1], keys, keys[1:] + [None]):
#form = c.format(self.trange)
#if max(keys) == form:
#fpath = self.indexfpath()
#else:
#fpath = self.indexfpath(form)
#try:
#findex = self.sortedkeys.index(by_time[c][0])
#lindex = self.sortedkeys.index(by_time[c][-1])
#newest = self.newest(findex, lindex)
#except Exception as e:
#logger.error(
#'calling newest failed with %s for %s',
#self.name,
#c
#)
#continue
#if self.is_uptodate(fpath, newest):
#logger.info(
#'%s/%s index is up to date',
#self.name,
#form
#)
#continue
#else:
#logger.info(
#'%s/%s index is outdated, generating new',
#self.name,
#form
#)
#r = J2.get_template(self.template).render(
#self.tmplvars(
#[self[k].tmplvars for k in by_time[c]],
#c=form,
#p=p,
#n=n
#)
#)
#writepath(fpath, r)
async def render_feeds(self): async def render_feeds(self):
if not self.is_uptodate(self.rssfeedfpath, self.newest()): if not self.is_uptodate(self.rssfeedfpath, self.newest()):
logger.info( logger.info(

View file

@ -1,10 +1,6 @@
{% extends "base.j2.html" %} {% extends "base.j2.html" %}
{% block lang %}{% endblock %} {% block lang %}{% endblock %}
{% block licence %}
<link rel="license" href="https://spdx.org/licenses/{{ site.licence }}.html" type="{{ site.licence }}" />
{% endblock %}
{% block title %}{{ category.title }}{% endblock %} {% block title %}{{ category.title }}{% endblock %}
{% block meta %} {% block meta %}
<link rel="alternate" type="application/rss+xml" title="{{ category.title }} RSS feed" href="{{ category.feed }}" /> <link rel="alternate" type="application/rss+xml" title="{{ category.title }} RSS feed" href="{{ category.feed }}" />
@ -16,44 +12,28 @@
{% if category.display != 'flat' %} {% if category.display != 'flat' %}
<nav> <nav>
<ul> <ul>
{% if category.previous %} {% for y, url in category.years.items() %}
{% if y == category.year %}
<li> <li>
<a rel="prev" href="{{ category.previous.url }}"> <span>
<i>«</i> {{ y }}
<strong>{{ category.previous.label }}</strong>
{% if category.currentyear != category.previous.label %}
Jan - Dec
{% endif %}
</a>
</li>
{% endif %}
<li>
<span class="current">
{{ category.current }}
{% if category.currentyear != category.current %}
Jan - Dec
{% endif %}
</span> </span>
</li> </li>
{% else %}
{% if category.next %}
<li> <li>
<a rel="next" href="{{ category.next.url }}"> <a href="{{ url }}">
<strong>{{ category.next.label }}</strong> <strong>{{ y }}</strong>
Jan - Dec
<i>»</i>
</a> </a>
</li> </li>
{% endif %} {% endif %}
{% endfor %}
</ul> </ul>
</nav> </nav>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<main class="content-body h-feed hfeed {{ category.name }}" property="h-feed"> <main class="content-body h-feed hfeed {{ category.name }}">
<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>
@ -73,26 +53,26 @@
{% endif %} {% endif %}
{% set _ = year.append(post.year)%} {% set _ = year.append(post.year)%}
<article class="h-entry hentry singular" property="h-entry" lang="{{ post.lang }}" itemprop="blogPost" itemscope="" itemtype="http://schema.org/BlogPosting" itemref="author"> <article class="h-entry hentry singular" lang="{{ post.lang }}" itemprop="blogPost" itemscope="" itemtype="http://schema.org/BlogPosting" itemref="author">
<header> <header>
{% if category.display == 'flat' %} {% if category.display == 'flat' %}
<h3 class="p-name entry-title" property="p-name" itemprop="name headline" > <h3 class="p-name entry-title" itemprop="name headline" >
{% else %} {% else %}
<h2 class="p-name entry-title" property="p-name" itemprop="name headline" > <h2 class="p-name entry-title" itemprop="name 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">
<use xlink:href="#icon-reply" /> <use xlink:href="#icon-reply" />
</svg> </svg>
<a href="{{ post.url }}/" class="u-url bookmark" property="u-url" itemprop="url mainEntityOfPage"> <a href="{{ post.url }}/">
RE: RE:
</a> </a>
<a href="{{ post.is_reply }}" class="u-in-reply-to" property="u-in-reply-to"> <a href="{{ post.is_reply }}" class="u-in-reply-to">
{{ post.is_reply }} {{ post.is_reply }}
</a> </a>
{% else %} {% else %}
<a href="{{ post.url }}" title="{{ post.title }}" class="u-url bookmark" property="u-url" itemprop="url mainEntityOfPage"> <a href="{{ post.url }}">
<span class="entry-title p-name" property="p-name">{{ post.title }}</span> <span class="entry-title p-name">{{ post.title }}</span>
</a> </a>
{% endif %} {% endif %}
{% if category.display == 'flat' %} {% if category.display == 'flat' %}
@ -100,26 +80,27 @@
{% else %} {% else %}
</h2> </h2>
{% endif %} {% endif %}
<a href="{{ post.url }}" itemprop="url mainEntityOfPage" class="u-url bookmark"></a>
</header> </header>
{% if post.summary %} {% if post.summary %}
<div class="e-summary entry-summary" property="e-summary" itemprop="description"> <div class="e-summary entry-summary" itemprop="description">
{{ post.html_summary }} {{ post.html_summary }}
<p class="more"> <p class="more">
<a href="{{ post.url }}" title="{{ post.title }}"> <a href="{{ post.url }}">
{% if post.lang == 'hu' %}Tovább »{% else %}Continue »{% endif %} {% if post.lang == 'hu' %}Tovább »{% else %}Continue »{% endif %}
</a> </a>
</p> </p>
</div> </div>
{% else %} {% else %}
<div class="e-content entry-content" property="e-content" itemprop="articleBody"> <div class="e-content entry-content" itemprop="articleBody">
{{ post.html_content }} {{ post.html_content }}
</div> </div>
{% endif %} {% endif %}
<footer aria-hidden="true" hidden="hidden"> <footer aria-hidden="true" hidden="hidden">
<span class="published updated"> <span class="published updated">
<time class="dt-published dt-updated" property="dt-published dt-updated" datetime="{{ post.pubtime }}" itemprop="dateModified datePublished">{{ post.pubdate }}</time> <time class="dt-published dt-updated" datetime="{{ post.pubtime }}" itemprop="dateModified datePublished">{{ post.pubdate }}</time>
</span> </span>
{% if not post.has_mainimg %} {% if not post.has_mainimg %}
<img src="{{ author.avatar }}" <img src="{{ author.avatar }}"
@ -128,18 +109,16 @@
height="0" height="0"
alt="Photo of {{ author.name }}" /> alt="Photo of {{ author.name }}" />
{% endif %} {% endif %}
<p class="p-author h-card vcard" property="p-author h-card"> <p class="p-author h-card vcard">
<img class="photo avatar u-photo u-avatar" <img class="photo avatar u-photo u-avatar"
property="u-photo u-avatar"
src="{{ author.avatar }}" src="{{ author.avatar }}"
alt="Photo of {{ author.name }}" /> alt="Photo of {{ author.name }}" />
<a class="fn p-name url u-url u-uid" <a class="fn p-name url u-url u-uid"
property="p-name u-url u-uid"
href="{{ author.url }}" href="{{ author.url }}"
rel="author"> rel="author">
{{ author.name }} {{ author.name }}
</a> </a>
<a class="u-email email" property="u-email" href="mailto:{{ author.email }}"> <a class="u-email email" href="mailto:{{ author.email }}">
{{ author.email }} {{ author.email }}
</a> </a>
</p> </p>

View file

@ -1,5 +1,7 @@
{% extends "base.j2.html" %} {% extends "base.j2.html" %}
{% block title %}{{ post.title }} - {{ site.domain }}{% endblock %}
{% block meta %} {% block meta %}
<meta name="author" content="{{ author.name }} <{{ author.email }}>" /> <meta name="author" content="{{ author.name }} <{{ author.email }}>" />
<meta name="description" content="{{ post.summary|e }}" /> <meta name="description" content="{{ post.summary|e }}" />
@ -11,12 +13,8 @@
{% endfor %} {% endfor %}
{% endblock %} {% endblock %}
{% block licence %}
<link rel="license" href="https://spdx.org/licenses/{{ post.licence }}.html" type="{{ post.licence }}" />
{% endblock %}
{% block content %} {% block content %}
<main class="content-body h-feed hfeed" property="h-feed"> <main class="content-body h-feed hfeed">
<aside> <aside>
<div> <div>
{{ post.html_content }} {{ post.html_content }}
@ -31,45 +29,46 @@
{{ category.name }} {{ category.name }}
</a> </a>
</h2> </h2>
<article class="h-entry hentry singular" property="h-entry" lang="{{ latest.lang }}" itemprop="blogPost" itemscope="" itemtype="http://schema.org/BlogPosting" itemref="author"> <article class="h-entry hentry singular" lang="{{ latest.lang }}" itemprop="blogPost" itemscope="" itemtype="http://schema.org/BlogPosting" itemref="author">
<header> <header>
<h3 class="p-name entry-title" property="p-name" itemprop="name headline" > <h3 class="p-name entry-title" itemprop="name headline" >
{% if latest.is_reply %} {% if latest.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 }}/" class="u-url bookmark" property="u-url" itemprop="url mainEntityOfPage"> <a href="{{ latest.url }}/">
RE: RE:
</a> </a>
<a href="{{ latest.is_reply }}" class="u-in-reply-to" property="u-in-reply-to"> <a href="{{ latest.is_reply }}" class="u-in-reply-to">
{{ latest.is_reply }} {{ latest.is_reply }}
</a> </a>
{% else %} {% else %}
<a href="{{ latest.url }}" title="{{ latest.title }}" class="u-url bookmark" property="u-url" itemprop="url mainEntityOfPage"> <a href="{{ latest.url }}">
<span class="entry-title p-name" property="p-name">{{ latest.title }}</span> <span class="entry-title p-name">{{ latest.title }}</span>
</a> </a>
{% endif %} {% endif %}
</h3> </h3>
<a href="{{ post.url }}" itemprop="url mainEntityOfPage" class="u-url bookmark"></a>
</header> </header>
{% if latest.summary %} {% if latest.summary %}
<div class="e-summary entry-summary" property="e-summary" itemprop="description"> <div class="e-summary entry-summary" itemprop="description">
{{ latest.html_summary }} {{ latest.html_summary }}
<span class="more"> <span class="more">
<a href="{{ latest.url }}" title="{{ latest.title }}"> <a href="{{ latest.url }}">
{% if latest.lang == 'hu' %}Tovább »{% else %}Continue »{% endif %} {% if latest.lang == 'hu' %}Tovább »{% else %}Continue »{% endif %}
</a> </a>
</span> </span>
</div> </div>
{% else %} {% else %}
<div class="e-content entry-content" property="e-content" itemprop="articleBody"> <div class="e-content entry-content" itemprop="articleBody">
{{ latest.html_content }} {{ latest.html_content }}
</div> </div>
{% endif %} {% endif %}
<footer aria-hidden="true" hidden="hidden"> <footer aria-hidden="true" hidden="hidden">
<span class="published updated"> <span class="published updated">
<time class="dt-published dt-updated" property="dt-published dt-updated" datetime="{{ latest.pubtime }}" itemprop="dateModified datePublished">{{ latest.pubdate }}</time> <time class="dt-published dt-updated" datetime="{{ latest.pubtime }}" itemprop="dateModified datePublished">{{ latest.pubdate }}</time>
</span> </span>
{% if not latest.has_mainimg %} {% if not latest.has_mainimg %}
<img src="{{ author.avatar }}" <img src="{{ author.avatar }}"
@ -78,18 +77,16 @@
height="0" height="0"
alt="Photo of {{ author.name }}" /> alt="Photo of {{ author.name }}" />
{% endif %} {% endif %}
<p class="p-author h-card vcard" property="p-author h-card"> <p class="p-author h-card vcard">
<img class="photo avatar u-photo u-avatar" <img class="photo avatar u-photo u-avatar"
property="u-photo u-avatar"
src="{{ author.avatar }}" src="{{ author.avatar }}"
alt="Photo of {{ author.name }}" /> alt="Photo of {{ author.name }}" />
<a class="fn p-name url u-url u-uid" <a class="fn p-name url u-url u-uid"
property="p-name u-url u-uid"
href="{{ author.url }}" href="{{ author.url }}"
rel="author"> rel="author">
{{ author.name }} {{ author.name }}
</a> </a>
<a class="u-email email" property="u-email" href="mailto:{{ author.email }}"> <a class="u-email email" href="mailto:{{ author.email }}">
{{ author.email }} {{ author.email }}
</a> </a>
</p> </p>

View file

@ -1,5 +1,9 @@
{% extends "base.j2.html" %} {% extends "base.j2.html" %}
{% block lang %} lang="{{ post.lang }}" {% endblock %}
{% block title %}{{ post.title }} - {{ site.domain }}{% endblock %}
{% block meta %} {% block meta %}
<meta name="author" content="{{ author.name }} <{{ author.email }}>" /> <meta name="author" content="{{ author.name }} <{{ author.email }}>" />
<meta name="description" content="{{ post.summary|e }}" /> <meta name="description" content="{{ post.summary|e }}" />
@ -30,9 +34,9 @@
{% set mftype = 'h-entry' %} {% set mftype = 'h-entry' %}
{% endif %} {% endif %}
<main role="main"> <main role="main">
<article class="{{ mftype }} hentry singular" lang="{{ post.lang }}" property="{{ mftype }}" itemscope="" itemprop="blogPost" itemtype="http://schema.org/BlogPosting" itemref="author"> <article class="{{ mftype }} hentry singular" lang="{{ post.lang }}" itemscope="" itemprop="blogPost" itemtype="http://schema.org/BlogPosting" itemref="author">
<header> <header>
<h1 class="entry-title p-name" itemprop="name headline" property="p-name"> <h1 class="entry-title p-name" itemprop="name headline">
{% if post.is_reply %} {% if post.is_reply %}
<span> <span>
<svg width="16" height="16"> <svg width="16" height="16">
@ -41,7 +45,7 @@
<a href="{{ post.url }}"> <a href="{{ post.url }}">
RE: RE:
</a> </a>
<a href="{{ post.is_reply }}" class="u-in-reply-to" property="u-in-reply-to"> <a href="{{ post.is_reply }}" class="u-in-reply-to">
{{ post.is_reply }} {{ post.is_reply }}
</a> </a>
</span> </span>
@ -54,14 +58,14 @@
</header> </header>
{% if post.review %} {% if post.review %}
<div class="h-review hreview" property="h-review" itemprop="review" itemscope="" itemtype="http://schema.org/Review"> <div class="h-review hreview" itemprop="review" itemscope="" itemtype="http://schema.org/Review">
<strong>Review summary of: <a href="{{ post.review.url }}" class="item fn p-name u-url p-item h-product" property="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" property="p-author" itemprop="author" itemscope="" itemtype="http://schema.org/Person"> <span class="p-author h-card vcard reviewer" itemprop="author" itemscope="" itemtype="http://schema.org/Person">
<a class="fn p-name url u-url u-uid" property="p-name u-url u-uid" href="{{ author.url }}" itemprop="url"> <a class="fn p-name url u-url u-uid" href="{{ author.url }}" itemprop="url">
<span itemprop="name">{{ author.name }}</span> <span itemprop="name">{{ author.name }}</span>
</a></span> at <time class="dt-published dtreviewed" property="dt-published" datetime="{{ post.pubtime }}" itemprop="datePublished">{{ post.pubdate }}</time> </a></span> at <time class="dt-published dtreviewed" datetime="{{ post.pubtime }}" itemprop="datePublished">{{ post.pubdate }}</time>
</p> </p>
<p> <p>
<span class="rating" itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"> <span class="rating" itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
@ -71,17 +75,17 @@
<span class="best" itemprop="bestRating">{{ post.review.outof }}</span> <span class="best" itemprop="bestRating">{{ post.review.outof }}</span>
</span> </span>
</p> </p>
<p class="p-summary summary" property="p-summary" itemprop="reviewBody">{{ post.review.summary }}</p> <p class="p-summary summary" itemprop="reviewBody">{{ post.review.summary }}</p>
</div> </div>
{% endif %} {% endif %}
{% if post.summary %} {% if post.summary %}
<div class="e-summary entry-summary" property="e-summary" itemprop="description"> <div class="e-summary entry-summary" itemprop="description">
{{ post.html_summary }} {{ post.html_summary }}
</div> </div>
{% endif %} {% endif %}
<div class="e-content entry-content" property="e-content" itemprop="articleBody"> <div class="e-content entry-content" itemprop="articleBody">
{{ post.html_content }} {{ post.html_content }}
</div> </div>
@ -91,34 +95,32 @@
<dt>Trip details</dt> <dt>Trip details</dt>
<dd> <dd>
From From
<time class="dt-start dtstart" property="dt-end" datetime="{{ post.event.starttime }}"> <time class="dt-start dtstart" datetime="{{ post.event.starttime }}">
{{ post.event.startdate }} {{ post.event.startdate }}
</time> </time>
to to
<time class="dt-end dtend" property="dt-end" datetime="{{ post.event.endtime }}"> <time class="dt-end dtend" datetime="{{ post.event.endtime }}">
{{ post.event.enddate }} {{ post.event.enddate }}
</time>, in </time>, in
<span class="p-location location" property="p-location"> <span class="p-location location">
{{ post.event.location }} {{ post.event.location }}
</span> </span>
</dd> </dd>
{% endif %} {% endif %}
<dt>Author</dt> <dt>Author</dt>
<dd class="p-author h-card vcard" property="p-author h-card" itemprop="author" itemscope="" itemtype="http://schema.org/Person"> <dd class="p-author h-card vcard" itemprop="author" itemscope="" itemtype="http://schema.org/Person">
<img class="photo avatar u-photo u-avatar" <img class="photo avatar u-photo u-avatar"
property="p-author h-card"
src="{{ author.avatar }}" src="{{ author.avatar }}"
alt="Photo of {{ author.name }}" alt="Photo of {{ author.name }}"
itemprop="image" /> itemprop="image" />
<a class="fn p-name url u-url u-uid" <a class="fn p-name url u-url u-uid"
property="p-name u-url u-uid"
href="{{ author.url }}" href="{{ author.url }}"
rel="author" rel="author"
itemprop="url"> itemprop="url">
<span itemprop="name">{{ author.name }}</span> <span itemprop="name">{{ author.name }}</span>
</a> </a>
<a class="u-email email" property="u-email" href="mailto:{{ author.email }}"> <a class="u-email email" href="mailto:{{ author.email }}">
<span itemprop="email">{{ author.email }}</span> <span itemprop="email">{{ author.email }}</span>
</a> </a>
<p aria-hidden="true" hidden="hidden" class="hidden" itemprop="publisher" itemscope="" itemtype="https://schema.org/Organization"> <p aria-hidden="true" hidden="hidden" class="hidden" itemprop="publisher" itemscope="" itemtype="https://schema.org/Organization">
@ -133,7 +135,6 @@
<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"
property="dt-published dt-updated"
datetime="{{ post.pubtime }}" datetime="{{ post.pubtime }}"
itemprop="dateModified datePublished" itemprop="dateModified datePublished"
>{{ post.pubdate }}</time> >{{ post.pubdate }}</time>
@ -143,7 +144,9 @@
<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" property="u-licence" itemprop="license">{{ post.licence }}</a> <a rel="license" href="https://creativecommons.org/licenses/by/4.0/" class="u-license" itemprop="license">
{{ post.licence }}
</a>
<ul> <ul>
<li>you can share it</li> <li>you can share it</li>
<li>you can republish it</li> <li>you can republish it</li>
@ -152,7 +155,9 @@
<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" property="u-licence" itemprop="license">{{ post.licence }}</a> <a rel="license" href="https://creativecommons.org/licenses/by-nc/4.0/" class="u-license" itemprop="license">
{{ post.licence }}
</a>
<ul> <ul>
<li>you can share it</li> <li>you can share it</li>
<li>you can republish it</li> <li>you can republish it</li>
@ -162,7 +167,9 @@
</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" property="u-licence" itemprop="license">{{ post.licence }}</a> <a rel="license" href="https://creativecommons.org/licenses/by-nc-nd/4.0/" class="u-license" itemprop="license">
{{ post.licence }}
</a>
<ul> <ul>
<li>you can share it</li> <li>you can share it</li>
<li>you can't modify it</li> <li>you can't modify it</li>
@ -179,7 +186,7 @@
{% if not post.has_mainimg %} {% if not post.has_mainimg %}
<img aria-hidden="true" src="{{ author.avatar }}" itemprop="image" hidden="hidden" class="hidden" /> <img aria-hidden="true" src="{{ author.avatar }}" itemprop="image" hidden="hidden" class="hidden" />
{% endif %} {% endif %}
<a class="u-url u-uuid" property="u-url u-uuid" rel="bookmark" href="{{ post.url }}" itemprop="url mainEntityOfPage"> <a class="u-url u-uuid" rel="bookmark" href="{{ post.url }}" itemprop="url mainEntityOfPage">
{{ post.url }} {{ post.url }}
</a> </a>
</dd> </dd>
@ -216,19 +223,19 @@
<h2><a id="replies"></a>Replies</h2> <h2><a id="replies"></a>Replies</h2>
<ol> <ol>
{% for mtime, comment in post.replies.items() %} {% for mtime, comment in post.replies.items() %}
<li class="h-entry p-comment" property="h-entry p-comment"> <li class="h-entry p-comment">
<time class="dt-published" property="dt-published" datetime="{{ comment.pubtime }}"> <time class="dt-published" datetime="{{ comment.pubtime }}">
{{ comment.pubdate }} {{ comment.pubdate }}
</time> from </time> from
<span class="p-author h-card" property="p-author h-card"> <span class="p-author h-card">
{% if comment.author.url %} {% if comment.author.url %}
<a class="url u-url" property="u-url" href="{{ comment.author.url }}"> <a class="url u-url" href="{{ comment.author.url }}">
<span class="p-name fn" property="p-name"> <span class="p-name fn">
{{ comment.author.name }} {{ comment.author.name }}
</span> </span>
</a> </a>
{% else %} {% else %}
<span class="p-name fn" property="p-name"> <span class="p-name fn">
{{ comment.author.name }} {{ comment.author.name }}
</span> </span>
{% endif %} {% endif %}
@ -237,7 +244,7 @@
<svg width="16" height="16"> <svg width="16" height="16">
<use xlink:href="#icon-link"></use> <use xlink:href="#icon-link"></use>
</svg> </svg>
<a class="u-url" property="u-url" href="{{ comment.source }}"> <a class="u-url" href="{{ comment.source }}">
{{ comment.source }} {{ comment.source }}
</a> </a>
</span> </span>
@ -256,24 +263,24 @@
<dd> <dd>
<ul> <ul>
{% for mtime, comment in comments.items() %} {% for mtime, comment in comments.items() %}
<li class="h-entry p-comment" property="h-entry p-comment"> <li class="h-entry p-comment">
<span class="reaction"> <span class="reaction">
<a class="u-url" property="u-url" href="{{ comment.source }}"> <a class="u-url" href="{{ comment.source }}">
{{ comment.type }} {{ comment.type }}
</a> </a>
</span> </span>
<time class="dt-published" property="dt-published" datetime="{{ comment.pubtime }}"> <time class="dt-published" datetime="{{ comment.pubtime }}">
{{ comment.pubdate }} {{ comment.pubdate }}
</time> from </time> from
<span class="p-author h-card" property="p-author h-card"> <span class="p-author h-card">
{% if comment.author.url %} {% if comment.author.url %}
<a class="url u-url" property="u-url" href="{{ comment.author.url }}"> <a class="url u-url" href="{{ comment.author.url }}">
<span class="p-name fn" property="p-name"> <span class="p-name fn">
{{ comment.author.name }} {{ comment.author.name }}
</span> </span>
</a> </a>
{% else %} {% else %}
<span class="p-name fn" property="p-name"> <span class="p-name fn">
{{ comment.author.name }} {{ comment.author.name }}
</span> </span>
{% endif %} {% endif %}

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" property="u-featured"{% endif %} /> <img src="{{ src }}" title="{{ title }}" alt="" width="{{ width }}" height="{{ height }}" {% if is_mainimg %}itemprop="image" class="u-featured"{% endif %} />
{% if href != src %} {% if href != src %}
</a> </a>
{% endif %} {% endif %}

View file

@ -1,12 +1,13 @@
<!DOCTYPE html> <!DOCTYPE html>
<html {% block lang %}lang="{{ post.lang }}"{% endblock %}> <html{% block lang %}{% endblock %}>
<head> <head>
<title>{% block title %}{{ post.title }} - {{ site.domain }}{% endblock %}</title> <title>{% block title %}{% endblock %}</title>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1" /> <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1" />
<meta name="supported-color-schemes" content="dark light">
<link rel="icon" href="{{ site.favicon }}" /> <link rel="icon" href="{{ site.favicon }}" />
{% block licence %}{% endblock %} {% block licence %}
<link rel="license" href="https://spdx.org/licenses/{{ site.licence }}.html" type="{{ site.licence }}" />
{% endblock %}
{% for key, value in meta.items() %} {% for key, value in meta.items() %}
<link rel="{{ key }}" href="{{ value }}" /> <link rel="{{ key }}" href="{{ value }}" />
{% endfor %} {% endfor %}
@ -24,7 +25,11 @@
<body itemscope="" itemtype="http://schema.org/Blog http://schema.org/WebPage"> <body itemscope="" itemtype="http://schema.org/Blog http://schema.org/WebPage">
{% macro activemenu(name) %}{% if (post is defined and post.slug == name ) or (post is defined and post.category == name ) or ( category is defined and category.name == name ) %}active{% endif %}{% endmacro %} {% macro activemenu(name) %}
{% if (post is defined and post.slug == name )
or (post is defined and post.category == name )
or ( category is defined and category.name == name )%}active{% endif %}
{% endmacro %}
<header> <header>
<section> <section>
@ -57,14 +62,15 @@
<label for="lightscheme">light</label> <label for="lightscheme">light</label>
</span> </span>
</form> </form>
<form role="search" method="get" action="{{ site.search }}"> <form role="search" method="get" action="{{ site.search }}" itemprop="potentialAction" itemscope="" itemtype="https://schema.org/SearchAction">
<meta itemprop="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 type="search" placeholder="search..." value="" name="q" id="q" title="Search for:" /> <input itemprop="query-input" type="search" placeholder="search..." value="" name="q" id="q" title="Search for:" required="required" />
</form> </form>
</div> </div>
</section> </section>
@ -76,21 +82,20 @@
{% block pagination %} {% block pagination %}
{% endblock %} {% endblock %}
<footer class="p-author h-card vcard" property="p-author h-card" id="author" itemprop="author publisher" itemscope="" itemtype="https://schema.org/Person https://schema.org/Organization"> <footer class="p-author h-card vcard" id="author" itemprop="author publisher" itemscope="" itemtype="https://schema.org/Person https://schema.org/Organization">
<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"> <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"
property="u-photo u-avatar"
src="{{ author.avatar }}" src="{{ author.avatar }}"
alt="Photo of {{ author.name }}" alt="Photo of {{ author.name }}"
itemprop="image url" /> itemprop="image url" />
</span> </span>
<a class="fn p-name url u-url u-uid" property="p-name u-url u-uid" rel="me" href="{{ site.url }}"> <a class="fn p-name url u-url u-uid" rel="me" href="{{ site.url }}">
<span itemprop="name">{{ author.name }}</span> <span itemprop="name">{{ author.name }}</span>
</a> </a>
<a class="u-email email" property="u-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>

View file

@ -1,10 +1,8 @@
* { * {
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
-moz-box-sizing: border-box; -moz-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
font-family: "Courier", monospace; font-family: "Courier", monospace;
font-size: 11.5pt;
margin: 0; margin: 0;
padding: 0; padding: 0;
line-height: 1.5em; line-height: 1.5em;
@ -71,7 +69,7 @@ h4 {
svg { svg {
transform: rotate(0deg); transform: rotate(0deg);
fill: currentColor; fill: currentColor;
vertical-align: text-top; vertical-align:middle;
} }
body > svg { body > svg {
@ -123,7 +121,6 @@ body > header a {
font-weight: bold; font-weight: bold;
border-bottom: 3px solid transparent; border-bottom: 3px solid transparent;
padding-bottom: 0.1em; padding-bottom: 0.1em;
text-transform:uppercase;
} }
body > header a:hover, body > header a:hover,