Skip to content

Instantly share code, notes, and snippets.

View joshvickerson's full-sized avatar

Josh Vickerson joshvickerson

View GitHub Profile
@joshvickerson
joshvickerson / anchorcms-json-to-markdown.py
Last active March 24, 2023 18:31
Convert a JSON Export of post data from AnchorCMS to individual markdown files grouped by year for consumption by Eleventy
import json
import os
from datetime import datetime
from markdownify import markdownify # requires installation: https://pypi.org/project/markdownify/
outputDirBase = 'posts/'
# open the file
with open('blog_posts.json', 'r') as file:
post_data = json.load(file)