From 2696772df0873f2d10c51e0f26906cee2c659d09 Mon Sep 17 00:00:00 2001 From: AcipenserSturio Date: Tue, 20 Aug 2024 21:07:39 +0500 Subject: [PATCH] ci: move to bin Clean up root folder --- .github/workflows/main.yml | 4 +++- .gitignore | 2 +- .gitlab-ci.yml => bin/.gitlab-ci.yml | 3 +++ Makefile => bin/Makefile | 21 +++++++++++---------- simplify.sh => bin/simplify.sh | 3 +++ textindex.sh => bin/textindex.sh | 2 ++ 6 files changed, 23 insertions(+), 12 deletions(-) rename .gitlab-ci.yml => bin/.gitlab-ci.yml (97%) rename Makefile => bin/Makefile (62%) rename simplify.sh => bin/simplify.sh (94%) rename textindex.sh => bin/textindex.sh (94%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6994bba..85c9c65 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,9 @@ jobs: - name: cd repo run: cd ${{ github.workspace }} - name: build - run: make + run: | + cd bin + make - name: add custom domain run: echo "lipu-sona.pona.la" > public/CNAME - name: deploy diff --git a/.gitignore b/.gitignore index 9ccae31..032bf05 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ blogdates.txt Makefile.cfg upload.name -out/ +public/ diff --git a/.gitlab-ci.yml b/bin/.gitlab-ci.yml similarity index 97% rename from .gitlab-ci.yml rename to bin/.gitlab-ci.yml index d5a30a0..cb89160 100644 --- a/.gitlab-ci.yml +++ b/bin/.gitlab-ci.yml @@ -1,4 +1,7 @@ # The base image is Alpine Linux, because it's small and awesome + +# Appears to be in disuse. + image: alpine:latest stages: # List of stages for jobs, and their order of execution diff --git a/Makefile b/bin/Makefile similarity index 62% rename from Makefile rename to bin/Makefile index 27085c4..a2523aa 100644 --- a/Makefile +++ b/bin/Makefile @@ -1,9 +1,10 @@ -include Makefile.cfg -OUTDIR=public -PAGEDIR=pages -SRCDIR=src -TPLDIR=tpl +OUTDIR=../public +PAGEDIR=../pages +SRCDIR=../src +TPLDIR=../templates +STATICDIR=../static ifndef THEME THEME=theme @@ -20,9 +21,9 @@ PAGES_HTML = $(patsubst $(PAGEDIR)/%.md,$(OUTDIR)/%.html,$(_PAGES)) _DIRECTORIES = $(shell find $(PAGEDIR)/* -type d) DIRECTORIES = $(patsubst $(PAGEDIR)/, $(OUTDIR)/, $(_PAGES)) -_STATIC_FILES = $(shell find -L static/ -type f -name \* | grep -v \\.h$) -_STATIC_HEADERS = $(shell find -L static/ -type f -name \*\\.h) -OUT_STATIC = $(patsubst static/%,public/%,$(_STATIC_FILES)) $(patsubst static/%.h,public/%,$(_STATIC_HEADERS)) +_STATIC_FILES = $(shell find -L $(STATICDIR)/ -type f -name \* | grep -v \\.h$) +_STATIC_HEADERS = $(shell find -L $(STATICDIR)/ -type f -name \*\\.h) +OUT_STATIC = $(patsubst $(STATICDIR)/%,$(OUTDIR)/%,$(_STATIC_FILES)) $(patsubst $(STATICDIR)/%.h,$(OUTDIR)/%,$(_STATIC_HEADERS)) .SUFFIXES: .PHONY: all upload @@ -36,13 +37,13 @@ $(OUTDIR)/%.html: $(PAGEDIR)/%.md $(TPLDIR)/default.tpl @mkdir -p $(@D) $(THEME) $(THEME_FLAGS) -t $(TPLDIR)/default.tpl -p $(patsubst $(OUTDIR)/%,%,$@) -o $@ $< -$(OUTDIR)/%: static/%.h +$(OUTDIR)/%: $(STATICDIR)/%.h @mkdir -p $(@D) cpp -E -P -o $@ $< -$(OUTDIR)/%: static/% +$(OUTDIR)/%: $(STATICDIR)/% @mkdir -p $(@D) cp -r $< $@ clean: - rm -rf public/* + rm -rf $(OUTDIR)/* diff --git a/simplify.sh b/bin/simplify.sh similarity index 94% rename from simplify.sh rename to bin/simplify.sh index 58de102..eea0159 100755 --- a/simplify.sh +++ b/bin/simplify.sh @@ -1,4 +1,7 @@ #!/bin/sh + +# Appears to be in disuse. + perl -0pe 's/
(.*?)<\/div>/
\1<\/td><\/tr><\/tbody><\/table>/gs' | \ perl -0pe 's/
(.*?)<\/div>/
\1<\/td><\/tr><\/tbody><\/table>/gs' | \ perl -0pe 's/
(.*?)<\/div>/
\1<\/td><\/tr><\/tbody><\/table>/gs' diff --git a/textindex.sh b/bin/textindex.sh similarity index 94% rename from textindex.sh rename to bin/textindex.sh index bde5f92..c4ee531 100755 --- a/textindex.sh +++ b/bin/textindex.sh @@ -1,5 +1,7 @@ #!/bin/bash +# Appears to be in disuse. + DCMODE=0 while getopts d name