generator/templates/entry.pyView |
---|
21 | 21 … | if "series" in common.entries[id] and "series" in common.entries[other_entry]: |
22 | 22 … | if common.slugify(common.entries[id]["series"]) == common.slugify( |
23 | 23 … | common.entries[other_entry]["series"] |
24 | 24 … | ): |
25 | | - entries_in_this_series = common.entries_in_series( |
26 | | - common.entries[id]["series"] |
27 | | - ) |
28 | | - if other_entry == common.offset_id(entries_in_this_series, id, -1): |
| 25 … | + if other_entry == common.offset_id( |
| 26 … | + common.entries_in_series(common.entries[id]["series"]), id, -1 |
| 27 … | + ): |
29 | 28 … | relevant_earlier_entries[ |
30 | 29 … | other_entry |
31 | 30 … | ] = relevant_earlier_entries.get(other_entry, {}) |
32 | | - relevant_earlier_entries[other_entry][ |
33 | | - "labels" |
34 | | - ] = relevant_earlier_entries[other_entry].get("labels", []) |
35 | | - relevant_earlier_entries[other_entry]["labels"] += [ |
36 | | - common.entries[id]["series"] |
37 | | - ] |
38 | 31 … | relevant_earlier_entries[other_entry].update({"rel": "prev"}) |
39 | 32 … | if "tags" in common.entries[id] and "tags" in common.entries[other_entry]: |
40 | 33 … | for tag_string in [ |
41 | 34 … | tag_string |
50 | 43 … | ] = relevant_earlier_entries.get(other_entry, {}) |
51 | 44 … | relevant_earlier_entries[other_entry][ |
52 | 45 … | "labels" |
53 | 46 … | ] = 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 | | - ] |
63 | 47 … | relevant_earlier_entries[other_entry]["labels"] += [tag_string] |
64 | 48 … | relevant_earlier_entries[other_entry].update({"rel": "prev"}) |
65 | 49 … | for other_entry in later_entries: |
66 | 50 … | if later_entries.index(other_entry) == 0: |
71 | 55 … | if "series" in common.entries[id] and "series" in common.entries[other_entry]: |
72 | 56 … | if common.slugify(common.entries[id]["series"]) == common.slugify( |
73 | 57 … | common.entries[other_entry]["series"] |
74 | 58 … | ): |
|
75 | | - entries_in_this_series = common.entries_in_series( |
76 | | - common.entries[id]["series"] |
77 | | - ) |
78 | | - if other_entry == common.offset_id(entries_in_this_series, id, +1): |
| 59 … | + if other_entry == common.offset_id( |
| 60 … | + common.entries_in_series(common.entries[id]["series"]), id, +1 |
| 61 … | + ): |
79 | 62 … | relevant_later_entries[other_entry] = relevant_later_entries.get( |
80 | 63 … | other_entry, {} |
81 | 64 … | ) |
82 | | - relevant_later_entries[other_entry][ |
83 | | - "labels" |
84 | | - ] = relevant_later_entries[other_entry].get("labels", []) |
85 | | - relevant_later_entries[other_entry]["labels"] += [ |
86 | | - common.entries[id]["series"] |
87 | | - ] |
88 | 65 … | relevant_later_entries[other_entry].update({"rel": "next"}) |
89 | 66 … | if "tags" in common.entries[id] and "tags" in common.entries[other_entry]: |
90 | 67 … | for tag_string in [ |
91 | 68 … | tag_string |
100 | 77 … | ) |
101 | 78 … | relevant_later_entries[other_entry][ |
102 | 79 … | "labels" |
103 | 80 … | ] = 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 | | - ] |
113 | 81 … | relevant_later_entries[other_entry]["labels"] += [tag_string] |
114 | 82 … | relevant_later_entries[other_entry].update({"rel": "next"}) |
115 | 83 … | links = "" |
116 | 84 … | if len(relevant_earlier_entries) > 0: |