refactor(*): deprecated warn, Pages .URL -> .RelPermalink

This commit is contained in:
olOwOlo 2019-09-08 22:42:48 +08:00
parent d6227f9ce4
commit 024ebc1733
No known key found for this signature in database
GPG key ID: 456394B6E7A15EA6
5 changed files with 13 additions and 13 deletions

View file

@ -25,7 +25,7 @@
{{ $element.Date.Format "01-02" }}
</span>
<span class="archive-post-title">
<a href="{{ $element.URL }}" class="archive-post-link">
<a href="{{ $element.RelPermalink }}" class="archive-post-link">
{{ .Title }}
</a>
</span>

View file

@ -21,7 +21,7 @@
{{ .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}
</span>
<span class="archive-post-title">
<a href="{{ .URL }}" class="archive-post-link">
<a href="{{ .RelPermalink }}" class="archive-post-link">
{{ .Title }}
</a>
</span>

View file

@ -19,14 +19,14 @@
<!-- changyan -->
{{- if and .Site.Params.changyanAppid .Site.Params.changyanAppkey -}}
<div id="SOHUCS" sid="{{ .URL }}"></div>
<div id="SOHUCS" sid="{{ .RelPermalink }}"></div>
<script type="text/javascript">
(function(){
if (window.location.hostname === 'localhost') return;
var appid = '{{ .Site.Params.changyanAppid }}';
var conf = '{{ .Site.Params.changyanAppkey }}';
var width = window.innerWidth || document.documentElement.clientWidth;
var width = window.innerWidth || document.documentElement.clientWidth;
if (width < 960) {window.document.write('<script id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="https://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' + appid + '&conf=' + conf + '"><\/script>'); } else { var loadJs=function(d,a){var c=document.getElementsByTagName("head")[0]||document.head||document.documentElement;var b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("charset","UTF-8");b.setAttribute("src",d);if(typeof a==="function"){if(window.attachEvent){b.onreadystatechange=function(){var e=b.readyState;if(e==="loaded"||e==="complete"){b.onreadystatechange=null;a()}}}else{b.onload=a}}c.appendChild(b)};loadJs("https://changyan.sohu.com/upload/changyan.js",function(){window.changyan.api.config({appid:appid,conf:conf})}); }
})();
</script>
@ -95,12 +95,12 @@
</script>
<noscript>Please enable JavaScript to view the <a href="https://github.com/gitalk/gitalk">comments powered by gitalk.</a></noscript>
{{- end }}
<!-- valine -->
{{- if .Site.Params.valine.enable -}}
<!-- id 将作为查询条件 -->
{{- if .Site.Params.valine.visitor -}}
<span id="{{ .URL | relURL }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
<span id="{{ .RelPermalink | relURL }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
<span class="post-meta-item-text">文章阅读量 </span>
<span class="leancloud-visitors-count">0</span>
<p></p>
@ -114,9 +114,9 @@
el: '#vcomments' ,
appId: '{{ .Site.Params.valine.appId }}',
appKey: '{{ .Site.Params.valine.appKey }}',
notify: {{ .Site.Params.valine.notify }},
verify: {{ .Site.Params.valine.verify }},
avatar:'{{ .Site.Params.valine.avatar }}',
notify: {{ .Site.Params.valine.notify }},
verify: {{ .Site.Params.valine.verify }},
avatar:'{{ .Site.Params.valine.avatar }}',
placeholder: '{{ .Site.Params.valine.placeholder }}',
visitor: {{ .Site.Params.valine.visitor }}
});

View file

@ -53,14 +53,14 @@
<!-- Post Pagination -->
<nav class="post-nav">
{{ with .NextInSection -}}
<a class="prev" href="{{ .URL }}">
<a class="prev" href="{{ .RelPermalink }}">
<i class="iconfont icon-left"></i>
<span class="prev-text nav-default">{{ .Title }}</span>
<span class="prev-text nav-mobile">{{ T "prevPost" }}</span>
</a>
{{- end }}
{{ with .PrevInSection -}}
<a class="next" href="{{ .URL }}">
<a class="next" href="{{ .RelPermalink }}">
<span class="next-text nav-default">{{ .Title }}</span>
<span class="next-text nav-mobile">{{ T "nextPost" }}</span>
<i class="iconfont icon-right"></i>

View file

@ -1,6 +1,6 @@
<article class="post">
<header class="post-header">
<h1 class="post-title"><a class="post-link" href="{{ .URL }}">{{ .Title }}</a></h1>
<h1 class="post-title"><a class="post-link" href="{{ .RelPermalink }}">{{ .Title }}</a></h1>
<div class="post-meta">
<span class="post-time"> {{ .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }} </span>
{{ with .Params.categories -}}
@ -22,7 +22,7 @@
{{ .Summary }}
</div>
<div class="read-more">
<a href="{{ .URL }}" class="read-more-link">{{ T "readMore" }}</a>
<a href="{{ .RelPermalink }}" class="read-more-link">{{ T "readMore" }}</a>
</div>
</div>
</article>