This commit is contained in:
2024-08-27 01:06:25 +02:00
parent 00130ace72
commit 740dfe5749
90 changed files with 313 additions and 251 deletions

View File

@ -5,10 +5,9 @@ cd "${swd}/.."
mkdir -p ./build
cd ./build
cp -r \
../i18n \
../archetypes ../content \
../layouts ../themes \
../config.toml ../hugo.toml \
../hugo.toml ../i18n \
../archetypes ../content \
../layouts ../themes \
./
sh "${swd}/Translate/Get.sh"

View File

@ -13,6 +13,6 @@ swd="$(dirname "$(realpath "$0")")"
if [ ! -e "${swd}/Lib/Globals.sh" ]
then swd="${swd}/.."
fi
eval "$(sed -e 's| = |=|g' "${swd}/../config.toml")"
#eval "$(sed -e 's| = |=|g' "${swd}/../config.toml")"
Python3="$([ -n "$(which python3)" ] && echo python3 || echo python)"

View File

@ -10,15 +10,16 @@ const PostsFileDate = true; // Append dates (YYYY-MM-DD) to posts file names
const FrontmatterNew = {
createdon: "Date",
updatedon: "Lastmod",
categories: Array,
categories: [],
urls: ["Aliases"],
htmltitle: false,
};
let Replacements = { // Format: { ReplaceWithString: [ToFindString] }
"<h2>[:HNotesRefsHTML:]</h2>": "<h2>🏷️ Note e Riferimenti</h2>",
'<div class="footnotes">': ['<div class="footnotes"><hr>', '<div class="footnotes">\n<hr>'],
'"><a class="footnote-ref" href="#fn': '"><a href="#fn',
" href=\"[staticoso:CustomPath:Assets]/": " href=\"https://sitoctt-assets.octt.eu.org/",
" src=\"[staticoso:CustomPath:Assets]/": " src=\"https://sitoctt-assets.octt.eu.org/",
" href=\"{{< assetsRoot >}}/": " href=\"https://sitoctt-assets.octt.eu.org/",
" src=\"{{< assetsRoot >}}/": " src=\"https://sitoctt-assets.octt.eu.org/",
'<div class="highlight CodeScroll">': '<div class="highlight">',
//'<iframe src="[:YouTubeURL:]/' :'<iframe src="https://www.youtube-nocookie.com/',
'<video src="[:YouTube360:]' :'<iframe src="https://www.youtube-nocookie.com/embed/',

View File

@ -2,11 +2,51 @@
. "$(dirname "$(realpath "$0")")/Lib/Globals.sh"
cd "${swd}/.."
# TODO handle new capitalization of folders
# TODO handle un-nested pages
# TODO handle 0000- posts
# TODO handle miscellanea
# FUTURE: old yyyy-mm-dd to new yyyy/mm/dd
#cd ./build/public/it
#find . -type f -name index.html -exec sh -c '
#set -e
#cp "{}" "../it.tmp/{}"
#'
#cd ../../..
#cd ./build/public
#cp -r ./it ./it.tmp
#cd ./it.tmp
cd ./build/public
find . -type f -name index.html -exec sh -c '
set -e
nicepath="$(echo "{}" | rev | cut -d/ -f2- | rev)"
niceurl="./$(echo "${nicepath}" | rev | cut -d/ -f1 | rev)/"
sed -e "s|{URL}|${niceurl}|g" ../../redirectTemplate.html > "${nicepath}.html"
nicename="$(echo "${nicepath}" | rev | cut -d/ -f1 | rev)"
#extrapaths=""
#for replace in \
# "note Posts/Notes/Linux" \
# "note Posts/Notes" \
# "post Posts" \
#; do
# set $replace
# newpath="$(echo "{}" | sed -e "s|/$2/|/$1/|")"
# if [ "${newpath}" != "{}" ]
# then extrapaths="${extrapaths} ${newpath}"
# fi
#done
for path in "${nicepath}" #${extrapaths}
do sed -e "s|{URL}|./${nicename}/|g" ../../redirectTemplate.html > "${path}.html"
done
#if [ "$(echo "{}" | cut -d/ -f2)" = it ]
#then
# destpath="$(echo "${nicepath}" | cut -d/ -f3-).html"
# mkdir -p "${destpath}"
# rm -rf "${destpath}"
# sed -e "s|{URL}|/$(echo "${nicepath}" | cut -d/ -f2-)/|g" ../../redirectTemplate.html > "${destpath}"
#fi
' \;
#cd ../..
cd "${owd}"

View File

@ -96,5 +96,5 @@ def read_from_scripts(relative_path:str):
if __name__ == "__main__":
globals_text = read_from_scripts('Lib/Globals.sh')
exec(globals_text.split('#' + globals_text.splitlines()[0].split('#!')[1] + '!')[0])
exec(read_from_scripts('../config.toml'))
#exec(read_from_scripts('../config.toml'))
main()