website-build: update untitled to remove patch for subdirectories support
The patch added support for deploying websites made with untitled in subdirectory and was needed to make the news/ pages work. But now the functionality has been merged upstream, so we don't need a patch for that anymore. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
This commit is contained in:
parent
da06a2df88
commit
d925b5d4ae
|
@ -19,10 +19,8 @@ EX_USAGE=64
|
|||
|
||||
untitled_uri="https://notabug.org/untitled/untitled.git"
|
||||
untitled_path=""
|
||||
untitled_commit="a147a4303b5608db8fde08abd08b7cc21f1a0c03"
|
||||
untitled_patches=" \
|
||||
patches/0001-Enable-to-deploy-websites-in-subdirectories.patch \
|
||||
"
|
||||
untitled_commit="ee3cf7e29d672e5e5fc1a9409e7327ea9abe9325"
|
||||
|
||||
help()
|
||||
{
|
||||
echo "Usage: $0 [options]"
|
||||
|
@ -142,7 +140,7 @@ set -e
|
|||
|
||||
sync_repo "untitled" \
|
||||
"${untitled_uri}" "${untitled_path}" \
|
||||
"${untitled_commit}" "${untitled_patches}"
|
||||
"${untitled_commit}"
|
||||
|
||||
if [ "${download_only}" -eq 0 ] ; then
|
||||
copy_website "untitled/www/lbwww/"
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
From 638abbd35c41a4695ecaf7e569027c83a355d385 Mon Sep 17 00:00:00 2001
|
||||
From: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
||||
Date: Wed, 6 Dec 2023 21:29:31 +0100
|
||||
Subject: [PATCH] Enable to deploy websites in subdirectories.
|
||||
|
||||
Sometimes people just have shell accounts on a server and the machine
|
||||
is setup to serve web pages from their home directory. In that case
|
||||
the domains typically looks like https://domain.org/~username/.
|
||||
|
||||
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
||||
---
|
||||
include/news.sh | 22 ++++++++++++++++++----
|
||||
1 file changed, 18 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/include/news.sh b/include/news.sh
|
||||
index 1886fcb..5d33987 100755
|
||||
--- a/include/news.sh
|
||||
+++ b/include/news.sh
|
||||
@@ -51,7 +51,16 @@ mkarticle()
|
||||
fi
|
||||
while read -r f; do
|
||||
_page="$(sanitizefilename "${f#"${_sitedir}/site/"}")"
|
||||
- meta "${_page}" "${_sitedir}/site" \
|
||||
+
|
||||
+ _protocol="$(echo "${DOMAIN%/}" | sed 's#://.*##')"
|
||||
+
|
||||
+ _domain="$(echo "${DOMAIN%/}" | \
|
||||
+ sed "s#${_protocol}://##" | sed 's#/.*##')"
|
||||
+
|
||||
+ _path="$(echo "${DOMAIN%/}" | \
|
||||
+ sed "s#^${_protocol}://${_domain}/\?##")"
|
||||
+
|
||||
+ meta "${_page}" "${_sitedir}/site" "${_path}" \
|
||||
>> "${_sitedir}/site/${_manifestdir}/index.md"
|
||||
done < "${tmpdir}/xnews"
|
||||
|
||||
@@ -78,11 +87,16 @@ mkarticle()
|
||||
mkhtml "$_sitedir/site/${_manifestdir}/index.md" "${_sitedir##*/}"
|
||||
}
|
||||
|
||||
-# usage: meta file
|
||||
+# usage: meta file filedir
|
||||
meta()
|
||||
{
|
||||
- printf '%s\n' \
|
||||
- "[$(mktitle "${2}/${1}")](/${1}){.title}"
|
||||
+ if [ -n "${3}" ] ; then
|
||||
+ printf '%s\n' \
|
||||
+ "[$(mktitle "${2}/${1}")](/${3}/${1}){.title}"
|
||||
+ else
|
||||
+ printf '%s\n' \
|
||||
+ "[$(mktitle "${2}/${1}")](/${1}){.title}"
|
||||
+ fi
|
||||
|
||||
printf '%s\n' \
|
||||
"[$(sed -n 3p "${2}/${1}" | sed -e s-^..--)]{.date}"
|
||||
--
|
||||
2.41.0
|
||||
|
Loading…
Reference in New Issue