linkedin-posts-scraper/construct_hugo_content_links.py
2023-02-19 12:18:10 +01:00

15 lines
458 B
Python

# 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)))