Forum integration: Flarum extension, local test stack, embedded comments
- forum/extension: oc:import command (archived comments -> one thread per machine) and embed styling - forum/docker: local Flarum 2 test stack - site: optional params.forum.url adds a Forum menu entry and shows the machine thread in the Comments tab Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YDRjtmAiNpo5mK5N3d7QwZ
This commit is contained in:
@@ -7,10 +7,10 @@ PAGEFIND ?= npx -y pagefind@1
|
||||
DEPLOY_DIR ?= /run/user/$(shell id -u)/gvfs/smb-share:server=barbel-lescar,share=web/oldcomputers
|
||||
DEPLOY_URL ?= https://barbel.synology.me/oldcomputers/
|
||||
|
||||
.PHONY: content build check serve deploy post
|
||||
.PHONY: content build check serve deploy post forum-up forum-import forum-down
|
||||
|
||||
content: ## regenerate content/ and static/media/ from the extraction repo
|
||||
python3 $(OC)/scripts/05_hugo.py --target $(CURDIR)
|
||||
python3 $(OC)/scripts/05_hugo.py --target $(CURDIR) $(if $(wildcard data/forum.json),--forum)
|
||||
|
||||
build: ## build the site and its search index into $(BUILD)/
|
||||
rm -rf $(BUILD)
|
||||
@@ -32,3 +32,17 @@ deploy: check ## build, check, and copy $(BUILD)/ to DEPLOY_DIR (served at DEPL
|
||||
mkdir -p "$(DEPLOY_DIR)"
|
||||
rsync -r --size-only --info=stats1 $(BUILD)/media/ "$(DEPLOY_DIR)/media/"
|
||||
rsync -rc --delete --exclude=/media/ --info=stats1 $(BUILD)/ "$(DEPLOY_DIR)/"
|
||||
|
||||
# --- local test forum (Flarum in Docker, see forum/README.md) ---
|
||||
FORUM = docker compose -f forum/docker-compose.yml
|
||||
SITE_URL ?= http://localhost:1313
|
||||
|
||||
forum-up: ## start the test forum on http://localhost:8081 (admin / adminadmin)
|
||||
$(FORUM) up -d --build
|
||||
|
||||
forum-import: ## export the archived comments and import them into the test forum
|
||||
python3 $(OC)/scripts/06_forum.py --target $(CURDIR)
|
||||
$(FORUM) exec -T flarum php flarum oc:import /import/machines.json --site-url=$(SITE_URL) --map=/import/forum.json
|
||||
|
||||
forum-down: ## stop the test forum (forum-db volume keeps its data)
|
||||
$(FORUM) down
|
||||
|
||||
Reference in New Issue
Block a user