git ssb

0+

Grey the earthling / gkn.me.uk



Commit 42fd8897ab16ba7f6d7f843ba1695042431b025d

Label related entries in the same series shown due to a common tag

Grey Nicholson committed on 10/2/2021, 7:18:29 PM
Parent: 24e024da97cf9d87a7f977de146793a276e4b4e0

Files changed

generator/templates/entry.pychanged
generator/templates/entry.pyView
@@ -50,8 +50,17 @@
5050 ] = relevant_earlier_entries.get(other_entry, {})
5151 relevant_earlier_entries[other_entry][
5252 "labels"
5353 ] = relevant_earlier_entries[other_entry].get("labels", [])
54 + if (
55 + "series" in common.entries[id]
56 + and "series" in common.entries[other_entry]
57 + and common.slugify(common.entries[id]["series"])
58 + == common.slugify(common.entries[other_entry]["series"])
59 + ):
60 + relevant_earlier_entries[other_entry]["labels"] += [
61 + common.entries[id]["series"]
62 + ]
5463 relevant_earlier_entries[other_entry]["labels"] += [tag_string]
5564 relevant_earlier_entries[other_entry].update({"rel": "prev"})
5665 for other_entry in later_entries:
5766 if later_entries.index(other_entry) == 0:
@@ -91,8 +100,17 @@
91100 )
92101 relevant_later_entries[other_entry][
93102 "labels"
94103 ] = relevant_later_entries[other_entry].get("labels", [])
104 + if (
105 + "series" in common.entries[id]
106 + and "series" in common.entries[other_entry]
107 + and common.slugify(common.entries[id]["series"])
108 + == common.slugify(common.entries[other_entry]["series"])
109 + ):
110 + relevant_later_entries[other_entry]["labels"] += [
111 + common.entries[id]["series"]
112 + ]
95113 relevant_later_entries[other_entry]["labels"] += [tag_string]
96114 relevant_later_entries[other_entry].update({"rel": "next"})
97115 links = ""
98116 if len(relevant_earlier_entries) > 0:

Built with git-ssb-web