From 410c4e0d2ba64593cf709c4eabd6f0658705b56c Mon Sep 17 00:00:00 2001 From: Bastian Venthur Date: Mon, 1 Feb 2021 21:55:11 +0100 Subject: [PATCH] removed unused tags blog for now --- blag/blag.py | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/blag/blag.py b/blag/blag.py index 1bcc7c3..6b469d8 100644 --- a/blag/blag.py +++ b/blag/blag.py @@ -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()