Merge pull request 'Fix the problem of not generating the ogp images.' (#50) from fix-drone-ci-to-generate-ogp into master

Reviewed-on: #50
This commit is contained in:
Kazuhiro MUSASHI 2021-05-06 22:50:22 +09:00
commit c20a3c08d1
2 changed files with 2 additions and 3 deletions

View File

@ -12,12 +12,11 @@ steps:
- name: generate-ogp-images - name: generate-ogp-images
image: reg.kazu634.com/kazu634/tcardgen:v0.3 image: reg.kazu634.com/kazu634/tcardgen:v0.3
commands: commands:
- mkdir -p static/ogp/
- wget 'https://github.com/yuru7/HackGen/releases/download/v2.3.0/HackGenNerd_v2.3.0.zip' -O /tmp/font.zip - wget 'https://github.com/yuru7/HackGen/releases/download/v2.3.0/HackGenNerd_v2.3.0.zip' -O /tmp/font.zip
- unzip /tmp/font.zip -d /tmp/font - unzip /tmp/font.zip -d /tmp/font
- find /tmp/font -type f -name *.ttf | xargs -I% -n 1 cp -p % assets/font/ - find /tmp/font -type f -name *.ttf | xargs -I% -n 1 cp -p % assets/font/
- find content/ -type f -name '*.md' | grep -v '_index' | xargs -n 1 /usr/local/bin/tcardgen -f assets/font/ -o static/ogp/ -c assets/tcardgen.yaml > /dev/null 2>&1 - find content/ -type f -name '*.md' | grep -v '_index' | xargs -n 1 /usr/local/bin/tcardgen -f assets/font/ -o static/ogp/ -c assets/tcardgen.yaml > /dev/null
- find static/ogp/ -type f -name '*.png' | xargs -I% -n 1 img2webp -lossy -q 50 % -o `echo % | sed -e 's/png/webp/g'` > /dev/null 2>&1 - find static/ogp/ -type f -name '*.png' | xargs -n 1 -I% basename % .png | xargs -I% -n 1 img2webp -lossy -q 50 static/ogp/%.png -o static/ogp/%.webp > /dev/null
- find static/ogp/ -type f -name '*.png' | xargs --no-run-if-empty rm - find static/ogp/ -type f -name '*.png' | xargs --no-run-if-empty rm
- name: hugo - name: hugo

0
static/ogp/.gitkeep Normal file
View File