Eclectic Media Git eclecticmedia.space / 5137156
Extended blog engine to handle subfolders/sub-categories Ariana Giroux 19 days ago
2 changed file(s) with 4 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
2424 context={'items': [item for item in sort_blog()]})
2525
2626
27 @app.route('/blog/<article>', methods=['GET'])
27 @app.route('/blog/<path:article>', methods=['GET'])
2828 def article(article):
2929 article = f'content/blog/{article}.md'
3030 if os.access(article, os.F_OK):
1414 name = name.replace('.md', '')
1515 name = name.title()
1616
17 link = name.lower().replace(' ', '-')
17 link = os.path.split(path)[0].replace('content/blog', '')
18 link = link[1:] + '/' if len(link) > 0 else link
19 link += name.lower().replace(' ', '-')
1820
1921 yield name, link, path
2022