From d6ed2d71d576876001bac242a328d047ab7137a2 Mon Sep 17 00:00:00 2001 From: Bastian Venthur Date: Fri, 16 Jun 2023 09:55:17 +0200 Subject: [PATCH] small fixed to blag quickstart --- CHANGELOG.md | 4 ++++ README.md | 1 + blag/quickstart.py | 5 +++-- docs/blag.rst | 6 +++--- tests/test_quickstart.py | 4 ++++ 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5c0c19..35a1c1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,10 @@ * blag comes now with a simple yet good looking default theme that supports syntax highlighting and a light- and dark theme. +* apart from the generated configuration, `blag quickstart` will now also + create the initial directory structure, with the default template, the static + directory with the CSS files and the content directory with some initial + content to get the user started ## [1.5.0] - 2023-04-16 diff --git a/README.md b/README.md index 77848f4..3249765 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ blag is named after [the blag of the webcomic xkcd][blagxkcd]. ## Features * Write content in [Markdown][] +* Good looking default theme * Theming support using [Jinja2][] templates * Generation of Atom feeds for blog content * Fenced code blocks and syntax highlighting using [Pygments][] diff --git a/blag/quickstart.py b/blag/quickstart.py index 4d12af8..ac40112 100644 --- a/blag/quickstart.py +++ b/blag/quickstart.py @@ -61,8 +61,9 @@ def copy_default_theme() -> None: def quickstart(args: argparse.Namespace | None) -> None: """Quickstart. - This method asks the user some questions and generates a - configuration file that is needed in order to run blag. + This method asks the user some questions and generates a configuration file + that is needed in order to run blag. Additionally, it creates the content + and static directories with some initial content, to get the user started. Parameters ---------- diff --git a/docs/blag.rst b/docs/blag.rst index 47cd5ad..92239c9 100644 --- a/docs/blag.rst +++ b/docs/blag.rst @@ -13,7 +13,8 @@ Install blag from PyPI_ .. _pypi: https://pypi.org/project/blag/ -Run blag's quickstart command to create the configuration and templates needed +Run blag's quickstart command to create the configuration, templates and some +initial content. .. code-block:: sh @@ -23,7 +24,6 @@ Create some content .. code-block:: sh - $ mkdir content $ edit content/hello-world.md Generate the website @@ -121,7 +121,7 @@ Static Files Static files can be put into the ``content`` directory and will be copied over to the ``build`` directory as well. If you want better separation between -content and static files, you can create a ``static`` directory and put the +content and static files, you can use the ``static`` directory and put the files there. All files and directories found in the ``static`` directory will be copied over to ``build``. diff --git a/tests/test_quickstart.py b/tests/test_quickstart.py index 95b54c1..d2b1dff 100644 --- a/tests/test_quickstart.py +++ b/tests/test_quickstart.py @@ -33,8 +33,12 @@ def test_quickstart(cleandir: str, monkeypatch: MonkeyPatch) -> None: "archive.html", "article.html", "base.html", + "index.html", "page.html", "tag.html", "tags.html", ): assert os.path.exists(f'templates/{template}') + + for directory in "build", "content", "static": + assert os.path.exists(directory)