up
All checks were successful
/ publish (push) Successful in 1m18s

This commit is contained in:
milovann 2024-12-05 12:13:39 +01:00
parent fb7068fddb
commit dffbad640f
6 changed files with 30 additions and 18 deletions

View file

@ -1,6 +0,0 @@
on: [push]
jobs:
test:
runs-on: docker
steps:
- run: echo Hello, Runner !

View file

@ -35,7 +35,7 @@ jobs:
echo "Script" echo "Script"
for file in ${ALL_CHANGED_FILES}; do for file in ${ALL_CHANGED_FILES}; do
echo "Script" echo "Script"
./web.sh "$file" ./web.sh convert "$file"
done done
cd .. cd ..

2
dist/.gitignore vendored
View file

@ -1,2 +1,2 @@
*.html

View file

@ -1,2 +1,4 @@
# Doc # Documentation
* [Accueil](index.md)

View file

@ -0,0 +1,7 @@
-- https://stackoverflow.com/questions/40993488/convert-markdown-links-to-html-with-pandoc
--
-- links-to-html.lua
function Link(el)
el.target = string.gsub(el.target, "%.md", ".html")
return el
end

View file

@ -1,13 +1,22 @@
#!/bin/bash #!/bin/bash
file=$1 convert()
filename=$(basename -- "$file") {
extension="${filename##*.}" file=$1
filename="${filename%.*}" filename=$(basename -- "$file")
extension="${filename##*.}"
filename="${filename%.*}"
if [[ -f ../pages/$filename.md ]]
if [[ -f ../pages/$filename.md ]] then
then
echo "making $filename.html" echo "making $filename.html"
pandoc -s ../pages/$filename.md -t html > ../dist/$filename.html pandoc -s ../pages/$filename.md -t html > ../dist/$filename.html --lua-filter=links-to-html.lua
fi fi
}
case $1 in
convert) shift 1; convert "$@";;
*) echo "?" ;;
esac