Adressen: Slug und Version im Pfad statt Parameter
Seite: /<slug>[/v<N>][/lauf|/buch|/lesen][/<Abschnitt>], Zurück-Taste je Abschnitt. API: /api/themen/<slug>/v<N>/… mit Version als Pflichtteil des Pfads; /api/topics entfällt. Slugs stehen in thema.json und werden beim Start nachgetragen. Unbekannte API-Pfade liefern 404 statt der Seite. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
3
Makefile
3
Makefile
@@ -55,6 +55,7 @@ pull:
|
||||
loeschen:
|
||||
@[ -n "$(TOPIC)" ] || { echo "TOPIC=<Name> angeben (optional V=<Nr>)"; exit 1; }
|
||||
@printf '%s auf dem Server und lokal unwiderruflich löschen? [j/N] ' "$(if $(V),Version $(V) von „$(TOPIC)“,Thema „$(TOPIC)“ mit allen Versionen)"; read a; [ "$$a" = "j" ]
|
||||
curl -fsS -X DELETE "$(URL)/api/topics/$$(python3 -c 'import sys,urllib.parse; print(urllib.parse.quote(sys.argv[1]))' "$(TOPIC)")$(if $(V),?v=$(V),)" && echo
|
||||
@slug=$$(curl -fsS "$(URL)/api/themen" | python3 -c 'import json,sys; n=sys.argv[1]; print(next(t["slug"] for t in json.load(sys.stdin) if t["name"]==n))' "$(TOPIC)") && \
|
||||
curl -fsS -X DELETE "$(URL)/api/themen/$$slug$(if $(V),/v$(V),)" && echo
|
||||
rm -rf "storage/$(TOPIC)$(if $(V),/v$(V),)"
|
||||
@echo "Gelöscht: $(TOPIC)$(if $(V), v$(V),)"
|
||||
|
||||
Reference in New Issue
Block a user