Generate OGP images only for production.

This commit is contained in:
Kazuhiro MUSASHI 2021-05-02 16:07:48 +09:00
parent 9047181649
commit 9ac988942e
1 changed files with 8 additions and 22 deletions

View File

@ -10,18 +10,15 @@ steps:
- grep -l -r "http://www.amazon.co.jp/exec" content/ | sort | uniq | xargs -t --no-run-if-empty sed -i -e "s/http:\/\/www.amazon.co.jp\/exec/https:\/\/www.amazon.co.jp\/exec/g"
- name: generate-ogp-images
image: reg.kazu634.com/kazu634/tcardgen
environment:
OGP_DIR: static/ogp/
CONTENT_DIR: content/
FONT_DIR: assets/font/
CONFIG: assets/tcardgen.yaml
image: reg.kazu634.com/kazu634/tcardgen:v0.3
commands:
- find ${OGP_DIR} -type f -name '*.png' | xargs -t --no-run-if-empty rm
- LIST=`find ${CONTENT_DIR} -type f -name '*.md' | grep -v '_index'`
- for ARTICLE in ${LIST} ; do
- /tcardgen -f ${FONT_DIR} -o ${OGP_DIR} -c ${CONFIG} ${ARTICLE}
- done
- mkdir -p static/ogp/
- 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
- 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 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 --no-run-if-empty rm
- name: hugo
image: cibuilds/hugo:0.83.0
@ -76,17 +73,6 @@ steps:
- grep -l -r ecx.images-amazon.com content/ | sort | uniq | xargs -t --no-run-if-empty sed -ie "s/http:\/\/ecx.images-amazon.com/https:\/\/images-na.ssl-images-amazon.com/g"
- grep -l -r "http://www.amazon.co.jp/exec" content/ | sort | uniq | xargs -t --no-run-if-empty sed -i -e "s/http:\/\/www.amazon.co.jp\/exec/https:\/\/www.amazon.co.jp\/exec/g"
- name: generate-ogp-images
image: reg.kazu634.com/kazu634/tcardgen:v0.3
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
- unzip /tmp/font.zip -d /tmp/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 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 --no-run-if-empty rm
- name: hugo
image: cibuilds/hugo:0.83.0
commands: