forked from MeiK2333/github-style
-
Notifications
You must be signed in to change notification settings - Fork 1
/
post.html
154 lines (144 loc) · 8.83 KB
/
post.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<div class="application-main " data-commit-hovercards-enabled="">
<div itemscope="" itemtype="http://schema.org/SoftwareSourceCode" class="">
<main id="js-repo-pjax-container" data-pjax-container="">
<div class="pagehead repohead instapaper_ignore readability-menu experiment-repo-nav pt-lg-4 "> <!-- pt-0を除去; 小画面でもタイトル表示するため -->
<div class="repohead-details-container clearfix container-lg p-responsive d-lg-block"> <!-- d-noneを除去 -->
<div class="d-flex">
<h1 class="public css-truncate float-none flex-auto width-fit pl-0">
<a class="avatar mr-1" href="{{ absURL "about/" }}">
{{ with $.Site.Params.avatar }}
<img src="{{ $.Site.Params.avatar }}" class="avatar-user" width="26" height="26" title="{{ $.Site.Params.author }}">
{{ else }}
<img src="{{ "images/avatar.png" | absURL }}" class="avatar-user" width="26" height="26" title="{{ $.Site.Params.author }}">
{{ end }}
</a>
<!-- <span class="author"><a href="{{ absURL "about/" }}">{{ .Site.Params.author }}</a></span>
<span class="path-divider">/</span> -->
<strong itemprop="name"><a href="{{ .Permalink }}">{{ .Title }}</a></strong>
{{ with .Params.description }}<div class="text-small text-gray mb-1 mt-1">{{ . }}</div>{{ end }}
<!-- display tags -->
<div class="text-small text-gray">
{{- with .Params.tags }}
<div class="f6 text-gray mt-1">
{{ range . }}
<a class="muted-link mr-3 d-inline-block" href="/tags/{{ . | urlize }}">
{{ partial "octicon-tag.html" . }}
{{ . }}
</a>
{{ end }}
</div>
{{- end }}
</div>
<!-- display timestamp -->
<div class="d-block text-small text-gray">
<span class="d-inline-block">
Created at <time datetime="{{ .PublishDate.Format "2006-01-02 15:04" }}" class="no-wrap">
{{ .PublishDate.Format "2006-01-02 15:04" }}</time>
</span>
{{ if ne .PublishDate .Lastmod }}
<span class="file-info-divider"></span>
<span class="d-inline-block">
Updated at <time datetime="{{ .Lastmod.Format "2006-01-02 15:04" }}" class="no-wrap">
{{ .Lastmod.Format "2006-01-02 15:04" }}</time>
{{ end }}
</span>
</div>
</h1>
</div>
</div>
</div>
<div class="container-lg clearfix new-discussion-timeline experiment-repo-nav p-responsive">
<div class="repository-content ">
<div class="Box mt-3 position-relative">
<div class="Box-header py-2 d-flex flex-column flex-shrink-0 flex-md-row flex-md-items-center">
<div class="text-mono f6 flex-auto pr-3 flex-order-2 flex-md-order-1 mt-2 mt-md-0">
{{ countwords .Content }} Words
<!-- <span class="file-info-divider"></span>
{{ .ReadingTime }} min -->
</div>
{{- with .Site.Params.hugoRepository }}
{{ $historyUrl := add (substr (printf "https://github.com/%s/%s/commits/master/content%s" $.Site.Params.github . $.RelPermalink) 0 -1) ".md" }}
<div class="d-flex py-1 py-md-0 flex-auto flex-order-1 flex-md-order-2 flex-sm-grow-0 flex-justify-between">
<div class="BtnGroup">
<a rel="nofollow" class="btn btn-sm BtnGroup-item" href="{{ $historyUrl }}">History</a>
</div>
</div>
{{- end }}
</div>
<div id="readme" class="Box-body readme blob instapaper_body js-code-block-container">
{{- partial "caution" . -}}
<article class="markdown-body entry-content p-3 p-md-6" itemprop="text">
{{- .Content | replaceRE "(<h[1-9] id=\"([^\"]+)\".+)(</h[1-9]+>)" "${1}<a class=\"anchor\" aria-hidden=\"true\" href=\"#${2}\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a> ${3}" | safeHTML -}}
</article>
</div>
</div>
{{ $related := .Site.RegularPages.RelatedIndices . "tags" "date" | first 5 }}
{{ with $related }}
<div class="Box mt-3 position-relative">
<div class="Box-body instapaper_body">
<article class="markdown-body entry-content p-3 p-md-6" itemprop="text">
<h2>See Also</h2>
<ul class="mt-2">
{{ range . }}
<li class="p-1">
<div>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
<time datetime="{{ .PublishDate.Format "2006-01-02 15:04" }}" class="no-wrap text-small ml-1">
{{ .PublishDate.Format "(2006-01-02 15:04)" }}
</time>
</div>
<div class="text-small text-gray mb-1 mt-1">
{{ .Description }}
</div>
</li>
{{ end }}
</ul>
</article>
</div>
</div>
{{ end }}
</div>
</div>
</main>
</div>
</div>
<!-- シンタックスハイライトにタイトルを挿入するコード -->
<script
src='{{ "js/syntax-highlight-title.js" | absURL }}'
crossorigin="anonymous"
type="application/javascript">
</script>
<!-- Ads -->
{{ $partialPath := "ads_post_bottom.html" }}
{{ if templates.Exists ( printf "partials/%s" $partialPath ) }}
<div class="mt-3 position-relative center">
{{ partial $partialPath . }}
</div>
{{ end }}
{{ if .Site.Params.utterances }}
<div class="utterances"></div>
<!-- <script src="https://utteranc.es/client.js"
repo="{{ .Site.Params.utterances }}"
issue-term="title"
theme="github-light"
crossorigin="anonymous"
async>
</script> -->
<script>
/*
var systemThemeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
var systemTheme = systemThemeMediaQuery.matches ? 'dark' : 'light';
var utterancesTheme = systemTheme === 'dark' ? 'github-dark' : 'github-light';
*/
var utterancesTheme = {{ if $.Site.Params.disableDarkMode }}'github-light'{{ else }}'github-dark'{{end}}
var utterancesScript = document.createElement('script');
utterancesScript.src = 'https://utteranc.es/client.js';
utterancesScript.setAttribute('repo', '{{ .Site.Params.utterances }}');
utterancesScript.setAttribute('issue-term', 'title');
utterancesScript.setAttribute('theme', utterancesTheme);
utterancesScript.setAttribute('crossorigin', 'anonymous');
utterancesScript.setAttribute('async', '');
document.querySelector('.utterances').appendChild(utterancesScript);
</script>
<noscript>Please enable JavaScript to view the comments</noscript>
{{ end }}