aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralex <alex@pdp7.net>2026-01-24 14:08:01 +0100
committeralexpdp7 <alex@corcoles.net>2026-01-24 13:08:56 +0000
commitf82d54a8cc80ee9b567ad37f824d5ed346e73dc7 (patch)
tree5131a572e5705198450deb78a5da66157e38f718
parent669048efa4514653bc7b5681d2ac00700b8dc05e (diff)
Draft migration
-rw-r--r--blog_v2/.gitignore1
-rw-r--r--blog_v2/.python-version1
-rw-r--r--blog_v2/README.md7
-rw-r--r--blog_v2/pyproject.toml16
-rw-r--r--blog_v2/src/blog/.gitignore1
-rw-r--r--blog_v2/src/blog/__init__.py31
-rw-r--r--blog_v2/uv.lock8
7 files changed, 65 insertions, 0 deletions
diff --git a/blog_v2/.gitignore b/blog_v2/.gitignore
new file mode 100644
index 0000000..eb5a316
--- /dev/null
+++ b/blog_v2/.gitignore
@@ -0,0 +1 @@
+target
diff --git a/blog_v2/.python-version b/blog_v2/.python-version
new file mode 100644
index 0000000..e4fba21
--- /dev/null
+++ b/blog_v2/.python-version
@@ -0,0 +1 @@
+3.12
diff --git a/blog_v2/README.md b/blog_v2/README.md
new file mode 100644
index 0000000..488454f
--- /dev/null
+++ b/blog_v2/README.md
@@ -0,0 +1,7 @@
+# `blog_v2`
+
+## Migration
+
+```
+rm -rf target ; uv run blog migrate ../blog/ target
+```
diff --git a/blog_v2/pyproject.toml b/blog_v2/pyproject.toml
new file mode 100644
index 0000000..e18b0fc
--- /dev/null
+++ b/blog_v2/pyproject.toml
@@ -0,0 +1,16 @@
+[project]
+name = "blog"
+version = "0.1.0"
+description = "Add your description here"
+authors = [
+ { name = "alex", email = "alex@pdp7.net" }
+]
+requires-python = ">=3.12"
+dependencies = []
+
+[project.scripts]
+blog = "blog:main"
+
+[build-system]
+requires = ["uv_build>=0.9.4,<0.10.0"]
+build-backend = "uv_build"
diff --git a/blog_v2/src/blog/.gitignore b/blog_v2/src/blog/.gitignore
new file mode 100644
index 0000000..bee8a64
--- /dev/null
+++ b/blog_v2/src/blog/.gitignore
@@ -0,0 +1 @@
+__pycache__
diff --git a/blog_v2/src/blog/__init__.py b/blog_v2/src/blog/__init__.py
new file mode 100644
index 0000000..03f4899
--- /dev/null
+++ b/blog_v2/src/blog/__init__.py
@@ -0,0 +1,31 @@
+import argparse
+import pathlib
+import shutil
+
+
+def migrate(from_: pathlib.Path, to: pathlib.Path):
+ to.mkdir(parents=True, exist_ok=False)
+ shutil.copytree(from_ / "content", to, dirs_exist_ok=True)
+ shutil.copytree(from_ / "static" / "about", to / "about", dirs_exist_ok=True)
+ laspelis = to / "laspelis"
+ laspelis.mkdir()
+ for lp in (from_ / "static" / "laspelis").glob("*"):
+ if not lp.is_dir():
+ print("skipping", lp)
+ continue
+ shutil.copy(lp / "mail", laspelis / f"{lp.name}.mail")
+ shutil.copy(lp / "index.gmi", laspelis / f"{lp.name}.gmi")
+
+
+def main() -> None:
+ parser = argparse.ArgumentParser()
+ subparsers = parser.add_subparsers(required=True)
+
+ subparser = subparsers.add_parser("migrate")
+ subparser.add_argument("from_", type=pathlib.Path)
+ subparser.add_argument("to", type=pathlib.Path)
+ subparser.set_defaults(command=migrate)
+
+ args = vars(parser.parse_args())
+ command = args.pop("command")
+ command(**args)
diff --git a/blog_v2/uv.lock b/blog_v2/uv.lock
new file mode 100644
index 0000000..2e43101
--- /dev/null
+++ b/blog_v2/uv.lock
@@ -0,0 +1,8 @@
+version = 1
+revision = 3
+requires-python = ">=3.12"
+
+[[package]]
+name = "blog"
+version = "0.1.0"
+source = { editable = "." }