Add script to convert stacken w3 content
This commit is contained in:
parent
f3a7c7f94b
commit
6139995d60
1 changed files with 20 additions and 0 deletions
20
convert_w3_content_to_zola_format.sh
Executable file
20
convert_w3_content_to_zola_format.sh
Executable file
|
@ -0,0 +1,20 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [ "$#" -ne 2 ]; then
|
||||||
|
>&2 echo "./convert_w3_content_to_zola_format.sh source_content_dir dest_content_dir"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
script_dir=$(dirname -- "$(readlink -f -- "$0"; )")
|
||||||
|
|
||||||
|
source_content_dir="$1"
|
||||||
|
dest_content_dir="$2"
|
||||||
|
|
||||||
|
(
|
||||||
|
cd "$source_content_dir"
|
||||||
|
for mdfile in $(find . -type f -iname '*.md'); do
|
||||||
|
>&2 echo "$mdfile -> $dest_content_dir/$mdfile"
|
||||||
|
mkdir -p "$dest_content_dir/$(dirname $mdfile)"
|
||||||
|
$script_dir/nikola_to_zola.py "$mdfile" > "$dest_content_dir/$mdfile"
|
||||||
|
done
|
||||||
|
)
|
Loading…
Add table
Reference in a new issue