From 7b501df1ec31fde8ae14e80a1072a158e6de42cb Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 3 Aug 2022 01:18:02 +0200 Subject: [PATCH] Restored changes lost during the Gitlab->Gitea migration --- madblog/cli.py | 6 +++--- madblog/static/css/home.css | 7 ------- madblog/uwsgi.py | 7 ++++++- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/madblog/cli.py b/madblog/cli.py index 0dbf347..b1b9486 100644 --- a/madblog/cli.py +++ b/madblog/cli.py @@ -3,7 +3,7 @@ import os import sys -def get_args(): +def get_args(args): parser = argparse.ArgumentParser(description='''Serve a Markdown folder as a web blog. The folder should have the following structure: @@ -29,12 +29,12 @@ The folder should have the following structure: parser.add_argument('--debug', dest='debug', required=False, action='store_true', default=False, help='Enable debug mode (default: False)') - return parser.parse_known_args(sys.argv[1:]) + return parser.parse_known_args(args) def run(): from .config import init_config - opts, _ = get_args() + opts, _ = get_args(sys.argv[1:]) config_file = os.path.join(opts.dir, 'config.yaml') init_config(config_file=config_file, content_dir=opts.dir) diff --git a/madblog/static/css/home.css b/madblog/static/css/home.css index ca62743..cb3b91b 100644 --- a/madblog/static/css/home.css +++ b/madblog/static/css/home.css @@ -41,7 +41,6 @@ main { .article { display: block; width: 100%; - max-height: 80%; box-shadow: 0 1px 3px 1px #ccc; overflow: hidden; text-overflow: ellipsis; @@ -54,12 +53,6 @@ main { border-radius: .5em; } -/* @media screen and (min-width: 767px) { */ -/* .article { */ -/* max-height: 55%; */ -/* } */ -/* } */ - @media screen and (min-width: 640px) and (max-width: 767px) { .article { padding: 0 calc(1em + 7vw); diff --git a/madblog/uwsgi.py b/madblog/uwsgi.py index 74e906f..fe29e2e 100644 --- a/madblog/uwsgi.py +++ b/madblog/uwsgi.py @@ -1,9 +1,14 @@ import os +import sys from .cli import get_args from .config import init_config -opts, _ = get_args() +arg_delim_idx = [ + i for i, arg in enumerate(sys.argv) if arg == 'madblog.uwsgi' +][0] + +opts, _ = get_args(sys.argv[arg_delim_idx+1:]) config_file = os.path.join(opts.dir, 'config.yaml') init_config(config_file=config_file, content_dir=opts.dir)