commit
2720aadfd6
|
@ -20,16 +20,16 @@ end
|
||||||
|
|
||||||
desc 'Generate the HTML pages'
|
desc 'Generate the HTML pages'
|
||||||
task :build do
|
task :build do
|
||||||
cd 'content/post' do
|
cd 'content/' do
|
||||||
if os == :linux
|
if os == :linux
|
||||||
sh 'grep -l ecx.images-amazon.com *.md | sort | uniq | xargs --no-run-if-empty sed -ie "s/http:\/\/ecx.images-amazon.com/https:\/\/images-na.ssl-images-amazon.com/g"'
|
sh 'grep -l -r ecx.images-amazon.com | sort | uniq | xargs --no-run-if-empty sed -ie "s/http:\/\/ecx.images-amazon.com/https:\/\/images-na.ssl-images-amazon.com/g"'
|
||||||
sh 'grep -l "http://www.amazon.co.jp/exec" *.md | sort | uniq | xargs --no-run-if-empty sed -i -e "s/http:\/\/www.amazon.co.jp\/exec/https:\/\/www.amazon.co.jp\/exec/g"'
|
sh 'grep -l -r "http://www.amazon.co.jp/exec" | sort | uniq | xargs --no-run-if-empty sed -i -e "s/http:\/\/www.amazon.co.jp\/exec/https:\/\/www.amazon.co.jp\/exec/g"'
|
||||||
else
|
else
|
||||||
sh 'grep -l ecx.images-amazon.com *.md | sort | uniq | xargs d -ie "s/http:\/\/ecx.images-amazon.com/https:\/\/images-na.ssl-images-amazon.com/g"'
|
sh 'grep -l -r ecx.images-amazon.com | sort | uniq | xargs d -ie "s/http:\/\/ecx.images-amazon.com/https:\/\/images-na.ssl-images-amazon.com/g"'
|
||||||
sh 'grep -l "http://www.amazon.co.jp/exec" *.md | sort | uniq | xargs sed -i -e "s/http:\/\/www.amazon.co.jp\/exec/https:\/\/www.amazon.co.jp\/exec/g"'
|
sh 'grep -l -r "http://www.amazon.co.jp/exec" | sort | uniq | xargs sed -i -e "s/http:\/\/www.amazon.co.jp\/exec/https:\/\/www.amazon.co.jp\/exec/g"'
|
||||||
end
|
end
|
||||||
sh 'rm *.mde || true'
|
sh 'find . -type f -name "*.mde" | xargs --no-run-if-empty rm || true'
|
||||||
sh 'rm *.md-e || true'
|
sh 'find . -type f -name "*.md-e" | xargs --no-run-if-empty rm || true'
|
||||||
end
|
end
|
||||||
|
|
||||||
cd 'public' do
|
cd 'public' do
|
||||||
|
|
|
@ -6,7 +6,7 @@ task :new do
|
||||||
day = Time.now
|
day = Time.now
|
||||||
title = ARGV.last.downcase
|
title = ARGV.last.downcase
|
||||||
|
|
||||||
postname = "post/#{day.year}-#{day.strftime("%m")}-#{day.strftime("%d")}-#{title}.md"
|
postname = "#{day.year}-#{day.strftime("%m")}-#{day.strftime("%d")}-#{title}.md"
|
||||||
|
|
||||||
# generate the post md file:
|
# generate the post md file:
|
||||||
sh "hugo new #{postname}"
|
sh "hugo new #{postname}"
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
#!/usr/bin/env rake
|
|
||||||
|
|
||||||
desc 'test'
|
|
||||||
task :test do
|
|
||||||
cd 'content/post' do
|
|
||||||
sh 'grep -l ecx.images-amazon.com *.md | sort | uniq | xargs sed -ie "s/http:\/\/ecx.images-amazon.com/https:\/\/images-na.ssl-images-amazon.com/g"'
|
|
||||||
sh 'grep -l "http://www.amazon.co.jp/exec" *.md | sort | uniq | xargs sed -i -e "s/http:\/\/www.amazon.co.jp\/exec/https:\/\/www.amazon.co.jp\/exec/g"'
|
|
||||||
sh 'rm *.mde || true'
|
|
||||||
sh 'rm *.md-e || true'
|
|
||||||
end
|
|
||||||
end
|
|
Loading…
Reference in New Issue