commit 135c48b2dea5763feabb47606f71ebd713d6567a from: Bradley Taunt date: Wed Aug 14 13:08:10 2024 UTC Switch over to wruby, include new TUI browsers, extras page commit - 666a32a200354846aef1c87046dd213ad17868d9 commit + 135c48b2dea5763feabb47606f71ebd713d6567a blob - c762838b384645e9089fdde04789261559dbb61a blob + 3b25043d973f7f9d0ad7d185cf90409785702cc8 --- .build.yml +++ .build.yml @@ -1,8 +1,8 @@ image: alpine/latest oauth: pages.sr.ht/PAGES:RW packages: -- rsync -- coreutils +- ruby +- ruby-dev - go - hut environment: @@ -10,16 +10,13 @@ site: jsfree.org sources: - https://git.sr.ht/~bt/jsfree.org tasks: -- install-smu: | - git clone https://git.sr.ht/~bt/smu - cd smu - sudo make - sudo make install +- install-gems: | + sudo gem install bundler 'kramdown:2.4.0' 'rss:0.3.0' - build: | - cd jsfree.org - make build + cd wruby + sudo make build - package: | cd jsfree.org/build tar -cvz . > ../../site.tar.gz - upload: | - hut pages publish -d jsfree.org site.tar.gz \ No newline at end of file + hut pages publish -d jsfree.org site.tar.gz blob - /dev/null blob + 619b537668489eba5ff985e81afa2c1228281818 (mode 644) --- /dev/null +++ .ruby-version @@ -0,0 +1 @@ +3.3.3 blob - b16a580d4287ec6d562703ab8d5de8619a7ca506 blob + 9d7e5a1fcd3c1f8b86a191e8dd4b0f3ae227ac36 --- Makefile +++ Makefile @@ -1,13 +1,8 @@ build: - sh ./barf - rsync -r public/ build/public + rm -rf build && mkdir build + ruby wruby.rb clean: rm -rf build/* -watch: - while true; do \ - ls -d .git/* * posts/* pages/* header.html | entr -cd make ;\ - done - -.PHONY: build clean watch +.PHONY: build clean blob - 4b065492862b66161543d02d8c914165bbdc3fe8 blob + 26b9e260b25e708206046035f39ae87129ebcc2c --- README.md +++ README.md @@ -5,7 +5,9 @@ The main website and project for jsfree.org [jsfree.org](https://jsfree.org) -contributing +Built with [wruby](https://wruby.btxx.org) + +Contributing ------------ -Submit changes, patches or suggestions via email [here](mailto:jsfree@patches.btxx.org) +Submit changes, patches or suggestions [here](https://lists.sr.ht/~bt/jsfree-devel) blob - e027fc052c2394db6f8d29a7af7b37e90accf18f (mode 755) blob + /dev/null --- barf +++ /dev/null @@ -1,158 +0,0 @@ -#!/bin/sh - -domain="https://jsfree.org" - -# Check the operating system -os_name=$(uname -s) - -if [ "$os_name" = "OpenBSD" ]; then - alias sed=gsed - alias date=gdate - alias rsync=openrsync -elif [ "$os_name" = "Darwin" ]; then - alias sed=gsed - alias date=gdate -fi - -set -eu -MARKDOWN=smu -IFS=' ' - -# Create tab separated file with filename, title, creation date, last update -index_tsv() { - for f in "$1"/*.md - do - title=$(sed -n '/^# /{s/# //p; q}' "$f") - printf '%s\t%s\t%s\t%s\n' "$f" "${title:="No Title"}" - done -} - -index_html() { - # Print header - title=$(sed -n '/^# /{s/# //p; q}' index.md) - sed "s/{{TITLE}}/$title/" header.html - - # Intro text - $MARKDOWN index.md - - echo "" - - # Print footer after post list - cat footer.html -} - -atom_xml() { - uri=$(sed -rn '/atom.xml/ s/.*href="([^"]*)".*/\1/ p' header.html) - first_commit_date=$(git log --pretty='format:%ai' . | cut -d ' ' -f1 | tail -1) - - cat < - - $(sed -n '/^# /{s/# //p; q}' index.md) - - $(date +%FT%TZ) - - $(git config user.name) - - $domain,$first_commit_date:default-atom-feed/ -EOF - - while read -r f title created; do - - content=$($MARKDOWN "$f" | sed 's/&/\&/g; s//\>/g; s/"/\"/g; s/'"'"'/\'/g') - post_link=$(echo "$f" | sed -E 's|posts/(.*).md|\1|') - basic_date=$(echo $(head -3 "$f" | tail -1)) - published_date=$(date -d $basic_date -u +%Y-%m-%dT10:%M:%SZ) - - cat < - $title - $content - - $domain/$post_link - $published_date - $published_date - -EOF - done < "$1" - - echo '' -} - -rss_xml() { - uri=$(sed -rn '/rss.xml/ s/.*href="([^"]*)".*/\1/ p' header.html) - first_commit_date=$(git log --pretty='format:%ai' . | cut -d ' ' -f1 | tail -1) - - cat < - - - $(sed -n '/^# /{s/# //p; q}' index.md) - $domain/rss.xml - Feed description here - $(date -u +"%a, %d %b %Y %H:%M:%S %z") - $(date -u +"%a, %d %b %Y %H:%M:%S %z") - Custom RSS Generator - 1800 -EOF - - while read -r f title created; do - content=$($MARKDOWN "$f" | sed 's/&/\&/g; s//\>/g; s/"/\"/g; s/'"'"'/\'/g') - post_link=$(echo "$f" | sed -E 's|posts/(.*).md|\1|') - basic_date=$(echo $(head -3 "$f" | tail -1)) - published_date=$(date -d "$basic_date" -u +"%a, %d %b %Y %H:%M:%S %z") - - cat < - $title - $content - $domain/$post_link - $domain/$post_link - $published_date - -EOF - done < "$1" - - echo '' - echo '' -} - -write_page() { - filename=$1 - directory=$(echo $(basename "$filename" .md)) - $(mkdir -p build/$directory) - target=$(echo "$filename" | sed -r 's|\w+/(.*).md|build/\1/index.html|') - created=$(echo $(head -3 "$filename" | tail -1)) - title=$2 - - $MARKDOWN "$filename" | \ - cat header.html - |\ - sed "s|{{TITLE}}|$title|" \ - > "$target" && cat footer.html >> "$target" -} - -rm -rf build && mkdir build - -# Blog posts -index_tsv posts | sort -rt " " -k 3 > build/posts.tsv -index_html build/posts.tsv > build/index.html -atom_xml build/posts.tsv > build/atom.xml -rss_xml build/posts.tsv > build/rss.xml -while read -r f title created; do - write_page "$f" "$title" "$created" -done < build/posts.tsv - -# Pages -index_tsv pages > build/pages.tsv -while read -r f title created; do - write_page "$f" "$title" "$created" -done < build/pages.tsv blob - 894338a2baf5b6614095f9feeabc339a8e0e69db blob + 2c8db8743112ada2016adc67f5e3b8a9c34a3c30 --- footer.html +++ footer.html @@ -1,7 +1,7 @@