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 PMParent: 24e024da97cf9d87a7f977de146793a276e4b4e0
Files changed
generator/templates/entry.py | changed |
generator/templates/entry.py | ||
---|---|---|
@@ -50,8 +50,17 @@ | ||
50 | 50 … | ] = relevant_earlier_entries.get(other_entry, {}) |
51 | 51 … | relevant_earlier_entries[other_entry][ |
52 | 52 … | "labels" |
53 | 53 … | ] = 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 … | + ] | |
54 | 63 … | relevant_earlier_entries[other_entry]["labels"] += [tag_string] |
55 | 64 … | relevant_earlier_entries[other_entry].update({"rel": "prev"}) |
56 | 65 … | for other_entry in later_entries: |
57 | 66 … | if later_entries.index(other_entry) == 0: |
@@ -91,8 +100,17 @@ | ||
91 | 100 … | ) |
92 | 101 … | relevant_later_entries[other_entry][ |
93 | 102 … | "labels" |
94 | 103 … | ] = 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 … | + ] | |
95 | 113 … | relevant_later_entries[other_entry]["labels"] += [tag_string] |
96 | 114 … | relevant_later_entries[other_entry].update({"rel": "next"}) |
97 | 115 … | links = "" |
98 | 116 … | if len(relevant_earlier_entries) > 0: |
Built with git-ssb-web