Using the .Site.BaseURL to replace "/" | absURL.

This commit is contained in:
Covey 2018-09-16 20:20:40 +08:00
parent e8ae475591
commit 778ae79ac4
4 changed files with 26 additions and 26 deletions

View File

@ -191,11 +191,13 @@
.post-tags { .post-tags {
padding: 1rem 0 1rem; padding: 1rem 0 1rem;
display: flex;
justify-content: space-between;
} }
.post-nav { .post-nav {
margin: 2rem 0;
&:before, &:before,
&:after { &:after {

View File

@ -2,7 +2,7 @@
<div class="notfound"> <div class="notfound">
<h1 class="error-emoji"></h1> <h1 class="error-emoji"></h1>
<p class="error-text">/* 404 page not found. */</p> <p class="error-text">/* 404 page not found. */</p>
<p class="error-link"><a href="{{ "/" | relLangURL }}">↑ Back Home ↑</a></p> <p class="error-link"><a href="{{ .Site.BaseURL }}">↑ Back Home ↑</a></p>
</div> </div>
<script> <script>
var errorEmojiContainer = document.getElementsByClassName('error-emoji')[0]; var errorEmojiContainer = document.getElementsByClassName('error-emoji')[0];

View File

@ -68,33 +68,22 @@
{{ end }} {{ end }}
</div> </div>
{{ with .Params.tags }}
<div class="post-tags"> <div class="post-tags">
<section style="float:left;"> {{ with .Params.tags }}
<section>
<i class="iconfont icon-tag"></i>Tag(s): <i class="iconfont icon-tag"></i>Tag(s):
{{ range . }} {{ range . }}
<span class="tag"><a href="{{ "tags/" | absURL }}{{ . | urlize }}/"> <span class="tag"><a href="{{ "tags/" | absURL }}{{ . | urlize }}/">
#{{.}}</a></span> #{{.}}</a></span>
{{ end }} {{ end }}
</section> </section>
<section style="float:right;"> {{ end }}
<section>
<a href="javascript:window.history.back();">back</a></span> · <a href="javascript:window.history.back();">back</a></span> ·
<span><a href="{{ "/" | absURL}}">home</a></span> <span><a href="{{ .Site.BaseURL }}">home</a></span>
</section> </section>
</div> </div>
{{ end }}
<div class="post-comment">
{{ if ne .Site.DisqusShortname "" }}
{{ if ( .Params.showComments | default true ) }}
{{ template "_internal/disqus.html" . }}
{{ end }}
{{ else }}
{{ end }}
</div>
<div class="post-nav"> <div class="post-nav">
{{ if .PrevInSection }} {{ if .PrevInSection }}
@ -104,5 +93,15 @@
<a href="{{.NextInSection.Permalink}}" class="next" rel="next" title="{{.NextInSection.Title}}">{{.NextInSection.Title}}&nbsp;<i class="iconfont icon-right"></i></a> <a href="{{.NextInSection.Permalink}}" class="next" rel="next" title="{{.NextInSection.Title}}">{{.NextInSection.Title}}&nbsp;<i class="iconfont icon-right"></i></a>
{{ end }} {{ end }}
</div> </div>
<div class="post-comment">
{{ if ( .Params.showComments | default true ) }}
{{ if ne .Site.DisqusShortname "" }}
{{ template "_internal/disqus.html" . }}
{{ else }}
{{ partial "gitalk.html" . }}
{{ end }}
{{ end }}
</div>
</article> </article>
{{- end }} {{- end }}

View File

@ -14,7 +14,6 @@
{{ with .Site.Params.beian }} {{ with .Site.Params.beian }}
<a href="http://www.miibeian.gov.cn/" target="_blank" rel="external nofollow">{{ . }} </a> | <a href="http://www.miibeian.gov.cn/" target="_blank" rel="external nofollow">{{ . }} </a> |
{{ end }} {{ end }}
<a href="/privacy/"> Privacy </a> |
<span>Powered by <a href="https://gohugo.io/" target="_blank" rel="external nofollow">Hugo</a> & <a href="https://github.com/liuzc/leaveit" target="_blank" rel="external nofollow">LeaveIt</a></span> <span>Powered by <a href="https://gohugo.io/" target="_blank" rel="external nofollow">Hugo</a> & <a href="https://github.com/liuzc/leaveit" target="_blank" rel="external nofollow">LeaveIt</a></span>
</div> </div>
</footer> </footer>