# scan the true content folder and recreate all the symbolic links from os.path import basename from pathlib import Path SITE_BASE = "./janco_website" MD_ORGANIZED_CONTENT_BASE = "./janco_website/true_content/posts" MD_FLAT_CONTENT_BASE = "./janco_website/content/posts" for path in Path(MD_ORGANIZED_CONTENT_BASE).rglob('*.md'): bn = basename(path) Path(MD_FLAT_CONTENT_BASE + '/' + bn).symlink_to('../../' + str(path.relative_to(SITE_BASE)))