From 62e6bab910297aa15d76eb735ce3dd9b5417e26e Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Thu, 13 Aug 2026 16:33:51 +0100 Subject: remove website/capsule content --- http/.gitignore | 9 - http/Makefile | 150 ------ http/bin/blog | 110 ----- http/bin/cut_longlog_meta | 34 -- http/bin/extract_longlog_meta | 34 -- http/bin/gmi2upphtml | 184 -------- http/bin/lmt | Bin 953744 -> 0 bytes http/bin/mkws | 72 --- http/blogs/blog | 1 - http/blogs/microlog | 1 - http/composer.json | 17 - http/composer.lock | 101 ---- http/config.mk | 7 - http/php/config.php | 62 --- http/php/db.php | 205 -------- http/php/mail.php | 35 -- http/pp/.gitignore | 2 - http/pp/LICENSE | 15 - http/pp/Makefile | 29 -- http/pp/README.md | 188 -------- http/pp/pp.1 | 46 -- http/pp/pp.c | 369 --------------- http/public/do/send_email.php | 124 ----- http/public/do/send_otp.php | 104 ----- http/public/do/verify_otp.php | 63 --- http/public/images | 1 - http/public/scripts/contact/actions.js | 60 --- http/public/scripts/contact/post-error-message.js | 34 -- http/public/scripts/contact/resend-otp.js | 31 -- http/public/scripts/contact/reset-resend-button.js | 32 -- http/public/scripts/contact/selectors.js | 25 - http/public/scripts/contact/submit-contact-form.js | 53 --- http/public/scripts/contact/submit-otp-form.js | 77 --- http/public/scripts/otp-form-wc.js | 68 --- http/share/components/formatted_date.upphtml | 4 - http/share/components/head.upphtml | 37 -- http/share/components/meta.upphtml | 11 - http/share/components/navbar.upphtml | 16 - http/share/components/otp-dialog.upphtml | 28 -- http/share/layouts/blog.layout.upphtml | 66 --- http/share/layouts/default.layout.upphtml | 20 - http/share/layouts/microlog.layout.upphtml | 51 -- http/share/layouts/trivial.layout.upphtml | 3 - http/share/man/man1/lmt.1 | 55 --- http/share/man/man1/mkws.1 | 91 ---- http/share/man/man1/pp.1 | 1 - http/src/blog.upphtml | 76 --- http/src/blog/rss.uppxml | 50 -- http/src/blog/subscribe.trivial.upphtml | 4 - http/src/contact.upphtml | 96 ---- http/src/css/base.uppcss | 515 --------------------- http/src/css/feed.uppcss | 45 -- http/src/css/hcard.uppcss | 57 --- http/src/css/otp.uppcss | 29 -- http/src/css/post.uppcss | 8 - http/src/css/reset.uppcss | 93 ---- http/src/error.upphtml | 14 - http/src/index.upphtml | 47 -- http/src/links/rss.trivial.upphtml | 4 - http/src/microlog.upphtml | 84 ---- http/src/microlog/rss.uppxml | 50 -- http/src/sitemap.uppxml | 21 - http/src/subscribe.upphtml | 91 ---- 63 files changed, 4010 deletions(-) delete mode 100644 http/.gitignore delete mode 100644 http/Makefile delete mode 100755 http/bin/blog delete mode 100755 http/bin/cut_longlog_meta delete mode 100755 http/bin/extract_longlog_meta delete mode 100755 http/bin/gmi2upphtml delete mode 100755 http/bin/lmt delete mode 100755 http/bin/mkws delete mode 120000 http/blogs/blog delete mode 120000 http/blogs/microlog delete mode 100644 http/composer.json delete mode 100644 http/composer.lock delete mode 100644 http/config.mk delete mode 100644 http/php/config.php delete mode 100644 http/php/db.php delete mode 100644 http/php/mail.php delete mode 100644 http/pp/.gitignore delete mode 100644 http/pp/LICENSE delete mode 100644 http/pp/Makefile delete mode 100644 http/pp/README.md delete mode 100644 http/pp/pp.1 delete mode 100644 http/pp/pp.c delete mode 100644 http/public/do/send_email.php delete mode 100644 http/public/do/send_otp.php delete mode 100644 http/public/do/verify_otp.php delete mode 120000 http/public/images delete mode 100644 http/public/scripts/contact/actions.js delete mode 100644 http/public/scripts/contact/post-error-message.js delete mode 100644 http/public/scripts/contact/resend-otp.js delete mode 100644 http/public/scripts/contact/reset-resend-button.js delete mode 100644 http/public/scripts/contact/selectors.js delete mode 100644 http/public/scripts/contact/submit-contact-form.js delete mode 100644 http/public/scripts/contact/submit-otp-form.js delete mode 100644 http/public/scripts/otp-form-wc.js delete mode 100644 http/share/components/formatted_date.upphtml delete mode 100644 http/share/components/head.upphtml delete mode 100644 http/share/components/meta.upphtml delete mode 100644 http/share/components/navbar.upphtml delete mode 100644 http/share/components/otp-dialog.upphtml delete mode 100644 http/share/layouts/blog.layout.upphtml delete mode 100644 http/share/layouts/default.layout.upphtml delete mode 100644 http/share/layouts/microlog.layout.upphtml delete mode 100644 http/share/layouts/trivial.layout.upphtml delete mode 100644 http/share/man/man1/lmt.1 delete mode 100644 http/share/man/man1/mkws.1 delete mode 120000 http/share/man/man1/pp.1 delete mode 100644 http/src/blog.upphtml delete mode 100644 http/src/blog/rss.uppxml delete mode 100644 http/src/blog/subscribe.trivial.upphtml delete mode 100644 http/src/contact.upphtml delete mode 100644 http/src/css/base.uppcss delete mode 100644 http/src/css/feed.uppcss delete mode 100644 http/src/css/hcard.uppcss delete mode 100644 http/src/css/otp.uppcss delete mode 100644 http/src/css/post.uppcss delete mode 100644 http/src/css/reset.uppcss delete mode 100644 http/src/error.upphtml delete mode 100644 http/src/index.upphtml delete mode 100644 http/src/links/rss.trivial.upphtml delete mode 100644 http/src/microlog.upphtml delete mode 100644 http/src/microlog/rss.uppxml delete mode 100644 http/src/sitemap.uppxml delete mode 100644 http/src/subscribe.upphtml (limited to 'http') diff --git a/http/.gitignore b/http/.gitignore deleted file mode 100644 index ab75dc7..0000000 --- a/http/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -out -vendor -src/microlog/*.microlog.upphtml -src/microlog/*.microlog.upphtml.args -src/blog/*.blog.upphtml -src/blog/*.blog.upphtml.args -bin/pp -share/man/man1/pp.1 -config.ini diff --git a/http/Makefile b/http/Makefile deleted file mode 100644 index 4c50da8..0000000 --- a/http/Makefile +++ /dev/null @@ -1,150 +0,0 @@ -include config.mk - - -############# -# VARIABLES # -############# - -src_files := $(filter-out %.args,$(wildcard src/*.upp*)) $(filter-out %.args,$(wildcard src/**/*.upp*)) -src_files_ext := $(suffix $(src_files)) -out_deps_ext := $(src_files_ext:.upp%=%) - -component_files := $(shell find -L share/components -type f) -layout_files := $(wildcard share/layouts/*.layout.upp*) -layouts := $(notdir $(basename $(basename $(layout_files)))) - -remove_all_layouts = $(call remove_layouts,$(layouts),$(1)) -remove_layouts = $(let first rest,$(1),$(call remove_layout,$(first),$(if $(rest),$(call remove_layouts,$(rest),$(2)),$(2)))) -remove_layout = $(subst .$(1).upp,.,$(2)) -out_deps := $(subst .upp,.,$(call remove_all_layouts,$(addprefix out/,$(src_files:src/%=%)))) -out_deps_without_src := $(filter-out $(out_deps),$(shell find -L out -type f)) -out_deps += $(out_deps_without_src) - -blogs := $(subst blogs/,,$(wildcard blogs/*)) - - -############# -# FUNCTIONS # -############# - -blog_post_target = src/$(blog)/%$(if $(BLOG_LAYOUT_$(blog)),.$(BLOG_LAYOUT_$(blog))).upphtml -blog_post_src = blogs/$(blog)/%.$(BLOG_EXT_$(blog)) $$(wildcard bin/*) -blog_src = $(patsubst \ - blogs/$(blog)/%.$(BLOG_EXT_$(blog)),\ - src/$(blog)/%$(if $(BLOG_LAYOUT_$(blog)),.$(BLOG_LAYOUT_$(blog))).upphtml,\ - $(shell find -L "blogs/$(blog)" -type f -and -name *.$(BLOG_EXT_$(blog)))) -blog_src_without_post_src = $(filter-out $(blog_src),$(shell find -L "src/$(blog)" -type f -and -name *.$(BLOG_LAYOUT_$(blog)).upphtml)) -default_layout_file = $(if \ - $(shell [ -f "share/layouts/default.layout.$(ext)" ] && echo 1),\ - share/layouts/default.layout.$(ext)) -layout_file = $(if $(layout),share/layouts/$(layout).layout.upp$(ext),$(default_layout_file)) - -define out_rule = -out/%.$(ext): src/%$(if $(layout),.$(layout)).upp$(ext) $(layout_file) $(component_files) bin/pp - ./bin/mkws https://joeac.net "$$$$(realpath $$<)" -endef - -define blog_rss_feed_rule = -out/$(blog)/rss.xml: src/$(blog)/rss.uppxml $(blog_src) $(wildcard bin/*) bin/pp - ./bin/mkws https://joeac.net "$$(realpath src/$(blog)/rss.uppxml)" -endef - -define blog_rule = -.PHONY: $(blog) -$(blog): $(blog_src_without_post_src) $(blog_src) out/$(blog).html -endef - -define blog_post_rule = -$(blog_post_target): $(blog_post_src) $(let ext,html,$(layout_file) $(component_files)) - ./bin/blog \ - -i $(blog) \ - $(if $(BLOG_LAYOUT_$(blog)),-l $(BLOG_LAYOUT_$(blog))) \ - $(BLOG_FLAGS_$(blog)) \ - -f $$*.$(BLOG_EXT_$(blog)) -endef - -define blog_index_rule = -out/$(blog).html: src/$(blog).upphtml $(blog_src) $(wildcard bin/*) bin/pp - ./bin/mkws https://joeac.net "$$(realpath src/$(blog).upphtml)" -endef - -define prune_blog_src_file_rule = -$(let rel_basename,$(patsubst src/$(blog)/%.$(BLOG_LAYOUT_$(blog)).upphtml,%,$(file)), -blogs/$(blog)/$(rel_basename).$(BLOG_EXT_$(blog)): - rm $(file) -) -endef - -define prune_blog_out_file_rule = -$(let rel_basename,$(patsubst src/$(blog)/%.$(BLOG_LAYOUT_$(blog)).upphtml,%,$(file)), -$(file): - rm out/$(rel_basename).html -) -endef - -define prune_out_file_rule = -$(let orig_ext,$(patsubst .%,%,$(suffix $(file))), -$(let ext,$(patsubst upp%,%,$(orig_ext)), -$(let rel_basename,$(patsubst out/%.$(orig_ext),%,$(file)), -$(let src_file,src/$(rel_basename).upp$(ext), -$(let src_files_with_layouts,$(foreach layout,$(layouts),src/$(rel_basename).$(layout).upp$(ext)), -$(let public_file,public/$(rel_basename).$(orig_ext), -$(src_file) $(src_files_with_layouts) $(public_file): - rm $(file) -)))))) -endef - - -######### -# RULES # -######### - -all: $(blogs) public out vendor - $(MAKE) out # if blog posts have been pruned, outfiles must be re-calculated - -share/man/man1/pp.1: - cp pp/pp.1 share/man/man1/pp.1 - -.PHONY: out -out: $(out_deps) - -bin/pp: - $(MAKE) --directory=pp && chmod +x pp/pp && cp pp/pp bin/pp - -$(foreach ext,$(sort $(out_deps_ext)),\ - $(eval $(out_rule))) -$(foreach layout,$(layouts),\ - $(foreach ext,$(sort $(out_deps_ext)),\ - $(eval $(out_rule)))) - -$(foreach blog,$(blogs),$(eval $(blog_rule))) -$(foreach blog,$(blogs),$(eval $(blog_index_rule))) - -$(foreach blog,$(blogs),\ - $(foreach layout,$(layouts),\ - $(eval $(call blog_post_rule,$(blog),$(layout))))) -$(foreach blog,$(blogs),\ - $(eval $(call blog_post_rule,$(blog),))) - -$(foreach blog,$(blogs),$(eval $(blog_rss_feed_rule))) - -.PHONY: public -public: $(subst public/,out/,$(shell find -L public/ -type f)) - -out/%: public/% - mkdir -p $(dir $@) && cp $< $@ - -$(foreach file,$(out_deps_without_src),$(eval $(prune_out_file_rule))) -$(foreach blog,$(blogs),$(foreach file,$(blog_src_without_post_src),$(eval $(prune_blog_src_file_rule)))) - -vendor: composer.json composer.lock - composer install - -.PHONY: clean -clean: - rm -rf \ - vendor \ - out \ - $(foreach blog,$(blogs), \ - $(foreach ext,upphtml upphtml.args,\ - src/$(blog)/*$(if $(BLOG_LAYOUT_$(blog)),.$(BLOG_LAYOUT_$(blog))).$(ext))) diff --git a/http/bin/blog b/http/bin/blog deleted file mode 100755 index 46be82f..0000000 --- a/http/bin/blog +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/sh -e -export PATH="$(dirname $(realpath $0)):$PATH" -export BLOGS="$(realpath blogs)" -export SRC="$(realpath src)" -export LAYOUTS="$(realpath share/layouts)" - -usage() -{ - >&2 cat << USAGE -usage: blog -i LOG [-p POSTPROCESS_CMD] [-a EXTRACT_ARGS_CMD] [-l LAYOUT] [-t] [-f FILE_PATTERN] - -options: - - -a EXTRACT_ARGS_CMD - If provided, a shell command to extract arguments to the layout from the - source files. The shell will be provided with a variable, POST_TITLE. - - -f FILE - If provided, a pattern for the files to process. Default: *. - - -i LOG - The name of the source directory under \$BLOGS where log posts live. - - -l LAYOUT - If provided, the layout under \$LAYOUTS to use for the generated - upphtml files. If not provided, uses the default layout. - - -p POSTPROCESS_CMD - If provided, a shell command to post-process the source files into - upphtml. The shell will be provided with a variable, POST_TITLE. - - -t - If enabled, use filenames as post titles -USAGE -} - -extract_args_cmd="head -n 0 | echo \"POST_TITLE=\\\"\${POST_TITLE}\\\"\"" -file_pattern="*" -log_name="" -layout_name="default" -postprocess_cmd="echo" -use_filenames_for_titles=0 - -while getopts "a:f:i:l:p:t" opt -do - case $opt in - a) - extract_args_cmd="$OPTARG" - ;; - f) - file_pattern="$OPTARG" - ;; - i) - log_name="$OPTARG" - ;; - l) - layout_name="$OPTARG" - ;; - p) - postprocess_cmd="$OPTARG" - ;; - t) - use_filenames_for_titles=1 - ;; - esac -done - -if [ -z "${log_name}" ] -then - usage - exit 1 -fi - -if ! [ -d "${BLOGS}/${log_name}" ] -then - >&2 echo "there is no directory '${input_log}' under ${BLOGS}. options: $(ls common)" - usage - exit 1 -fi - -layout="${LAYOUTS}/${layout_name}.layout.upphtml" -if [ "${layout_name}" = "default" ] -then - layout_ext="" -else - layout_ext=".${layout_name}" -fi -if ! [ -f "${layout}" ] -then - echo >&2 "Warning: no layout found at $(basename "${LAYOUTS}")/${layout_name}.layout.upphtml" -fi - -mkdir -p "${SRC}/${log_name}" - -for entry in $(find -L "${BLOGS}/${log_name}" -type f -name "${file_pattern}") -do - basename="$(basename "$entry")" - name="${basename%\.*}" - dest="${SRC}/${log_name}/${name}${layout_ext}.upphtml" - if [ $use_filenames_for_titles -eq 1 ] - then - export POST_TITLE="$name" - cat "$entry" | eval "${postprocess_cmd}" > "$dest" - else - export POST_TITLE="$(grep -e "^# " -m 1 "$entry" | cut -c3-)" - cat "$entry" | grep -e "^# " -v | eval "$postprocess_cmd" > "$dest" - fi - cat "$entry" | eval "$extract_args_cmd" > "${dest}.args" - echo "Processed ${entry#$(dirname ${BLOGS})/} to ${dest#$(dirname ${SRC})/}" -done diff --git a/http/bin/cut_longlog_meta b/http/bin/cut_longlog_meta deleted file mode 100755 index 914f455..0000000 --- a/http/bin/cut_longlog_meta +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -e - -meta="" -read_published_on=0 -while read line -do - meta="${meta} -${line}" - if [ "$(echo "$line" | cut -c1-14)" = "Published on: " ] - then - read_published_on=1 - break - fi -done - -if [ "$read_published_on" -eq 0 ] -then - echo "$meta" - exit 0 -fi - -read line -if [ "$(echo "$line" | cut -c1-14)" = "Updated: " ] -then - meta="${meta} -${line}" -else - echo "$line" -fi - -while read line -do - echo "$line" -done diff --git a/http/bin/extract_longlog_meta b/http/bin/extract_longlog_meta deleted file mode 100755 index 054c994..0000000 --- a/http/bin/extract_longlog_meta +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -e - -POST_TITLE="${POST_TITLE:-}" -DATE_PUBLISHED="" -DATE_UPDATED="" - -while read line -do - if [ "$(echo "$line" | cut -c1-2)" = "# " ] - then - POST_TITLE="$(echo "$line" | cut -c3-)" - elif [ "$(echo "$line" | cut -c1-14)" = "Published on: " ] - then - DATE_PUBLISHED="$(date --date="$(echo "$line" | cut -c15-)" +%Y-%m-%d)" - elif [ "$(echo "$line" | cut -c1-12)" = "Updated on: " ] - then - DATE_UPDATED="$(date --date="$(echo "$line" | cut -c13-)" +%Y-%m-%d)" - fi -done - -if [ -n "$POST_TITLE" ] -then - echo "POST_TITLE=\"${POST_TITLE}\"" -fi - -if [ -n "$DATE_PUBLISHED" ] -then - echo "DATE_PUBLISHED=\"${DATE_PUBLISHED}\"" -fi - -if [ -n "$DATE_UPDATED" ] -then - echo "DATE_UPDATED=\"${DATE_UPDATED}\"" -fi diff --git a/http/bin/gmi2upphtml b/http/bin/gmi2upphtml deleted file mode 100755 index 1631037..0000000 --- a/http/bin/gmi2upphtml +++ /dev/null @@ -1,184 +0,0 @@ -#!/bin/sh -e - -post_title="${POST_TITLE:-}" - -is_in_list=0 -is_in_link_block=0 -is_in_preformatted_block=0 -is_in_blockquote=0 - -if_in_list_then_close() -{ - if [ $is_in_list -ne 0 ] - then - echo "" - is_in_list=0 - fi -} - -if_in_link_block_then_close() -{ - if [ $is_in_link_block -ne 0 ] - then - echo "

" - is_in_link_block=0 - fi -} - -if_in_preformatted_block_then_close() -{ - if [ $is_in_preformatted_block -ne 0 ] - then - echo "" - is_in_preformatted_block=0 - fi -} - -if_in_blockquote_then_close() -{ - if [ $is_in_blockquote -ne 0 ] - then - echo "" - is_in_blockquote=0 - fi -} - -close_all_open_blocks() -{ - if_in_list_then_close - if_in_link_block_then_close - if_in_preformatted_block_then_close - if_in_blockquote_then_close -} - -escape_upphtml() -{ - echo "$1" \ - | sed "s/&/\\&/g" \ - | sed "s//\\>/g" \ - | sed "s/\"/\\"/g" \ - | sed "s/'/\\'/g" \ - | sed "s/\`/\\`/g" \ - | sed "s/\\\$/\\\\\$/g" -} - -close_all_open_blocks_except() -{ - except="$1" - if [ "$except" != "list" ] - then - if_in_list_then_close - fi - if [ "$except" != "link" ] - then - if_in_link_block_then_close - fi - if [ "$except" != "pre" ] - then - if_in_preformatted_block_then_close - fi - if [ "$except" != "blockquote" ] - then - if_in_blockquote_then_close - fi -} - -if [ -z "$post_title" ] -then - read first_line - if [ "$(echo "$first_line" | cut -c1-2)" != "# " ] - then - echo >&2 "Error: no [post_title] argument provided and no top-level heading at top of the document." - exit 1 - fi - post_title="${first_line### }" -fi - -echo "#! -export TITLE=\"${post_title} | joeac's blog\" -export DESCRIPTION=\"${post_title} | joeac's blog\" -pp \"\${SHARE}\"/components/meta.upphtml -#!" - -while read line -do - if [ "$(echo $line | sed "s/[[:space:]]//g")" = "" ] - then - continue - fi - - if [ "$(echo $line | cut -c1)" = "#" ] - then - title="$(escape_upphtml "${line#*# }")" - heading="${line%%$title}" - heading="${heading%% }" - heading_level="${#heading}" - if [ "$(echo "$line" | cut -c$(( $heading_level + 1 )) )" = " " ] - then - close_all_open_blocks - echo "${title}" - continue - fi - fi - - if [ "$(echo "$line" | cut -c1-2)" = "=>" ] - then - close_all_open_blocks_except link - href="$(escape_upphtml "$(echo "$line" | sed "s/^=>[[:space:]]\+//" | sed "s/[[:space:]]\+.*//")")" - title="$(escape_upphtml "${line#=> *${href}}")" - title="${title:-${href}}" - if [ $is_in_link_block -eq 0 ] - then - echo "

" - else - echo "
" - fi - is_in_link_block=1 - echo "=> ${title}" - continue - fi - - if [ "$( echo "$line" | cut -c1-2)" = "* " ] - then - close_all_open_blocks_except list - if [ $is_in_list -eq 0 ] - then - echo "