rewrite the project as a static site generator

this removes Flask, reworks a number of library methods accordingly, and
adds generators and build commands to process the instance directory
(largely unchanged, except config.py is now config.json) and spit out
files suitable to be served by a web server such as Nginx.

there are probably some rough edges here, but overall this works.

also note, as this is no longer server software on a network, the
license has changed from AGPLv3 to GPLv3, and the "or any later version"
allowance has been removed

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
This commit is contained in:
2025-03-12 10:28:38 -05:00
parent ed12272d4d
commit 7eb485c6ae
45 changed files with 1389 additions and 1587 deletions

30
tests/test_commands.py Normal file
View File

@@ -0,0 +1,30 @@
"""Test command line invocations.
SPDX-FileCopyrightText: © 2023 Brian S. Stephan <bss@incorporeal.org>
SPDX-License-Identifier: GPL-3.0-only
"""
import os
import tempfile
from subprocess import run
HERE = os.path.dirname(os.path.abspath(__file__))
def test_build():
"""Test some of the output of the core builder command."""
with tempfile.TemporaryDirectory() as tmpdir:
result = run(['incorporealcms-build', os.path.join(HERE, 'instance'), tmpdir],
capture_output=True, encoding='utf8')
assert "creating temporary directory" in result.stdout
assert "copying file" in result.stdout
assert "creating symlink" in result.stdout
assert "creating directory" in result.stdout
assert "renaming" in result.stdout
def test_build_error():
"""Test some of the output of the core builder command."""
result = run(['incorporealcms-build', os.path.join(HERE, 'instance'), os.path.join(HERE, 'test_markdown.py')],
capture_output=True, encoding='utf8')
assert "specified output path" in result.stderr
assert "exists as a file!" in result.stderr