Modify rake task for generating OGP images.
This commit is contained in:
parent
8cc5a7df4c
commit
ccc0696ca3
|
@ -3,5 +3,13 @@
|
||||||
desc 'Generate OGP images'
|
desc 'Generate OGP images'
|
||||||
task :tcard do
|
task :tcard do
|
||||||
sh 'find static/ogp/ -type f -name "*.png" | grep -v "base.png" | xargs -t --no-run-if-empty rm'
|
sh 'find static/ogp/ -type f -name "*.png" | grep -v "base.png" | xargs -t --no-run-if-empty rm'
|
||||||
sh 'find content/ -type f -name "*.md" | xargs -t -I % tcardgen -f ~/repo/sample-font/ -o static/ogp/ -c config/tcardgen.yaml %'
|
|
||||||
|
Dir.glob("**/*.md", File::FNM_DOTMATCH, base: 'content/').each do |article|
|
||||||
|
unless article =~ /_index\.md/
|
||||||
|
target = File.join('content', article)
|
||||||
|
sh "tcardgen -f ~/repo/sample-font/ -o static/ogp/ -c config/tcardgen.yaml #{target}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
#sh 'find content/ -type f -name "*.md" | xargs -t -I % tcardgen -f ~/repo/sample-font/ -o static/ogp/ -c config/tcardgen.yaml %'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue