- 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
@@ -68,14 +68,23 @@ RE_PRECODE = re.compile(
r'<pre class="([^"]+)"><code>' ) -#def relurl(url, base=settings.site.get('url')): - #return url - ##out = os.path.relpath(url, base) - ##if not re.match(r'.*\.[a-z]{2,4}', out): - ##out = "%s/index.html" % out - ##return out +RE_MYURL= re.compile( + r'"?(?P<url>%s/?[^\"]+)"?' % (settings.site.get('url')) +) + +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 +J2.filters['relurl'] = relurl def utfyamldump(data): return yaml.dump(@@ -586,15 +595,15 @@ except BaseException:
pass return lang - @property - def classification(self): - c = GoogleClassifyText(self.fpath, self.content, self.lang) - k = '/Arts & Entertainment/Visual Art & Design/Photographic & Digital Arts' - if self.is_photo and k not in c.keys(): - c.update({ - k : '1.0' - }) - return c + # @property + # def classification(self): + # c = GoogleClassifyText(self.fpath, self.content, self.lang) + # k = '/Arts & Entertainment/Visual Art & Design/Photographic & Digital Arts' + # if self.is_photo and k not in c.keys(): + # c.update({ + # k : '1.0' + # }) + # return c @property def url(self):@@ -669,7 +678,6 @@ 'url': self.url,
'review': self.review, 'has_code': self.has_code, 'event': self.event, - 'classification': self.classification.keys() } if (self.is_photo): v.update({@@ -757,7 +765,7 @@ if self.exists:
return logger.info("rendering %s", self.name) r = J2.get_template(self.template).render({ - #'baseurl': self.url, + 'baseurl': self.url, 'post': self.tmplvars, 'site': settings.site, 'menu': settings.menu,@@ -801,7 +809,7 @@ if self.exists:
return logger.info("rendering %s", self.name) r = J2.get_template(self.template).render({ - #'baseurl': settings.site.get('url'), + 'baseurl': settings.site.get('url'), 'post': self.tmplvars, 'site': settings.site, 'menu': settings.menu,@@ -852,7 +860,6 @@ 'caption': self.caption,
'exif': self.exif, 'is_photo': self.is_photo, 'is_mainimg': self.is_mainimg, - 'onlinecopies': self.onlinecopies } def __str__(self):@@ -861,17 +868,17 @@ return self.mdimg.match
tmpl = J2.get_template("%s.j2.html" % (self.__class__.__name__)) return tmpl.render(self.tmplvars) - @cached_property - def visionapi(self): - return GoogleVision(self.fpath, self.src) + # @cached_property + # def visionapi(self): + # return GoogleVision(self.fpath, self.src) - @property - def onlinecopies(self): - copies = {} - for m in self.visionapi.onlinecopies: - if settings.site.get('domain') not in m: - copies[m] = True - return copies.keys() + # @property + # def onlinecopies(self): + # copies = {} + # for m in self.visionapi.onlinecopies: + # if settings.site.get('domain') not in m: + # copies[m] = True + # return copies.keys() @cached_property def meta(self):@@ -1007,12 +1014,12 @@ return img
with wand.image.Image(filename=wmarkfile) as wmark: if self.width > self.height: - w = self.width * 0.2 + w = self.width * 0.3 h = wmark.height * (w / wmark.width) x = self.width - w - (self.width * 0.01) y = self.height - h - (self.height * 0.01) else: - w = self.height * 0.16 + w = self.height * 0.24 h = wmark.height * (w / wmark.width) x = self.width - h - (self.width * 0.01) y = self.height - w - (self.height * 0.01)@@ -1287,7 +1294,7 @@ return 'Search.j2.php'
async def _render(self): r = J2.get_template(self.templatefile).render({ - #'baseurl': settings.site.get('search'), + 'baseurl': settings.site.get('search'), 'post': {}, 'site': settings.site, 'menu': settings.menu,@@ -1382,7 +1389,7 @@
class Category(dict): def __init__(self, name=''): self.name = name - self.page = 1 + #self.page = 1 self.trange = 'YYYY' def __setitem__(self, key, value):@@ -1439,8 +1446,27 @@ else:
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 def mtime(self): - return arrow.get(self[self.sortedkeys[0]].published).timestamp + return self[self.sortedkeys[0]].published.timestamp @property def rssfeedfpath(self):@@ -1482,17 +1508,6 @@ reverse=True
) 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 def ctmplvars(self): return {@@ -1503,19 +1518,12 @@ 'feed': self.feedurl,
'title': self.title, } - def tmplvars(self, posts=[], c=False, p=False, n=False): - if p: - p = self.navlink(p) - - if n: - n = self.navlink(n) - - if not c: - post = self[list(self.keys()).pop()] - c = post.published.format(self.trange) - + def tmplvars(self, posts=[], year=False): + baseurl = self.url + if year: + baseurl = '%s/%s/' % (baseurl, year) return { - #'baseurl': self.url, + 'baseurl': baseurl, 'site': settings.site, 'menu': settings.menu, 'author': settings.author,@@ -1528,12 +1536,10 @@ 'display': self.display,
'url': self.url, 'feed': self.feedurl, 'title': self.title, - 'current': c, - 'previous': p, - 'next': n, - 'currentyear': arrow.utcnow().format('YYYY') + 'year': year, + 'years': self.years, }, - 'posts': posts + 'posts': posts, } def indexfpath(self, subpath=None):@@ -1634,57 +1640,91 @@ )
writepath(self.indexfpath(), 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: + for year in self.years.keys(): + if year == self.newest_year: fpath = self.indexfpath() 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: - 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 + for index, value in enumerate(self.sortedkeys): + if value <= tsmax and index < start: + start = index + if value >= tsmin and index > end: + end = index - if self.is_uptodate(fpath, newest): - logger.info( - '%s/%s index is up to date', - self.name, - form - ) - continue + if self.is_uptodate(fpath, self[self.sortedkeys[start]].dt): + logger.info("%s / %d is up to date", self.name, year) else: - logger.info( - '%s/%s index is outdated, generating new', - self.name, - form - ) + logger.info("updating %s / %d", self.name, year) + logger.info("getting posts from %d to %d", start, end) r = J2.get_template(self.template).render( self.tmplvars( - [self[k].tmplvars for k in by_time[c]], - c=c, - p=p, - n=n + # I don't know why end needs the +1, but without that + # some posts disappear + # TODO figure this out... + self.get_posts(start, end+1), + year ) ) 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): if not self.is_uptodate(self.rssfeedfpath, self.newest()):
@@ -1,10 +1,6 @@
{% extends "base.j2.html" %} {% 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 meta %} <link rel="alternate" type="application/rss+xml" title="{{ category.title }} RSS feed" href="{{ category.feed }}" />@@ -16,44 +12,28 @@ {% block pagination %}
{% if category.display != 'flat' %} <nav> <ul> - {% if category.previous %} - <li> - <a rel="prev" href="{{ category.previous.url }}"> - <i>«</i> - <strong>{{ category.previous.label }}</strong> - {% if category.currentyear != category.previous.label %} - Jan - Dec - {% endif %} - </a> - </li> - {% endif %} - + {% for y, url in category.years.items() %} + {% if y == category.year %} <li> - <span class="current"> - {{ category.current }} - {% if category.currentyear != category.current %} - Jan - Dec - {% endif %} + <span> + {{ y }} </span> </li> - - {% if category.next %} + {% else %} <li> - <a rel="next" href="{{ category.next.url }}"> - <strong>{{ category.next.label }}</strong> - Jan - Dec - <i>»</i> + <a href="{{ url }}"> + <strong>{{ y }}</strong> </a> </li> {% endif %} - + {% endfor %} </ul> </nav> {% endif %} {% endblock %} {% block content %} -<main class="content-body h-feed hfeed {{ category.name }}" property="h-feed"> +<main class="content-body h-feed hfeed {{ category.name }}"> <header> <p> <svg width="128" height="128"><use xlink:href="#icon-{{ category.name }}" /></svg>@@ -73,26 +53,26 @@ <h2>{{ post.year }}</h2>
{% endif %} {% 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> {% 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 %} - <h2 class="p-name entry-title" property="p-name" itemprop="name headline" > + <h2 class="p-name entry-title" itemprop="name headline" > {% endif %} {% if post.is_reply %} <svg class="icon" width="16" height="16"> <use xlink:href="#icon-reply" /> </svg> - <a href="{{ post.url }}/" class="u-url bookmark" property="u-url" itemprop="url mainEntityOfPage"> + <a href="{{ post.url }}/"> RE: </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 }} </a> {% else %} - <a href="{{ post.url }}" title="{{ post.title }}" class="u-url bookmark" property="u-url" itemprop="url mainEntityOfPage"> - <span class="entry-title p-name" property="p-name">{{ post.title }}</span> + <a href="{{ post.url }}"> + <span class="entry-title p-name">{{ post.title }}</span> </a> {% endif %} {% if category.display == 'flat' %}@@ -100,26 +80,27 @@ </h3>
{% else %} </h2> {% endif %} + <a href="{{ post.url }}" itemprop="url mainEntityOfPage" class="u-url bookmark"></a> </header> {% 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 }} <p class="more"> - <a href="{{ post.url }}" title="{{ post.title }}"> + <a href="{{ post.url }}"> {% if post.lang == 'hu' %}Tovább »{% else %}Continue »{% endif %} </a> </p> </div> {% else %} - <div class="e-content entry-content" property="e-content" itemprop="articleBody"> + <div class="e-content entry-content" itemprop="articleBody"> {{ post.html_content }} </div> {% endif %} <footer aria-hidden="true" hidden="hidden"> <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> {% if not post.has_mainimg %} <img src="{{ author.avatar }}"@@ -128,18 +109,16 @@ width="0"
height="0" alt="Photo of {{ author.name }}" /> {% 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" - property="u-photo u-avatar" src="{{ author.avatar }}" alt="Photo of {{ author.name }}" /> <a class="fn p-name url u-url u-uid" - property="p-name u-url u-uid" href="{{ author.url }}" rel="author"> {{ author.name }} </a> - <a class="u-email email" property="u-email" href="mailto:{{ author.email }}"> + <a class="u-email email" href="mailto:{{ author.email }}"> {{ author.email }} </a> </p>
@@ -1,5 +1,7 @@
{% extends "base.j2.html" %} +{% block title %}{{ post.title }} - {{ site.domain }}{% endblock %} + {% block meta %} <meta name="author" content="{{ author.name }} <{{ author.email }}>" /> <meta name="description" content="{{ post.summary|e }}" />@@ -11,12 +13,8 @@ <link rel="feed" title="{{ category.title}} feed" href="{{ category.url }}" />
{% endfor %} {% endblock %} -{% block licence %} - <link rel="license" href="https://spdx.org/licenses/{{ post.licence }}.html" type="{{ post.licence }}" /> -{% endblock %} - {% block content %} -<main class="content-body h-feed hfeed" property="h-feed"> +<main class="content-body h-feed hfeed"> <aside> <div> {{ post.html_content }}@@ -31,45 +29,46 @@ <svg width="16" height="16"><use xlink:href="#icon-{{ category.name }}" /></svg>
{{ category.name }} </a> </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> - <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 %} <svg class="icon" width="16" height="16"> <use xlink:href="#icon-reply" /> </svg> - <a href="{{ latest.url }}/" class="u-url bookmark" property="u-url" itemprop="url mainEntityOfPage"> + <a href="{{ latest.url }}/"> RE: </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 }} </a> {% else %} - <a href="{{ latest.url }}" title="{{ latest.title }}" class="u-url bookmark" property="u-url" itemprop="url mainEntityOfPage"> - <span class="entry-title p-name" property="p-name">{{ latest.title }}</span> + <a href="{{ latest.url }}"> + <span class="entry-title p-name">{{ latest.title }}</span> </a> {% endif %} </h3> + <a href="{{ post.url }}" itemprop="url mainEntityOfPage" class="u-url bookmark"></a> </header> {% 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 }} <span class="more"> - <a href="{{ latest.url }}" title="{{ latest.title }}"> + <a href="{{ latest.url }}"> {% if latest.lang == 'hu' %}Tovább »{% else %}Continue »{% endif %} </a> </span> </div> {% else %} - <div class="e-content entry-content" property="e-content" itemprop="articleBody"> + <div class="e-content entry-content" itemprop="articleBody"> {{ latest.html_content }} </div> {% endif %} <footer aria-hidden="true" hidden="hidden"> <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> {% if not latest.has_mainimg %} <img src="{{ author.avatar }}"@@ -78,18 +77,16 @@ width="0"
height="0" alt="Photo of {{ author.name }}" /> {% 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" - property="u-photo u-avatar" src="{{ author.avatar }}" alt="Photo of {{ author.name }}" /> <a class="fn p-name url u-url u-uid" - property="p-name u-url u-uid" href="{{ author.url }}" rel="author"> {{ author.name }} </a> - <a class="u-email email" property="u-email" href="mailto:{{ author.email }}"> + <a class="u-email email" href="mailto:{{ author.email }}"> {{ author.email }} </a> </p>
@@ -1,5 +1,9 @@
{% extends "base.j2.html" %} +{% block lang %} lang="{{ post.lang }}" {% endblock %} + +{% block title %}{{ post.title }} - {{ site.domain }}{% endblock %} + {% block meta %} <meta name="author" content="{{ author.name }} <{{ author.email }}>" /> <meta name="description" content="{{ post.summary|e }}" />@@ -30,9 +34,9 @@ {% else %}
{% set mftype = 'h-entry' %} {% endif %} <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> - <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 %} <span> <svg width="16" height="16">@@ -41,7 +45,7 @@ </svg>
<a href="{{ post.url }}"> RE: </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 }} </a> </span>@@ -54,14 +58,14 @@ </h1>
</header> {% if post.review %} - <div class="h-review hreview" property="h-review" 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> + <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">{{ post.review.title }}</a></strong> <p> By - <span class="p-author h-card vcard reviewer" property="p-author" 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"> + <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" href="{{ author.url }}" itemprop="url"> <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> <span class="rating" itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">@@ -71,17 +75,17 @@ out of
<span class="best" itemprop="bestRating">{{ post.review.outof }}</span> </span> </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> {% endif %} {% 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 }} </div> {% endif %} - <div class="e-content entry-content" property="e-content" itemprop="articleBody"> + <div class="e-content entry-content" itemprop="articleBody"> {{ post.html_content }} </div>@@ -91,34 +95,32 @@ {% if post.event %}
<dt>Trip details</dt> <dd> 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 }} </time> 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 }} </time>, in - <span class="p-location location" property="p-location"> + <span class="p-location location"> {{ post.event.location }} </span> </dd> {% endif %} <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" - property="p-author h-card" src="{{ author.avatar }}" alt="Photo of {{ author.name }}" itemprop="image" /> <a class="fn p-name url u-url u-uid" - property="p-name u-url u-uid" href="{{ author.url }}" rel="author" itemprop="url"> <span itemprop="name">{{ author.name }}</span> </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> </a> <p aria-hidden="true" hidden="hidden" class="hidden" itemprop="publisher" itemscope="" itemtype="https://schema.org/Organization">@@ -133,7 +135,6 @@
<dt>Published</dt> <dd class="published updated"> <time class="dt-published dt-updated" - property="dt-published dt-updated" datetime="{{ post.pubtime }}" itemprop="dateModified datePublished" >{{ post.pubdate }}</time>@@ -143,7 +144,9 @@
<dt>License</dt> <dd class="license"> {% 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> <li>you can share it</li> <li>you can republish it</li>@@ -152,7 +155,9 @@ <li>you can use it for commercial purposes</li>
<li>you always need to make a link back here</li> </ul> {% 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> <li>you can share it</li> <li>you can republish it</li>@@ -162,7 +167,9 @@ <li>you always need to make a link back here</li>
</ul> For commercial use, please contact me. {% 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> <li>you can share it</li> <li>you can't modify it</li>@@ -179,7 +186,7 @@ <dd>
{% if not post.has_mainimg %} <img aria-hidden="true" src="{{ author.avatar }}" itemprop="image" hidden="hidden" class="hidden" /> {% 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 }} </a> </dd>@@ -216,19 +223,19 @@ <section class="replies">
<h2><a id="replies"></a>Replies</h2> <ol> {% for mtime, comment in post.replies.items() %} - <li class="h-entry p-comment" property="h-entry p-comment"> - <time class="dt-published" property="dt-published" datetime="{{ comment.pubtime }}"> + <li class="h-entry p-comment"> + <time class="dt-published" datetime="{{ comment.pubtime }}"> {{ comment.pubdate }} </time> from - <span class="p-author h-card" property="p-author h-card"> + <span class="p-author h-card"> {% if comment.author.url %} - <a class="url u-url" property="u-url" href="{{ comment.author.url }}"> - <span class="p-name fn" property="p-name"> + <a class="url u-url" href="{{ comment.author.url }}"> + <span class="p-name fn"> {{ comment.author.name }} </span> </a> {% else %} - <span class="p-name fn" property="p-name"> + <span class="p-name fn"> {{ comment.author.name }} </span> {% endif %}@@ -237,7 +244,7 @@ <span class="source">
<svg width="16" height="16"> <use xlink:href="#icon-link"></use> </svg> - <a class="u-url" property="u-url" href="{{ comment.source }}"> + <a class="u-url" href="{{ comment.source }}"> {{ comment.source }} </a> </span>@@ -256,24 +263,24 @@ <dt>{{ character }}</dt>
<dd> <ul> {% 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"> - <a class="u-url" property="u-url" href="{{ comment.source }}"> + <a class="u-url" href="{{ comment.source }}"> {{ comment.type }} </a> </span> - <time class="dt-published" property="dt-published" datetime="{{ comment.pubtime }}"> + <time class="dt-published" datetime="{{ comment.pubtime }}"> {{ comment.pubdate }} </time> from - <span class="p-author h-card" property="p-author h-card"> + <span class="p-author h-card"> {% if comment.author.url %} - <a class="url u-url" property="u-url" href="{{ comment.author.url }}"> - <span class="p-name fn" property="p-name"> + <a class="url u-url" href="{{ comment.author.url }}"> + <span class="p-name fn"> {{ comment.author.name }} </span> </a> {% else %} - <span class="p-name fn" property="p-name"> + <span class="p-name fn"> {{ comment.author.name }} </span> {% endif %}
@@ -2,7 +2,7 @@ <figure class="photo">
{% if href != src %} <a href="{{ href }}"> {% 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 %} </a> {% endif %}
@@ -1,12 +1,13 @@
<!DOCTYPE html> -<html {% block lang %}lang="{{ post.lang }}"{% endblock %}> +<html{% block lang %}{% endblock %}> <head> - <title>{% block title %}{{ post.title }} - {{ site.domain }}{% endblock %}</title> + <title>{% block title %}{% endblock %}</title> <meta charset="UTF-8" /> <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 }}" /> - {% 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() %} <link rel="{{ key }}" href="{{ value }}" /> {% endfor %}@@ -24,7 +25,11 @@ </head>
<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> <section>@@ -57,14 +62,15 @@ <input name="colorscheme" value="light" id="lightscheme" type="radio">
<label for="lightscheme">light</label> </span> </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"> <input type="submit" value="search" id="qsub" name="qsub" /> <svg width="16" height="16"> <use xlink:href="#icon-search"></use> </svg> </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> </div> </section>@@ -76,21 +82,20 @@
{% block pagination %} {% 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> <a href="https://creativecommons.org/">CC</a>, 1999-2019, <span itemprop="logo" itemscope="" itemtype="https://schema.org/ImageObject"> <img class="photo avatar u-photo u-avatar" - property="u-photo u-avatar" src="{{ author.avatar }}" alt="Photo of {{ author.name }}" itemprop="image url" /> </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> </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"> <title>email</title> <use xlink:href="#icon-mail"></use>
@@ -1,10 +1,8 @@
- * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; font-family: "Courier", monospace; - font-size: 11.5pt; margin: 0; padding: 0; line-height: 1.5em;@@ -71,7 +69,7 @@
svg { transform: rotate(0deg); fill: currentColor; - vertical-align: text-top; + vertical-align:middle; } body > svg {@@ -123,7 +121,6 @@ body > header a {
font-weight: bold; border-bottom: 3px solid transparent; padding-bottom: 0.1em; - text-transform:uppercase; } body > header a:hover,