mirror of
https://git.savannah.gnu.org/git/gnuboot.git
synced 2025-01-30 20:09:39 +01:00
Denis 'GNUtoo' Carikli
0e3ff8047f
The file adding the news is named gnuboot-december-2023.md instead of gnuboot-0.1-rc1.md as the later is understood as a translation in the '1-rc1' lang. Renaming the file to gnuboot-0.1-rc1.en.md instead makes untitled detect the lang correctly but then it assumes this is a translation and adds a broken link for "English" on the new page. For now the older Libreboot news were kept as this shows the history of the project and since GNU Boot is a continuation of the Libreboot project it makes sense to also keep them. The CSS also needed to be separated from the template because otherwise the generated news page would be incomplete and miss all what comes before the CSS like '<!DOCTYPE html>' for instance. Finally x-reviewed was changed into x-unreviewed because we can't set x-reviewed for the news, so the only way to remove the banner for the individual news is to default to reviewed (and to mark all unreviewed files as such). As for the Untitled patch it is needed to make the news page work. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
59 lines
1.7 KiB
Diff
59 lines
1.7 KiB
Diff
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
|
|
|