when symlinking foo.md, also symlink foo.html if generating .html
fixes #24 Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
This commit is contained in:
@@ -142,6 +142,14 @@ class StaticSiteGenerator(object):
|
||||
src = self.symlink_to_relative_dest(source_dir, os.path.join(base_dir, file_))
|
||||
print(f"creating symlink '{dst}' -> '{src}'")
|
||||
os.symlink(src, dst, target_is_directory=False)
|
||||
if src.endswith('.md') and convert_markdown:
|
||||
# we also need to make a .html symlink so that web server configs
|
||||
# pick up the "redirect"
|
||||
second_src = src.removesuffix('.md') + '.html'
|
||||
second_dst = dst.removesuffix('.md') + '.html'
|
||||
print(f"creating symlink '{second_dst}' -> '{second_src}'")
|
||||
os.symlink(second_src, second_dst, target_is_directory=False)
|
||||
|
||||
else:
|
||||
src = os.path.join(base_dir, file_)
|
||||
print(f"copying file '{src}' -> '{dst}'")
|
||||
|
||||
Reference in New Issue
Block a user