1
0
mirror of https://github.com/venthur/blag.git synced 2025-11-25 20:52:43 +00:00

removed unused tags blog for now

This commit is contained in:
Bastian Venthur
2021-02-01 21:55:11 +01:00
parent d70485be8d
commit 410c4e0d2b

View File

@@ -69,7 +69,8 @@ def build(args):
convertibles = []
for root, dirnames, filenames in os.walk(args.input_dir):
for filename in filenames:
rel_src = os.path.relpath(f'{root}/{filename}', start=args.input_dir)
rel_src = os.path.relpath(f'{root}/{filename}',
start=args.input_dir)
# all non-markdown files are just copied over, the markdown
# files are converted to html
if rel_src.endswith('.md'):
@@ -77,7 +78,8 @@ def build(args):
rel_dst = rel_dst[:-3] + '.html'
convertibles.append((rel_src, rel_dst))
else:
shutil.copy(f'{args.input_dir}/{rel_src}', f'{args.output_dir}/{rel_src}')
shutil.copy(f'{args.input_dir}/{rel_src}',
f'{args.output_dir}/{rel_src}')
for dirname in dirnames:
# all directories are copied into the output directory
path = os.path.relpath(f'{root}/{dirname}', start=args.input_dir)
@@ -153,25 +155,6 @@ def convert_to_html(convertibles, input_dir, output_dir):
with open('build/index.html', 'w') as fh:
fh.write(result)
## generate tags
#ctx = {}
#tags = {}
#for dst, context in articles:
# logger.debug(f'{dst}: {context}')
# entry = context.copy()
# entry['dst'] = dst
# for tag in context['tags']:
# tags['tag'] = tags.get(tag, []).append(entry)
#tags = list(tags)
#tags = sorted(tags)
#ctx['tags'] = tags
#template = env.get_template('tags.html')
#result = template.render(ctx)
#with open('tags.html', 'w') as fh:
# fh.write(result)
if __name__ == '__main__':
main()