forked from kitian616/jekyll-TeXt-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharticle-info.html
64 lines (61 loc) · 2.4 KB
/
article-info.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{%- if post -%}
{%- assign cur_page = post -%}
{%- elsif page -%}
{%- assign cur_page = page -%}
{%- endif -%}
{%- assign __source = page.pageview -%}
{%- assign __target = site.data.variables.default.pageview -%}
{%- include snippets/assign.html -%}
{%- assign _pageview = __return -%}
<div class="article-info clearfix">
{%- if page -%}
<meta itemprop="author" itemscope itemtype="https://schema.org/Person">
{%- if page.author -%}
<meta itemprop="name" content="{{ page.author }}"/>
{%- elsif site.author.name -%}
<meta itemprop="name" content="{{ site.author.name }}"/>
{%- endif -%}
</meta>
{%- endif -%}
{%- if cur_page.tags[0] -%}
<ul class="article-info__left-col menu">
{%- if site.paths.all -%}
{%- assign all_path = site.paths.all -%}
{%- else -%}
{%- assign all_path = site.data.variables.default.paths.all -%}
{%- endif -%}
{%- for tag in cur_page.tags -%}
{%- assign _tag = tag | strip | url_encode } -%}
{%- assign __path = all_path | append: '?tag=' -%}
{%- include snippets/prepend-baseurl.html -%}
<li>
<a class="button button--secondary button--pill button--sm" href="{{ __return | append: _tag | replace: '//', '/' }}">{{ tag }}</a>
</li>
{%- endfor -%}
</ul>
{%- endif -%}
{%- if (_pageview or post) and cur_page.date -%}
<ul class="article-info__right-col menu">
{%- if _pageview or post -%}
{%- if site.leancloud.app_id and site.leancloud.app_key and site.leancloud.app_class -%}
{%- assign __locale = site.data.locale.VIEWS } -%}
{%- include snippets/locale-to-string.html -%}
<li class="pageview">
<span class="js-pageview" data-page-key="{{ cur_page.key }}">0</span> {{ __return }}
</li>
{%- endif -%}
{%- endif -%}
<li class="publish-date">
{%- assign __locale = site.data.locale.ARTICLE_DATE_FORMAT } -%}
{%- include snippets/locale-to-string.html -%}
{%- if post -%}
<span>{{ cur_page.date | date: __return }}</span>
{%- elsif page -%}
<time datetime="{{ page.date | date_to_xmlschema }}"
itemprop="datePublished">{{ cur_page.date | date: __return }}
</time>
{%- endif -%}
</li>
</ul>
{%- endif -%}
</div>