From fc37d5e09335194d0519f42935bf3542c9dabf50 Mon Sep 17 00:00:00 2001 From: "henry.chen" Date: Wed, 29 Nov 2017 16:17:58 +0800 Subject: [PATCH 1/5] fix page:admin/write-post autocomplete tag --- back.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/back.go b/back.go index 31798d6..c1eadee 100644 --- a/back.go +++ b/back.go @@ -3,6 +3,7 @@ package main import ( "bytes" + "encoding/json" "fmt" "html/template" "net/http" @@ -118,7 +119,8 @@ func HandlePost(c *gin.Context) { for tag, _ := range Ei.Tags { tags = append(tags, T{tag, tag}) } - h["Tags"] = tags + str, _ := json.Marshal(tags) + h["Tags"] = string(str) c.Status(http.StatusOK) RenderHTMLBack(c, "admin-post", h) } From 9ad22fb2d9f36367218232082ec0586e15d2369f Mon Sep 17 00:00:00 2001 From: "henry.chen" Date: Thu, 30 Nov 2017 10:04:54 +0800 Subject: [PATCH 2/5] don't use dynamic link: CGO_ENABLED=0 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b1707ab..3ec8a04 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ install: - curl https://glide.sh/get | sh # 安装glide包管理 script: - glide up - - GOOS=linux GOARCH=amd64 go build # 编译版本 + - GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build # 编译版本 - docker build -t registry.cn-hangzhou.aliyuncs.com/deepzz/eiblog . # 构建镜像 after_success: - docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" registry.cn-hangzhou.aliyuncs.com From 6f818c4b5d5aea68a8319bdc6c08d44e4927d6dc Mon Sep 17 00:00:00 2001 From: "henry.chen" Date: Tue, 5 Dec 2017 15:08:32 +0800 Subject: [PATCH 3/5] fix search.html --- views/search.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/search.html b/views/search.html index 08d06e6..e4af650 100644 --- a/views/search.html +++ b/views/search.html @@ -1 +1 @@ -{{define "search"}}

站内搜索

{{if .Word}}{{with .SearchResult}}{{if gt (.Hits.Hits|len) 0}}
本次搜索共找到结果 {{.Hits.Total}} 条 (用时 {{.Took}} 秒)
{{range .Hits.Hits}}
{{if .Source.Img}}
{{end}}
{{dateformat .Source.Date "2006-01-02"}} ... {{str2html (join .Highlight.Content "...")}} ...
{{end}}{{else}}
没有找到任何结果,请更换查询词试试~
或者试试 Google 站内搜索:site:{{$.Domain}} {{$.Word}}
{{end}}{{end}}{{else}}
热搜词:{{range .HotWords}}{{.}}{{end}}

支持的搜索格式:

  1. 输入关键词全文搜索:Let's Encrypt
  2. 指定时间段搜索:date:2016date:2016-10
  3. 指定标签搜索:tag:githubtag:HTTPS
  4. 组合搜索:date:2016 tag:docker
{{end}}
{{if or .Prev .Next}}{{end}}
{{end}} +{{define "search"}}

站内搜索

{{if .Word}}{{with .SearchResult}}{{if gt (.Hits.Hits|len) 0}}
本次搜索共找到结果 {{.Hits.Total}} 条 (用时 {{.Took}} 秒)
{{range .Hits.Hits}}
{{if .Source.Img}}
{{end}}
{{dateformat .Source.Date "2006-01-02"}} ... {{str2html (join .Highlight.Content "...")}} ...
{{end}}{{else}}
没有找到任何结果,请更换查询词试试~
或者试试 Google 站内搜索:site:{{$.Domain}} {{$.Word}}
{{end}}{{end}}{{else}}
热搜词:{{range .HotWords}}{{.}}{{end}}

支持的搜索格式:

  1. 输入关键词全文搜索:Let's Encrypt
  2. 指定时间段搜索:date:2016date:2016-10
  3. 指定标签搜索:tag:githubtag:HTTPS
  4. 组合搜索:date:2016 tag:docker
{{end}}
{{if or .Prev .Next}}{{end}}
{{end}} From e023a33786a317fe4d84827d86df3d59ddc6c123 Mon Sep 17 00:00:00 2001 From: Deepzz Date: Fri, 8 Dec 2017 12:19:01 +0800 Subject: [PATCH 4/5] Update app.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除 disqus 评论及 Google 分析私人信息配置 --- conf/app.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/app.yml b/conf/app.yml index 4021089..82a27ff 100644 --- a/conf/app.yml +++ b/conf/app.yml @@ -35,7 +35,7 @@ general: clean: 1 # 评论相关 disqus: - shortname: deepzz + shortname: xxxxxx publickey: wdSgxRm9rdGAlLKFcFdToBe3GT4SibmV7Y8EjJQ0r4GWXeKtxpopMAeIeoI2dTEg accesstoken: 50023908f39f4607957e909b495326af postscount: https://disqus.com/api/3.0/threads/set.json @@ -49,7 +49,7 @@ disqus: # 谷歌统计 google: url: https://www.google-analytics.com/collect - tid: UA-77251712-1 + tid: UA-xxxxxx-1 v: "1" t: pageview # 七牛CDN From 6fa5088352d2e697ca4191431cca28c1224693ab Mon Sep 17 00:00:00 2001 From: Deepzz Date: Sat, 30 Dec 2017 13:50:19 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20ct=20=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8dd338c..057042e 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ gencert:makedir @echo "generate rsa cert..." @$(acme.sh) --force --issue --dns dns_ali $(sans) --log \ - --renew-hook "ct-submit ctlog.api.venafi.com < $(config)/ssl/domain.rsa.pem > $(config)/scts/rsa/venafi.sct \ + --renew-hook "ct-submit ctlog-gen2.api.venafi.com < $(config)/ssl/domain.rsa.pem > $(config)/scts/rsa/venafi.sct \ && ct-submit ctlog.wosign.com < $(config)/ssl/domain.rsa.pem > $(config)/scts/rsa/wosign.sct" @$(acme.sh) --install-cert -d $(cn) \ --key-file $(config)/ssl/domain.rsa.key \ @@ -49,7 +49,7 @@ gencert:makedir @echo "generate ecc cert..." @$(acme.sh) --force --issue --dns dns_ali $(sans) -k ec-256 --log \ - --renew-hook "ct-submit ctlog.api.venafi.com < $(config)/ssl/domain.ecc.pem > $(config)/scts/ecc/venafi.sct \ + --renew-hook "ct-submit ctlog-gen2.api.venafi.com < $(config)/ssl/domain.ecc.pem > $(config)/scts/ecc/venafi.sct \ && ct-submit ctlog.wosign.com < $(config)/ssl/domain.ecc.pem > $(config)/scts/ecc/wosign.sct" @$(acme.sh) --install-cert -d $(cn) --ecc \ --key-file $(config)/ssl/domain.ecc.key \