diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index ebcbc48..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,60 +0,0 @@ -version: 2 -jobs: - build: - docker: - - image: cibuilds/hugo:latest - - steps: - - checkout - - run: - name: Change Amazon Links - working_directory: /root/project/ - command: | - set +o pipefail - 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" - - - run: - name: "Run Hugo" - working_directory: /root/project/ - command: | - if [ "${CIRCLE_BRANCH}" != "master" ]; then - hugo -e staging -v -s /root/project/ - else - hugo -e production -v -s /root/project/ - fi - - - run: - name: Change Amazon Links - working_directory: /root/project/ - command: | - set +o pipefail - 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" - - - run: - name: "Gzip css/js/images" - working_directory: /root/project/ - command: | - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"` - do - gzip -c ${TARGET} > ${TARGET}.gz - done - - - add_ssh_keys: - fingerprints: - - "7d:eb:56:da:3f:71:e1:fd:2f:c1:86:18:fe:08:8b:f9" - - run: - name: Start ssh-keyscan - command: | - ssh-keyscan -p ${SSHPORT} ${HOST_NAME} >> ~/.ssh/known_hosts - - - run: - name: Deploy - command: | - if [ "${CIRCLE_BRANCH}" != "master" ]; then - ssh -p ${SSHPORT} ${USER_NAME}@${HOST_NAME} "rm -rf /var/www/test/*" - rsync -e "ssh -p ${SSHPORT}" --omit-dir-times -rltvz --delete public/ ${USER_NAME}@${HOST_NAME}:/var/www/test - else - ssh -p ${SSHPORT} ${USER_NAME}@${HOST_NAME} "rm -rf /var/www/blog/*" - rsync -e "ssh -p ${SSHPORT}" --omit-dir-times -rltvz --delete public/ ${USER_NAME}@${HOST_NAME}:/var/www/blog - fi diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..b0e6a50 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,79 @@ +kind: pipeline +type: docker +name: production + +steps: + - name: Modify-Amazon-Links + image: cibuilds/hugo:0.62.1 + commands: + - 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: hugo + image: cibuilds/hugo:0.62.1 + commands: + - hugo -e production -v -s . + + - name: Compress-the-Assets + image: cibuilds/hugo:0.62.1 + commands: + - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do gzip -c ${TARGET} > ${TARGET}.gz; done + - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do rm -f ${TARGET}; done + + - name: scp + image: appleboy/drone-scp + settings: + host: 10.0.1.166 + username: webadm + port: 10022 + target: /var/www/blog + source: public/ + key: + from_secret: ssh_key + overwrite: true + strip_components: 1 + +trigger: + branch: + - master + +--- +kind: pipeline +type: docker +name: staging + +steps: + - name: Modify-Amazon-Links + image: cibuilds/hugo:0.62.1 + commands: + - 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: hugo + image: cibuilds/hugo:0.62.1 + commands: + - hugo -e staging -v -s . + + - name: Compress-the-Assets + image: cibuilds/hugo:0.62.1 + commands: + - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do gzip -c ${TARGET} > ${TARGET}.gz; done + - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do rm -f ${TARGET}; done + + - name: scp + image: appleboy/drone-scp + settings: + host: 10.0.1.166 + username: webadm + port: 10022 + target: /var/www/test + source: public/ + key: + from_secret: ssh_key + overwrite: true + strip_components: 1 + +trigger: + branch: + exclude: + - master diff --git a/config/_default/config.toml b/config/_default/config.toml index 1df9b32..b199a7a 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -11,3 +11,7 @@ theme = "angels-ladder" profile = "/images/profile.png" analytics = "UA-57665492-1" copyright = "Written by Kazuhiro MUSASHI" + + +[markup.goldmark.renderer] + unsafe = true diff --git a/config/staging/config.toml b/config/staging/config.toml index 3e4b4ed..7202858 100644 --- a/config/staging/config.toml +++ b/config/staging/config.toml @@ -11,3 +11,6 @@ theme = "angels-ladder" profile = "/images/profile.png" analytics = "UA-57665492-1" copyright = "Written by Kazuhiro MUSASHI" + +[markup.goldmark.renderer] + unsafe = true diff --git a/themes/angels-ladder/layouts/index.html b/themes/angels-ladder/layouts/index.html index 0ab24ae..dad2740 100644 --- a/themes/angels-ladder/layouts/index.html +++ b/themes/angels-ladder/layouts/index.html @@ -5,20 +5,22 @@ –––––––––––––––––––––––––––––––––––––––––––––––––– --> Recent Articles - {{ $paginator := .Paginate (where .Data.Pages "Type" "post") }} + {{ $paginator := .Paginate (where .Site.Pages "Type" "post") }} {{ range $paginator.Pages }} - - {{ .Title }} {{ if .Draft }}:: DRAFT{{end}} - - {{ .Date.Format "Jan 2, 2006" }} - {{ range .Params.categories }} - #{{ . }} - {{ end }} - {{ range .Params.tags }} - #{{ . }} - {{ end }}: {{ .Description }} - - + {{ if eq .Kind "page" }} + + {{ .Title }} {{ if .Draft }}:: DRAFT{{end}} + + {{ .Date.Format "Jan 2, 2006" }} + {{ range .Params.categories }} + #{{ . }} + {{ end }} + {{ range .Params.tags }} + #{{ . }} + {{ end }}: {{ .Description }} + + + {{ end }} {{ end }} @@ -26,7 +28,7 @@ - {{ $paginator := .Paginate (where .Data.Pages "Type" "post") }} + {{ $paginator := .Paginate (where .Site.Pages "Type" "post") }} {{ if .Paginator.HasPrev }} Prev {{ end }}