Added pre-commit and ignored .png files in gitignore
This commit is contained in:
parent
34ab0d0c4d
commit
5c50574502
2
.gitignore
vendored
2
.gitignore
vendored
@ -17,4 +17,4 @@ hugo.linux
|
||||
|
||||
# Temporary lock file while building
|
||||
/.hugo_build.lock
|
||||
*.png
|
||||
*.webp
|
||||
|
6
pre-commit
Executable file
6
pre-commit
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
set -eo pipefail
|
||||
|
||||
find ./ -type f -name '*.png' -not -path '*/.git/*' -exec sh -c 'cwebp $1 -o "${1%.png}.webp"' _ {} \;
|
||||
find . -type f -not -path '*/.git/*' -exec sed -i -e 's/\.png/\.webp/g' {} \;
|
Loading…
x
Reference in New Issue
Block a user