diff --git a/nasg.py b/nasg.py index c0f3df2..52da70c 100644 --- a/nasg.py +++ b/nasg.py @@ -244,18 +244,7 @@ class Gone(object): return {"source": self.source} async def render(self): - if self.exists: - 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() - # ) - + return class FediverseStats(object): def __init__(self, postcount=0, commentcount=0): @@ -761,15 +750,6 @@ class WebImage(object): self.size = size 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 def suffix(self): return settings.photo.get("sizes").get(self.size, "") @@ -2712,7 +2692,6 @@ def make(): # make gone and redirect arrays for PHP for e in glob.glob(os.path.join(content, "*", "*.del")): post = Gone(e) - queue.put(post.render()) rules.add_gone(post.source) for e in glob.glob(os.path.join(content, "*", "*.url")): post = Redirect(e) diff --git a/templates/Flat.j2.html b/templates/Flat.j2.html index c7c0930..72c8b7e 100644 --- a/templates/Flat.j2.html +++ b/templates/Flat.j2.html @@ -11,23 +11,23 @@ {% endblock %} {% block content %} -
+
{% set year = [0] %} {% for post in posts %} {% set _year = year.pop() %} {% if _year != post.copyrightYear %} {% if not loop.first %} - +
{% endif %} -
+

{{ post.copyrightYear }}

{% endif %} {% set _ = year.append(post.copyrightYear)%} {% include 'meta-article.j2.html' %} {% if loop.last %} -
+ {% endif %} {% endfor %} -
+ {% endblock %} diff --git a/templates/Home.j2.html b/templates/Home.j2.html index ee79d13..97256de 100644 --- a/templates/Home.j2.html +++ b/templates/Home.j2.html @@ -14,15 +14,15 @@ {% endblock %} {% block content %} -
-
+
+
{{ post.text }}
-
+ {% set isFrontPage = 1 %} -
+

Latest entries

{% for category, post in posts %}

in: @@ -33,6 +33,6 @@

{% include 'meta-article.j2.html' %} {% endfor %} -
-
+ + {% endblock %} diff --git a/templates/Search.j2.php b/templates/Search.j2.php index b13f190..ee8fee2 100644 --- a/templates/Search.j2.php +++ b/templates/Search.j2.php @@ -120,7 +120,7 @@ if (isset($_GET['json'])) { {% block title %}Search results for: {% endblock %} {% block content %} -
+

Search results for:

-
+ {% endblock %} diff --git a/templates/Singular.j2.html b/templates/Singular.j2.html index 287b39b..5cf345f 100644 --- a/templates/Singular.j2.html +++ b/templates/Singular.j2.html @@ -61,8 +61,8 @@ {% endblock %} {% block content %} -
-
+
+

{% if post.mentions %} @@ -84,7 +84,7 @@

{% if post.review %} -
+
Review summary of: {{ post.review.name }}

By @@ -101,16 +101,16 @@

{{ post.review.text }}

-
+
{% endif %} {% if post.description|length %} -
+
{{ post.description|relurl(baseurl) }} -
+
{% endif %} -
+
{% if post.image|length %} {% for image in post.image %} {% if image.representativeOfPage %} @@ -121,12 +121,12 @@
{{ post.text|relurl(baseurl) }}
-
+ {% if 'WebPage' != post['@type'] %} {% if post.comment|length %} -
-

Responses

+
+

Responses

    {% for comment in post.comment %}
  1. @@ -168,12 +168,12 @@
  2. {% endfor %}
-
+ {% endif %} {% endif %} - + -
-
+ + {% endblock %} diff --git a/templates/Year.j2.html b/templates/Year.j2.html index d63cf3d..76d552c 100644 --- a/templates/Year.j2.html +++ b/templates/Year.j2.html @@ -12,7 +12,7 @@ {% block pagination %} {% if category.paginated %} -
+
+ {% endif %} {% endblock %} {% block content %} -
+
{% set year = [0] %} {% for post in posts %} {% set _year = year.pop() %} {% if not category.paginated and _year != post.copyrightYear %} {% if not loop.first %} - +
{% endif %} -
-

{{ post.copyrightYear }}

+
+

{{ post.copyrightYear }}

{% endif %} {% set _ = year.append(post.copyrightYear)%} {% include 'meta-article.j2.html' %} {% if not category.paginated and loop.last %} -
+ {% endif %} {% endfor %} -
+ {% endblock %} diff --git a/templates/base.j2.html b/templates/base.j2.html index 9681306..cb25e34 100644 --- a/templates/base.j2.html +++ b/templates/base.j2.html @@ -39,9 +39,9 @@ or ( category is defined and category.name == name )%}class="active"{% endif %} {% endmacro %} - + {% block content %} {% endblock %} @@ -80,7 +80,7 @@ {% block pagination %} {% endblock %} - +