Просмотр исходного кода

Add permalinks

For now, these are only for posts with titles, but that will change.
Lucas Stadler лет назад: 9
Родитель
Сommit
11c6b1916f
1 измененных файлов с 19 добавлено и 1 удалено
  1. 19 1
      go/blog/blog.go

+ 19 - 1
go/blog/blog.go

45
45
46
article h1 {
46
article h1 {
47
	margin: 0;
47
	margin: 0;
48
	margin-right: 1em;
48
}
49
50
article header .permalink {
51
	margin-left: 0.1em;
52
	text-decoration: none;
53
	color: #555;
54
55
	visibility: hidden;
56
}
57
58
article header:hover .permalink {
59
	visibility: visible;
49
}
60
}
50
61
51
article time {
62
article time {
63
	margin-left: 1em;
52
	color: #666;
64
	color: #666;
53
}
65
}
54
66
185
<article id="{{ .Id }}" class="shell">
197
<article id="{{ .Id }}" class="shell">
186
	<header>
198
	<header>
187
		<h1><code class="language-shell">{{ .Title }}</code></h1>
199
		<h1><code class="language-shell">{{ .Title }}</code></h1>
200
		<a class="permalink" href="#{{ .Id }}">∞</a>
188
		{{- if .Date }}<time>{{ .Date }}</time>{{ end -}}
201
		{{- if .Date }}<time>{{ .Date }}</time>{{ end -}}
189
	</header>
202
	</header>
190
	{{- if .Content }}
203
	{{- if .Content }}
199
<article id="{{ .Id }}" class="link">
212
<article id="{{ .Id }}" class="link">
200
	<header>
213
	<header>
201
		<h1><a href="{{ .URL }}">{{ .Title }}</a></h1>
214
		<h1><a href="{{ .URL }}">{{ .Title }}</a></h1>
215
		<a class="permalink" href="#{{ .Id }}">∞</a>
202
		{{- if .Date }}<time>{{ .Date }}</time>{{ end -}}
216
		{{- if .Date }}<time>{{ .Date }}</time>{{ end -}}
203
	</header>
217
	</header>
204
	{{- if .Content }}
218
	{{- if .Content }}
214
	{{- if .Title }}
228
	{{- if .Title }}
215
	<header>
229
	<header>
216
		<h1>{{ .Title }}</h1>
230
		<h1>{{ .Title }}</h1>
231
		<a class="permalink" href="#{{ .Id }}">∞</a>
217
		{{- if .Date }}<time>{{ .Date }}</time>{{ end -}}
232
		{{- if .Date }}<time>{{ .Date }}</time>{{ end -}}
218
	</header>
233
	</header>
219
	{{- end }}
234
	{{- end }}
231
	{{- if .Title }}
246
	{{- if .Title }}
232
	<header>
247
	<header>
233
		<h1>{{ .Title }}</h1>
248
		<h1>{{ .Title }}</h1>
249
		<a class="permalink" href="#{{ .Id }}">∞</a>
234
		{{- if .Date }}<time>{{ .Date }}</time>{{ end -}}
250
		{{- if .Date }}<time>{{ .Date }}</time>{{ end -}}
235
	</header>
251
	</header>
236
	{{- end }}
252
	{{- end }}
249
<article id="{{ .Id }}" class="text">
265
<article id="{{ .Id }}" class="text">
250
	<header>
266
	<header>
251
		<h1>{{ .Title }}</h1>
267
		<h1>{{ .Title }}</h1>
268
		<a class="permalink" href="#{{ .Id }}">∞</a>
252
		{{- if .Date }}<time>{{ .Date }}</time>{{ end -}}
269
		{{- if .Date }}<time>{{ .Date }}</time>{{ end -}}
253
	</header>
270
	</header>
254
	{{- if .Content }}
271
	{{- if .Content }}
264
	{{- if .Title }}
281
	{{- if .Title }}
265
	<header>
282
	<header>
266
		<h1>{{ .Title }}</h1>
283
		<h1>{{ .Title }}</h1>
284
		<a class="permalink" href="#{{ .Id }}">∞</a>
267
		{{- if .Date }}<time>{{ .Date }}</time>{{ end -}}
285
		{{- if .Date }}<time>{{ .Date }}</time>{{ end -}}
268
	</header>
286
	</header>
269
	{{- end }}
287
	{{- end }}