diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 709140f..b092559 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -16,10 +16,8 @@ jobs: run: | zypper refresh zypper --non-interactive update - zypper --non-interactive install git libxslt linkchecker lowdown make python3 sblg nodejs npm + zypper --non-interactive install git libxslt linkchecker lowdown make python3 sblg nodejs npm curl - uses: actions/checkout@v6 - with: - submodules: recursive - name: build site run: make - name: package site diff --git a/.gitignore b/.gitignore index 984bf4c..e95fe43 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,14 @@ images/.DS_Store node_modules blog_sources/public/ blog_sources/themes/ + +# Downloaded upon make +pagesource/profanity.doap +pagesource/xeplist/xeplist.xml + +# Generated site build artifacts +/*.html +/blog/ +/contributors/ +/site/ +xeps.xml diff --git a/.gitmodules b/.gitmodules index 3c96df8..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +0,0 @@ -[submodule "blog_source"] - path = blog_source - url = https://github.com/profanity-im/blog -[submodule "pagesource/doap"] - path = pagesource/doap - url = https://github.com/profanity-im/profanity.git diff --git a/Makefile b/Makefile index f67ce77..aa213bf 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ SBLG = sblg XSLTPROC = xsltproc LOWDOWN = lowdown +CURL = curl +DOAP_URL = https://raw.githubusercontent.com/profanity-im/profanity/refs/heads/master/profanity.doap +XEPLIST_URL = https://xmpp.org/extensions/xeplist.xml PREFIX = $(PWD)/site BLOG_SRC_TOP_DIR = blogsource/content BLOG_POST_SRC_DIR = $(BLOG_SRC_TOP_DIR)/post @@ -17,23 +20,24 @@ PAGES_MD_TO_XML = $(subst $(PAGES_SRC_DIR)/,,$(PAGES_SRC:.md=.xml)) PAGES_XML = $(PAGES_MD_TO_XML) PAGES_XML += xeps.xml PAGES = $(PAGES_XML:.xml=.html) -REDIRECTS_DIR = pageredirects -REDIRECTS_SRC = $(wildcard $(REDIRECTS_DIR)/*.html) -REDIRECTS = $(subst $(REDIRECTS_DIR)/,,$(REDIRECTS_SRC)) VERSION = $(shell cat profanity_version.txt) TAR_XZ_SHA256 = $(shell sha256sum tarballs/profanity-$(VERSION).tar.xz | cut -d' ' -f1) ZIP_SHA256 = $(shell sha256sum tarballs/profanity-$(VERSION).zip | cut -d' ' -f1) all: index.html $(PAGES) themegallery.html $(BLOG_POSTS_OUT) $(BLOG_POST_OUT_DIR)/atom.xml \ - $(BLOG_POST_OUT_DIR)/index.html $(CONTRIBUTORS_OUT) $(CONTRIBUTORS_OUT_DIR)/index.html $(REDIRECTS) + $(BLOG_POST_OUT_TOP_DIR)/index.xml $(BLOG_POST_OUT_DIR)/index.html $(CONTRIBUTORS_OUT) $(CONTRIBUTORS_OUT_DIR)/index.html install: index.html $(PAGES) themegallery.html $(BLOG_POSTS_OUT) $(BLOG_POST_OUT_DIR)/atom.xml \ - $(BLOG_POST_OUT_DIR)/index.html $(CONTRIBUTORS_OUT) $(CONTRIBUTORS_OUT_DIR)/index.html $(REDIRECTS) + $(BLOG_POST_OUT_TOP_DIR)/index.xml $(BLOG_POST_OUT_DIR)/index.html $(CONTRIBUTORS_OUT) $(CONTRIBUTORS_OUT_DIR)/index.html mkdir -p $(PREFIX) install -m0444 *.html $(PREFIX) install -m0444 -p -D -t $(PREFIX)/$(BLOG_POST_OUT_TOP_DIR) $(BLOG_POST_OUT_TOP_DIR)/index.html + install -m0444 -p -D -t $(PREFIX)/$(BLOG_POST_OUT_TOP_DIR) $(BLOG_POST_OUT_TOP_DIR)/index.xml + install -m0444 -p -D -t $(PREFIX)/$(BLOG_POST_OUT_TOP_DIR) $(BLOG_POST_OUT_TOP_DIR)/atom.xml install -m0444 -p -D -t $(PREFIX)/$(BLOG_POST_OUT_DIR) $(BLOG_POST_OUT_DIR)/*.html + install -m0444 -p -D -t $(PREFIX)/$(BLOG_POST_OUT_DIR) $(BLOG_POST_OUT_DIR)/atom.xml + install -m0444 -p -D -t $(PREFIX)/$(BLOG_POST_OUT_DIR) $(BLOG_POST_OUT_DIR)/index.xml install -m0444 -p -D -t $(PREFIX)/$(BLOG_POST_OUT_DIR)/img $(BLOG_POST_OUT_DIR)/img/*.png install -m0444 -p -D -t $(PREFIX)/$(BLOG_POST_OUT_DIR)/img $(BLOG_POST_OUT_DIR)/img/*.jpeg install -m0444 -p -D -t $(PREFIX)/$(CONTRIBUTORS_OUT_DIR) $(CONTRIBUTORS_OUT_DIR)/*.html @@ -53,10 +57,11 @@ index.html: landing-template.xml index.md profanity_version.txt echo "
" >$(@:.html=.xml) $(LOWDOWN) --html-no-head-ids --html-no-skiphtml --html-no-escapehtml index.tmpmd >>$(@:.html=.xml) echo "
" >>$(@:.html=.xml) - sed -e 's|

$${div_content}

|
|g' $(@:.html=.xml) > $(@:.html=.tmpxml) - sed -e 's|

$${div_features}

|
|g' $(@:.html=.tmpxml) > $(@:.html=.xml) - sed -e 's|

$${div_screenshots}

|
|g' $(@:.html=.xml) > $(@:.html=.tmpxml) - sed -e 's|

$${div_end}

|
|g' $(@:.html=.tmpxml) > $(@:.html=.xml) + sed -e 's|

$${div_downloads}

|
|g' \ + -e 's|

$${div_features}

|
|g' \ + -e 's|

$${div_screenshots}

|
|g' \ + -e 's|

$${div_end}

|
|g' $(@:.html=.xml) > $(@:.html=.tmpxml) + mv $(@:.html=.tmpxml) $(@:.html=.xml) $(SBLG) -o $@ -t landing-template.xml -c index.xml rm -f index.xml index.tmpxml index.tmpmd @@ -73,40 +78,48 @@ $(PAGES_MD_TO_XML): $(PAGES_SRC) sed -e 's|

$${section_end}

||g' $(@:.xml=.tmpxml) > $@ rm -f $(@:.xml=.md) $(@:.xml=.tmpxml) -xeplist: $(PAGES_SRC_DIR)/doap-stylesheet/style.xsl $(PAGES_SRC_DIR)/doap/profanity.doap \ +$(PAGES_SRC_DIR)/profanity.doap: + $(CURL) -sSL $(DOAP_URL) > $@ + +$(PAGES_SRC_DIR)/xeplist/xeplist.xml: + $(CURL) -sSL $(XEPLIST_URL) > $@ + +xeplist: $(PAGES_SRC_DIR)/doap-stylesheet/style.xsl $(PAGES_SRC_DIR)/profanity.doap \ $(PAGES_SRC_DIR)/xeplist/xeplist.xml cp --preserve=mode,ownership,timestamps $(PAGES_SRC_DIR)/xeplist/xeplist.xml \ $(PAGES_SRC_DIR)/doap-stylesheet/ $(XSLTPROC) $(PAGES_SRC_DIR)/doap-stylesheet/style.xsl \ - $(PAGES_SRC_DIR)/doap/profanity.doap \ + $(PAGES_SRC_DIR)/profanity.doap \ > xeps.xml rm $(PAGES_SRC_DIR)/doap-stylesheet/xeplist.xml themegallery.html: gallery-template.xml $(SBLG) -o $@ -t gallery-template.xml -c themegallery.xml -$(BLOG_POST_OUT_DIR)/atom.xml $(BLOG_POST_OUT_DIR)/index.html $(BLOG_POSTS_OUT): $(BLOG_POSTS) +BLOG_POST_TEMPLATES = $(wildcard $(BLOG_POST_SRC_DIR)/*.xml) +$(BLOG_POST_OUT_DIR)/atom.xml $(BLOG_POST_OUT_TOP_DIR)/index.xml $(BLOG_POST_OUT_DIR)/index.html $(BLOG_POSTS_OUT): $(BLOG_POSTS) $(BLOG_POST_TEMPLATES) $(MAKE) -C $(BLOG_POST_SRC_DIR) mkdir -p $(BLOG_POST_OUT_DIR) cp --preserve=mode,ownership,timestamps $(BLOG_SRC_TOP_DIR)/index.html $(BLOG_POST_OUT_TOP_DIR)/ mv $(BLOG_POST_SRC_DIR)/*.html $(BLOG_POST_OUT_DIR)/ - mv $(BLOG_POST_SRC_DIR)/atom.xml $(BLOG_POST_OUT_DIR)/ + cp --preserve=mode,ownership,timestamps $(BLOG_POST_SRC_DIR)/atom.xml $(BLOG_POST_OUT_TOP_DIR)/index.xml + cp --preserve=mode,ownership,timestamps $(BLOG_POST_SRC_DIR)/atom.xml $(BLOG_POST_OUT_TOP_DIR)/atom.xml + cp --preserve=mode,ownership,timestamps $(BLOG_POST_SRC_DIR)/atom.xml $(BLOG_POST_OUT_DIR)/index.xml + mv $(BLOG_POST_SRC_DIR)/atom.xml $(BLOG_POST_OUT_DIR)/atom.xml cp --preserve=mode,ownership,timestamps --recursive $(BLOG_POST_SRC_DIR)/img $(BLOG_POST_OUT_DIR)/ $(MAKE) -C $(BLOG_POST_SRC_DIR) clean -$(CONTRIBUTORS_OUT_DIR)/index.html $(CONTRIBUTORS_OUT): $(CONTRIBUTORS) +CONTRIBUTOR_TEMPLATES = $(wildcard $(CONTRIBUTORS_SRC_DIR)/*.xml) +$(CONTRIBUTORS_OUT_DIR)/index.html $(CONTRIBUTORS_OUT): $(CONTRIBUTORS) $(CONTRIBUTOR_TEMPLATES) $(MAKE) -C $(CONTRIBUTORS_SRC_DIR) - mkdir $(CONTRIBUTORS_OUT_DIR) + mkdir -p $(CONTRIBUTORS_OUT_DIR) mv $(CONTRIBUTORS_SRC_DIR)/*.html $(CONTRIBUTORS_OUT_DIR)/ cp --preserve=mode,ownership,timestamps --recursive $(CONTRIBUTORS_SRC_DIR)/img $(CONTRIBUTORS_OUT_DIR)/ $(MAKE) -C $(CONTRIBUTORS_SRC_DIR) clean -$(REDIRECTS): $(REDIRECTS_SRC) - cp --preserve=mode,ownership,timestamps $(addprefix $(REDIRECTS_DIR)/,$@) . - clean: $(MAKE) -C $(BLOG_POST_SRC_DIR) clean $(MAKE) -C $(CONTRIBUTORS_SRC_DIR) clean - rm -f index.html $(PAGES) themegallery.html $(REDIRECTS) $(PAGES_SRC_DIR)/xeps.xml + rm -f index.html $(PAGES) $(PAGES_XML) themegallery.html $(PAGES_SRC_DIR)/xeps.xml $(PAGES_SRC_DIR)/profanity.doap $(PAGES_SRC_DIR)/xeplist/xeplist.xml rm -r $(BLOG_POSTS_XML) $(BLOG_POSTS_OUT) $(BLOG_POST_OUT_TOP_DIR) rm -r $(CONTRIBUTORS_XML) $(CONTRIBUTORS_OUT) $(CONTRIBUTORS_OUT_DIR) diff --git a/README.md b/README.md index 5dc2290..3923f74 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ The website is generated from XML templates and Markdown sources using [sblg](ht | **Style** | `css/*.css` | CSS | ### Page Sources -The source files for the landing page (`index.md`) and other top level pages in `pagesource/` are writen in Markdown. They are transformed to HTML and then injected into the appropriate header and footer templates. The list of supported XEPS is generated using a git submodule for https://github.com/profanity-im/profanity/blob/master/profanity.doap. +The source files for the landing page (`index.md`) and other top level pages in `pagesource/` are writen in Markdown. They are transformed to HTML and then injected into the appropriate header and footer templates. The list of supported XEPS is generated from https://raw.githubusercontent.com/profanity-im/profanity/refs/heads/master/profanity.doap. ### Blog Blog posts and contributor profiles are written in Markdown. @@ -39,13 +39,12 @@ To build the site locally, run ``` git clone https://github.com/profanity-im/profanity-im.github.io.git cd profanity-im.github.io -git submodule update --init --recursive make ``` You will need `sblg`, `lowdown` and `libxslt` installed on your system. -To preview the site locally, run `make install` which will create a directory `site`, open `site/index.html` in a web browser. +To preview the site locally, run `make install` which will create a directory `site`, open `site/index.html` in a web browser. You can also just run `make && python3 -m http.server 8000`. To remove the generated files and keep the source files, run `make clean`. diff --git a/atom-template.xml b/atom-template.xml index d7750f2..be89d72 100644 --- a/atom-template.xml +++ b/atom-template.xml @@ -2,7 +2,7 @@ Feed - + - + - Profanity Illustration + Profanity Illustration

- - Profanity + + Profanity

Contributors

- -
+ diff --git a/blogsource/content/contributors/contributor-template.xml b/blogsource/content/contributors/contributor-template.xml index f8887bd..419e96a 100644 --- a/blogsource/content/contributors/contributor-template.xml +++ b/blogsource/content/contributors/contributor-template.xml @@ -7,44 +7,35 @@ - + - Profanity Illustration + Profanity Illustration

- - Profanity + + Profanity

Contributors

-
" >>$@ clean: - rm -f index.html $(BLOG_POSTS_XML) $(BLOG_POSTS_OUT) atom.xml + rm -f index.html $(BLOG_POSTS_XML) $(BLOG_POSTS_OUT) atom.xml index.xml diff --git a/blogsource/content/post/atom-template.xml b/blogsource/content/post/atom-template.xml index a16d1f4..679be10 100644 --- a/blogsource/content/post/atom-template.xml +++ b/blogsource/content/post/atom-template.xml @@ -1,8 +1,8 @@ - Feed + Profanity Developer Blog - + - + - Profanity Illustration + Profanity Illustration

- Profanity + Profanity

Developer Blog

-