refacture all the things!

This commit is contained in:
XenGi 2023-06-13 12:47:07 +02:00
parent 9a7b9ba2c0
commit 2e3a02af0c
Signed by: xengi
SSH key fingerprint: SHA256:EvLbWxFCtfmd+8Xa6RkzkhIga+wFkKCekfFacYVn63M
12 changed files with 169 additions and 153 deletions

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
if [ $# -lt 2 ]; then
echo "Usage: $0 Mediawiki_Page_Name [page|post]"
@ -7,9 +7,12 @@ fi
echo Converting $1...
page=$(echo $1 | sed 's,/,_,g'|tr '[:upper:]' '[:lower:]')
page=$(echo $1 | sed 's,/,_,g' | tr '[:upper:]' '[:lower:]')
hugo new $2/$page.md
curl -s https://berlin.ccc.de/api.php\?action\=query\&prop\=revisions\&rvprop\=content\&format\=json\&titles\=$1 | \
jq -r '.query.pages |..| objects|.["*"]'| sed '/null/d' | pandoc -f mediawiki -t markdown \
curl -s "https://berlin.ccc.de/api.php?action=query&prop=revisions&rvprop=content&format=json&titles=$1" \
| jq -r '.query.pages |..| objects|.["*"]' \
| sed '/null/d' \
| pandoc -f mediawiki -t markdown \
>> content/$2/$page.md