From: Zachary Vance Date: Wed, 3 Jul 2024 18:55:46 +0000 (-0400) Subject: minor tag tweaks X-Git-Url: https://git.za3k.com/?a=commitdiff_plain;h=7d262d21486d84942917ca17a6e6180f418d238a;p=blog.git minor tag tweaks --- diff --git a/blog b/blog index 79ad20c..fb90e70 100755 --- a/blog +++ b/blog @@ -191,7 +191,7 @@ class Blog(PseudoMap): for k in {"source", "destination"}: self[k] = os.path.expanduser(config.pop(k)) for k, v in config.items(): - if k.endswith("_dir") or k.endswith("_template"): + if k.endswith("_dir") or k.endswith("_template") or k.endswith("_path"): v = os.path.join(self.source, os.path.expanduser(v)) self[k] = v @@ -255,10 +255,10 @@ class Blog(PseudoMap): os.execl(sys.argv[0], *sys.argv) @property - def tag_cloud(self, font_sizes=range(8, 22), limit=45): + def tagcloud(self, font_sizes=range(8, 22), limit=45): top_tags = self.tags.values() # Top 45 most popular tags - top_tags = sorted(top_tags, key=lambda x: x.num_posts, reverse=True)[:limit] + top_tags = sorted(top_tags, key=lambda x: (x.num_posts, x.tag.lower()), reverse=True)[:limit] # in alphabetical order self.top_tags = sorted(top_tags, key=lambda x: x.tag.lower()) diff --git a/config.yaml b/config.yaml index 89e6d7a..b040a37 100644 --- a/config.yaml +++ b/config.yaml @@ -13,7 +13,7 @@ post_template: "templates/post.mustache.html" tagcloud_template: "templates/tagcloud.mustache.html" post_destination: "{{destination}}/posts/{{id}}.html" -tag_destination: "{{destination}}/tag/{{tag}}.html" +tag_destination: "{{destination}}/tag/{{slug}}.html" category_destination: "{{destination}}/category/{{category}}.html" page_destination: "{{destination}}/{{page}}" image_destination: "{{destination}}/images/{{image}}" diff --git a/templates/post.mustache.html b/templates/post.mustache.html index b4163c6..04260d0 100644 --- a/templates/post.mustache.html +++ b/templates/post.mustache.html @@ -99,7 +99,7 @@
  • - {{& tag_cloud }} + {{& tagcloud }}
  • diff --git a/templates/tag.mustache.html b/templates/tag.mustache.html index ad0c07f..833776e 100644 --- a/templates/tag.mustache.html +++ b/templates/tag.mustache.html @@ -6,18 +6,10 @@ -games +{{ tag }} - - - + - - - - - - - -
    - -
    - + +
    @@ -165,29 +119,19 @@ var mantra_options = {"responsive":"1","image_class":"imageSeven","equalize_side - - - {{# posts }} {{& post }} {{/ posts }} -
    -
    - - - - - - - -