Reverting layout back to divs, because the "semantic" structuring of HTML5 is a mess and only complicates my life.
It's also for more backwards compatibility, though <figure> and <figcaption> is going to stay, because those make a lot of sense. Coming up next: out with JSON-LD. It was an interesting experiment which didn't bring any good at all, even in the long run.
This commit is contained in:
parent
71bf7f7266
commit
67f2978aeb
9 changed files with 49 additions and 74 deletions
23
nasg.py
23
nasg.py
|
@ -244,18 +244,7 @@ class Gone(object):
|
||||||
return {"source": self.source}
|
return {"source": self.source}
|
||||||
|
|
||||||
async def render(self):
|
async def render(self):
|
||||||
if self.exists:
|
return
|
||||||
os.remove(self.renderfile)
|
|
||||||
os.rmdir(self.renderdir)
|
|
||||||
# rmtree(self.renderdir)
|
|
||||||
return
|
|
||||||
# logger.info(
|
|
||||||
# "rendering %s to %s", self.__class__, self.renderfile
|
|
||||||
# )
|
|
||||||
# writepath(
|
|
||||||
# self.renderfile, J2.get_template(self.template).render()
|
|
||||||
# )
|
|
||||||
|
|
||||||
|
|
||||||
class FediverseStats(object):
|
class FediverseStats(object):
|
||||||
def __init__(self, postcount=0, commentcount=0):
|
def __init__(self, postcount=0, commentcount=0):
|
||||||
|
@ -761,15 +750,6 @@ class WebImage(object):
|
||||||
self.size = size
|
self.size = size
|
||||||
self.crop = crop
|
self.crop = crop
|
||||||
|
|
||||||
# @property
|
|
||||||
# def data(self):
|
|
||||||
# with open(self.fpath, "rb") as f:
|
|
||||||
# encoded = base64.b64encode(f.read())
|
|
||||||
# return "data:%s;base64,%s" % (
|
|
||||||
# self.parent.mime_type,
|
|
||||||
# encoded.decode("utf-8"),
|
|
||||||
# )
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def suffix(self):
|
def suffix(self):
|
||||||
return settings.photo.get("sizes").get(self.size, "")
|
return settings.photo.get("sizes").get(self.size, "")
|
||||||
|
@ -2712,7 +2692,6 @@ def make():
|
||||||
# make gone and redirect arrays for PHP
|
# make gone and redirect arrays for PHP
|
||||||
for e in glob.glob(os.path.join(content, "*", "*.del")):
|
for e in glob.glob(os.path.join(content, "*", "*.del")):
|
||||||
post = Gone(e)
|
post = Gone(e)
|
||||||
queue.put(post.render())
|
|
||||||
rules.add_gone(post.source)
|
rules.add_gone(post.source)
|
||||||
for e in glob.glob(os.path.join(content, "*", "*.url")):
|
for e in glob.glob(os.path.join(content, "*", "*.url")):
|
||||||
post = Redirect(e)
|
post = Redirect(e)
|
||||||
|
|
|
@ -11,23 +11,23 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<main id="main" class="h-feed hatom {{ category.name }}">
|
<div id="main" class="h-feed hatom {{ category.name }}">
|
||||||
|
|
||||||
{% set year = [0] %}
|
{% set year = [0] %}
|
||||||
{% for post in posts %}
|
{% for post in posts %}
|
||||||
{% set _year = year.pop() %}
|
{% set _year = year.pop() %}
|
||||||
{% if _year != post.copyrightYear %}
|
{% if _year != post.copyrightYear %}
|
||||||
{% if not loop.first %}
|
{% if not loop.first %}
|
||||||
</section>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<section class="year">
|
<div class="year">
|
||||||
<h2>{{ post.copyrightYear }}</h2>
|
<h2>{{ post.copyrightYear }}</h2>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% set _ = year.append(post.copyrightYear)%}
|
{% set _ = year.append(post.copyrightYear)%}
|
||||||
{% include 'meta-article.j2.html' %}
|
{% include 'meta-article.j2.html' %}
|
||||||
{% if loop.last %}
|
{% if loop.last %}
|
||||||
</section>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</main>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -14,15 +14,15 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<main id="main" class="h-feed hatom">
|
<div id="main" class="h-feed hatom">
|
||||||
<section id="intro">
|
<div class="section" id="intro">
|
||||||
<div>
|
<div>
|
||||||
{{ post.text }}
|
{{ post.text }}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</div>
|
||||||
|
|
||||||
{% set isFrontPage = 1 %}
|
{% set isFrontPage = 1 %}
|
||||||
<section id="latest">
|
<div id="latest">
|
||||||
<h1>Latest entries</h1>
|
<h1>Latest entries</h1>
|
||||||
{% for category, post in posts %}
|
{% for category, post in posts %}
|
||||||
<h2>in:
|
<h2>in:
|
||||||
|
@ -33,6 +33,6 @@
|
||||||
</h2>
|
</h2>
|
||||||
{% include 'meta-article.j2.html' %}
|
{% include 'meta-article.j2.html' %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</section>
|
</div>
|
||||||
</main>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -120,7 +120,7 @@ if (isset($_GET['json'])) {
|
||||||
{% block title %}Search results for: <?php echo($q); ?>{% endblock %}
|
{% block title %}Search results for: <?php echo($q); ?>{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<main id="main" class="h-feed hatom">
|
<div id="main" class="h-feed hatom main">
|
||||||
<h1>Search results for: <?php echo($q); ?></h1>
|
<h1>Search results for: <?php echo($q); ?></h1>
|
||||||
<dl>
|
<dl>
|
||||||
<?php
|
<?php
|
||||||
|
@ -129,5 +129,5 @@ if (isset($_GET['json'])) {
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</dl>
|
</dl>
|
||||||
</main>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -61,8 +61,8 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<main id="main">
|
<div id="main">
|
||||||
<article class="h-entry hentry" lang="{{ post.inLanguage }}" id="article">
|
<div class="h-entry hentry" lang="{{ post.inLanguage }}" id="article">
|
||||||
<h1 class="p-name entry-title">
|
<h1 class="p-name entry-title">
|
||||||
{% if post.mentions %}
|
{% if post.mentions %}
|
||||||
<span>
|
<span>
|
||||||
|
@ -84,7 +84,7 @@
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
{% if post.review %}
|
{% if post.review %}
|
||||||
<section class="h-review hreview">
|
<div class="h-review hreview">
|
||||||
<strong>Review summary of: <a href="{{ post.review.url }}" class="p-name u-url p-item h-product item fn url">{{ post.review.name }}</a></strong>
|
<strong>Review summary of: <a href="{{ post.review.url }}" class="p-name u-url p-item h-product item fn url">{{ post.review.name }}</a></strong>
|
||||||
<p>
|
<p>
|
||||||
By
|
By
|
||||||
|
@ -101,16 +101,16 @@
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="p-summary summary">{{ post.review.text }}</p>
|
<p class="p-summary summary">{{ post.review.text }}</p>
|
||||||
</section>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if post.description|length %}
|
{% if post.description|length %}
|
||||||
<section class="e-summary entry-summary">
|
<div class="e-summary entry-summary">
|
||||||
{{ post.description|relurl(baseurl) }}
|
{{ post.description|relurl(baseurl) }}
|
||||||
</section>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<section>
|
<div class="section">
|
||||||
{% if post.image|length %}
|
{% if post.image|length %}
|
||||||
{% for image in post.image %}
|
{% for image in post.image %}
|
||||||
{% if image.representativeOfPage %}
|
{% if image.representativeOfPage %}
|
||||||
|
@ -121,12 +121,12 @@
|
||||||
<div class="e-content entry-content">
|
<div class="e-content entry-content">
|
||||||
{{ post.text|relurl(baseurl) }}
|
{{ post.text|relurl(baseurl) }}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</div>
|
||||||
|
|
||||||
{% if 'WebPage' != post['@type'] %}
|
{% if 'WebPage' != post['@type'] %}
|
||||||
{% if post.comment|length %}
|
{% if post.comment|length %}
|
||||||
<section class="comments">
|
<div class="comments" id="comments">
|
||||||
<h2><a id="comments"></a>Responses</h2>
|
<h2>Responses</h2>
|
||||||
<ol>
|
<ol>
|
||||||
{% for comment in post.comment %}
|
{% for comment in post.comment %}
|
||||||
<li class="h-entry p-comment hentry">
|
<li class="h-entry p-comment hentry">
|
||||||
|
@ -168,12 +168,12 @@
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ol>
|
</ol>
|
||||||
</section>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<footer class="entry-footer">
|
<div class="entry-footer">
|
||||||
<p>Licenced under
|
<p>Licenced under
|
||||||
<a rel="license" href="{{ post.license }}" class="u-license">{{ post.license | extractlicense }}</a>,
|
<a rel="license" href="{{ post.license }}" class="u-license">{{ post.license | extractlicense }}</a>,
|
||||||
created by
|
created by
|
||||||
|
@ -238,8 +238,8 @@
|
||||||
<a class="u-url url" href="{{ post.url }}"></a>
|
<a class="u-url url" href="{{ post.url }}"></a>
|
||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</footer>
|
</div>
|
||||||
|
|
||||||
</article>
|
</div>
|
||||||
</main>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
{% block pagination %}
|
{% block pagination %}
|
||||||
{% if category.paginated %}
|
{% if category.paginated %}
|
||||||
<section id="pagination">
|
<div id="pagination">
|
||||||
<ol>
|
<ol>
|
||||||
{% for y, url in category.years.items() %}
|
{% for y, url in category.years.items() %}
|
||||||
{% if (y == category.year) or (not category.year and loop.first) %}
|
{% if (y == category.year) or (not category.year and loop.first) %}
|
||||||
|
@ -30,28 +30,28 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ol>
|
</ol>
|
||||||
</section>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<main id="main" class="h-feed hatom {{ category.name }}">
|
<div id="main" class="h-feed hatom {{ category.name }}">
|
||||||
|
|
||||||
{% set year = [0] %}
|
{% set year = [0] %}
|
||||||
{% for post in posts %}
|
{% for post in posts %}
|
||||||
{% set _year = year.pop() %}
|
{% set _year = year.pop() %}
|
||||||
{% if not category.paginated and _year != post.copyrightYear %}
|
{% if not category.paginated and _year != post.copyrightYear %}
|
||||||
{% if not loop.first %}
|
{% if not loop.first %}
|
||||||
</section>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<section class="year">
|
<div class="year">
|
||||||
<h2>{{ post.copyrightYear }}</h2>
|
<h2>{{ post.copyrightYear }}</h2>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% set _ = year.append(post.copyrightYear)%}
|
{% set _ = year.append(post.copyrightYear)%}
|
||||||
{% include 'meta-article.j2.html' %}
|
{% include 'meta-article.j2.html' %}
|
||||||
{% if not category.paginated and loop.last %}
|
{% if not category.paginated and loop.last %}
|
||||||
</section class="year">
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</main>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -39,9 +39,9 @@
|
||||||
or ( category is defined and category.name == name )%}class="active"{% endif %}
|
or ( category is defined and category.name == name )%}class="active"{% endif %}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
<header id="header">
|
<div id="header">
|
||||||
<div>
|
<div>
|
||||||
<nav>
|
<div class="nav">
|
||||||
<ul>
|
<ul>
|
||||||
{% for key, data in menu.items() %}
|
{% for key, data in menu.items() %}
|
||||||
<li>
|
<li>
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</div>
|
||||||
|
|
||||||
<div id="header-forms">
|
<div id="header-forms">
|
||||||
{% for action in site.potentialAction %}
|
{% for action in site.potentialAction %}
|
||||||
|
@ -72,7 +72,7 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</div>
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -80,7 +80,7 @@
|
||||||
{% block pagination %}
|
{% block pagination %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
<footer id="footer" class="p-author h-card vcard">
|
<div id="footer" class="p-author h-card vcard">
|
||||||
<div>
|
<div>
|
||||||
<p>
|
<p>
|
||||||
<a href="https://creativecommons.org/">CC</a>,
|
<a href="https://creativecommons.org/">CC</a>,
|
||||||
|
@ -173,7 +173,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
{% include 'themeswitcher.js' %}
|
{% include 'themeswitcher.js' %}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<article class="h-entry hentry" lang="{{ post.inLanguage }}">
|
<div class="h-entry hentry" lang="{{ post.inLanguage }}">
|
||||||
<header class="entry-header">
|
<div class="entry-header">
|
||||||
<h3 class="p-name entry-title">
|
<h3 class="p-name entry-title">
|
||||||
{% if post.mentions %}
|
{% if post.mentions %}
|
||||||
<span>
|
<span>
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
</h3>
|
</h3>
|
||||||
<a href="{{ post.url }}" class="u-url bookmark"></a>
|
<a href="{{ post.url }}" class="u-url bookmark"></a>
|
||||||
</header>
|
</div>
|
||||||
|
|
||||||
{% if post.description|length %}
|
{% if post.description|length %}
|
||||||
{% set summary = post.description %}
|
{% set summary = post.description %}
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer class="entry-footer" aria-hidden="true" hidden="hidden">
|
<div class="entry-footer" aria-hidden="true" hidden="hidden">
|
||||||
Published at
|
Published at
|
||||||
<time datetime="{{ post.datePublished }}" class="dt-published published">{{ post.datePublished|printdate }}</time>
|
<time datetime="{{ post.datePublished }}" class="dt-published published">{{ post.datePublished|printdate }}</time>
|
||||||
<time datetime="{{ post.dateModified }}" class="dt-updated updated"></time>
|
<time datetime="{{ post.dateModified }}" class="dt-updated updated"></time>
|
||||||
|
@ -57,5 +57,5 @@
|
||||||
<a class="p-name u-url fn url org" href="{{ post.author.url }}">{{ post.author.name }}</a>
|
<a class="p-name u-url fn url org" href="{{ post.author.url }}">{{ post.author.name }}</a>
|
||||||
<a class="u-email email" href="mailto:{{ post.author.email }}">{{ post.author.email }}</a>
|
<a class="u-email email" href="mailto:{{ post.author.email }}">{{ post.author.email }}</a>
|
||||||
</span>
|
</span>
|
||||||
</footer>
|
</div>
|
||||||
</article>
|
</div>
|
||||||
|
|
|
@ -51,10 +51,6 @@ td, th {
|
||||||
text-overflow:initial !important;
|
text-overflow:initial !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#header,
|
#header,
|
||||||
#footer,
|
#footer,
|
||||||
video,
|
video,
|
||||||
|
|
Loading…
Reference in a new issue