From ed493033b0bcb9cd66ee4d76309d50b7ebfb1fe0 Mon Sep 17 00:00:00 2001 From: Bastian Venthur Date: Sat, 6 Feb 2021 17:30:22 +0100 Subject: [PATCH] Added quickstart --- blag/blag.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/blag/blag.py b/blag/blag.py index 95010b0..5286b0d 100644 --- a/blag/blag.py +++ b/blag/blag.py @@ -67,6 +67,10 @@ def parse_args(args): default='templates', help='Template directory (default: templates)', ) + + quickstart_parser = commands.add_parser('quickstart') + quickstart_parser.set_defaults(func=quickstart) + return parser.parse_args() @@ -233,5 +237,23 @@ def generate_archive(articles, template, output_dir): fh.write(result) +def quickstart(args): + base_url = input("Hostname (and path) to the root? " + "[https://example.com/]: ") + title = input("Title of your website? ") + subtitle = input("Subtitle of your website? ") + author = input("Author of your website [John Doe]? ") + + config = configparser.ConfigParser() + config['main'] = { + 'base_url': base_url, + 'title': title, + 'subtitle': subtitle, + 'author': author, + } + with open('config.ini', 'w') as fh: + config.write(fh) + + if __name__ == '__main__': main()