Prefix image paths with images
subdirectory (which does not yet exist)
This commit is contained in:
parent
f1ae73b737
commit
d98354046b
@ -27,11 +27,13 @@ DEX_TYPES = [
|
||||
DEXES = list(chain.from_iterable([["{}{}".format(dex_type, language) for dex_type in DEX_TYPES] for language in DEX_LANGUAGES]))
|
||||
|
||||
FORUM_THREAD_INDEX = "thread_index.json.gz"
|
||||
IMAGE_DIRECTORY = "images"
|
||||
|
||||
class ArchiveLinker(Linker):
|
||||
def __init__ (self, directory_names=[]):
|
||||
super().__init__()
|
||||
self.directory_names = directory_names
|
||||
self.image_directory = IMAGE_DIRECTORY
|
||||
self.replacements = {
|
||||
"/": "+",
|
||||
#":": ""
|
||||
@ -57,6 +59,13 @@ class ArchiveLinker(Linker):
|
||||
|
||||
return "{}{}{}.html{}".format(directory_name, '/' if directory_name else '', page_title, fragment)
|
||||
|
||||
def translate_image_title (self, page_title):
|
||||
image_title = super().translate_image_title(page_title)
|
||||
if not image_title:
|
||||
return
|
||||
|
||||
return "{}/{}".format(self.image_directory, image_title)
|
||||
|
||||
def prepare_thread (thread):
|
||||
thread.subject = html.unescape(thread.subject)
|
||||
return thread
|
||||
|
Loading…
x
Reference in New Issue
Block a user