diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..176a458 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/.github/workflows/generator.py b/.github/workflows/generator.py index 9cc4e59..b47fadf 100644 --- a/.github/workflows/generator.py +++ b/.github/workflows/generator.py @@ -44,13 +44,17 @@ if __name__ == '__main__': if 'title_image' in post and '/' not in post['title_image']: post['title_image'] = 'content/images/' + post['title_image'] + # Generate url-name + if 'url_name' not in post: + post['url_name'] = os.path.splitext(b)[0].replace(' ', '-') + post['content'] = md.strip() posts.sort(key=lambda x: x['date'], reverse=True) # Give every post an id based on index for i, p in enumerate(posts): - p['id'] = i + p['id'] = len(posts) - i # Count tags and categories tags = Counter([t for p in posts for t in p['tags']])