Comments on news posts: one forum discussion per post
oc:pages command in the forum extension, tools/forum_sync.py and 'make forum-sync' (run by deploy) keep data/forum_pages.json up to date; post pages end with their discussion. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YDRjtmAiNpo5mK5N3d7QwZ
This commit is contained in:
@@ -6,8 +6,13 @@ PAGEFIND ?= npx -y pagefind@1
|
||||
# test server: the web share of barbel-lescar, mounted from the file manager (smb://barbel-lescar/web)
|
||||
DEPLOY_DIR ?= /run/user/$(shell id -u)/gvfs/smb-share:server=barbel-lescar,share=web/oldcomputers
|
||||
DEPLOY_URL ?= https://barbel.synology.me/oldcomputers/
|
||||
# forum on the server (comment discussions of the news posts, see forum-sync): FORUM_RUN runs a
|
||||
# shell line where the forum lives; empty = no forum, deploy then skips the sync
|
||||
FORUM_RUN ?= ssh -p 27 yannick@192.168.1.98
|
||||
FORUM_DIR ?= /volume2/web/oldcomputers-forum
|
||||
FORUM_PHP ?= /usr/local/bin/php84 -d memory_limit=512M
|
||||
|
||||
.PHONY: content build check serve deploy post forum-up forum-import forum-down forum-bundle
|
||||
.PHONY: content build check serve deploy post forum-up forum-import forum-down forum-bundle forum-sync
|
||||
|
||||
content: ## regenerate content/ and static/media/ from the extraction repo
|
||||
python3 $(OC)/scripts/05_hugo.py --target $(CURDIR) $(if $(wildcard data/forum.json),--forum)
|
||||
@@ -27,7 +32,12 @@ post: ## new post: make post NAME=my-title, then edit content/post/<tod
|
||||
@test -n "$(NAME)" || { echo "usage: make post NAME=my-title"; exit 1; }
|
||||
hugo new content post/$(shell date +%F)-$(NAME).md
|
||||
|
||||
deploy: check ## build, check, and copy $(BUILD)/ to DEPLOY_DIR (served at DEPLOY_URL)
|
||||
forum-sync: ## create the forum discussion of each new news post (updates data/forum_pages.json)
|
||||
ifneq ($(strip $(FORUM_RUN)),)
|
||||
python3 tools/forum_sync.py --run '$(FORUM_RUN)' --dir '$(FORUM_DIR)' --php '$(FORUM_PHP)' --site-url '$(DEPLOY_URL)'
|
||||
endif
|
||||
|
||||
deploy: forum-sync check ## build, check, and copy $(BUILD)/ to DEPLOY_DIR (served at DEPLOY_URL)
|
||||
@test -d "$(dir $(DEPLOY_DIR))" || { echo "share not mounted: $(dir $(DEPLOY_DIR))"; exit 1; }
|
||||
mkdir -p "$(DEPLOY_DIR)"
|
||||
rsync -r --size-only --info=stats1 $(BUILD)/media/ "$(DEPLOY_DIR)/media/"
|
||||
|
||||
Reference in New Issue
Block a user