This commit is contained in:
Hadi
2024-07-01 08:31:12 +00:00
parent ba9dde2c1a
commit 81574fd7bc
6 changed files with 72 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Compress png files in ./docs/src
# Compress png files in ./docs/src and ./home/wallpapers
[[ -d "./docs" ]] || (echo "Folder ./docs not found" && exit 1)
@@ -14,6 +14,7 @@ for file in ./docs/src/*/*.png; do
optipng "$file"
done
# Wallpapers
for file in ./home/wallpapers/*.png; do
optipng "$file"
done

View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
# Create WALLPAPERS.md to preview wallpapers in ./home/wallpapers
WALLPAPERS_FOLDER="./home/wallpapers"
WALLPAPERS_MD="./docs/WALLPAPERS.md"
[[ -d "$WALLPAPERS_FOLDER" ]] || (echo "Wallpapers folder not found" && exit 1)
echo "# Wallpapers" >"$WALLPAPERS_MD"
echo "" >>"$WALLPAPERS_MD"
echo "Wallpapers can be found in the ./home/wallpapers folder." >>"$WALLPAPERS_MD"
echo "" >>"$WALLPAPERS_MD"
echo "| Name | Preview |" >>"$WALLPAPERS_MD"
echo "| -- | -- |" >>"$WALLPAPERS_MD"
for file in $WALLPAPERS_FOLDER/*.png; do
echo "| $(basename $file) | ![$(basename $file)]($file) |" >>"$WALLPAPERS_MD"
done
pandoc -t commonmark_x "$WALLPAPERS_MD" -o "/tmp/wallpapers.md"
mv "/tmp/wallpapers.md" "$WALLPAPERS_MD"