|
|
@ -20,6 +20,7 @@ type Post struct {
|
|
20
|
20
|
Title string `yaml:"title"`
|
|
21
|
21
|
URL string `yaml:"url"`
|
|
22
|
22
|
Content string `yaml:"content"`
|
|
|
23
|
Date string `yaml:"date"`
|
|
23
|
24
|
Type string `yaml:"type"`
|
|
24
|
25
|
}
|
|
25
|
26
|
|
|
|
@ -117,7 +118,10 @@ var funcs = template.FuncMap{
|
|
117
|
118
|
var shellTmpl = template.Must(template.New("shell").
|
|
118
|
119
|
Funcs(funcs).Parse(`
|
|
119
|
120
|
<article id="{{ .Id }}" class="shell">
|
|
120
|
|
<h1><code class="language-shell">{{ .Title }}</code></h1>
|
|
|
121
|
<header>
|
|
|
122
|
<h1><code class="language-shell">{{ .Title }}</code></h1>
|
|
|
123
|
{{- if .Date }}<time>{{ .Date }}</time>{{ end -}}
|
|
|
124
|
</header>
|
|
121
|
125
|
{{- if .Content }}
|
|
122
|
126
|
|
|
123
|
127
|
{{ markdown .Content }}
|
|
|
@ -128,7 +132,10 @@ var shellTmpl = template.Must(template.New("shell").
|
|
128
|
132
|
var linkTmpl = template.Must(template.New("link").
|
|
129
|
133
|
Funcs(funcs).Parse(`
|
|
130
|
134
|
<article id="{{ .Id }}" class="link">
|
|
131
|
|
<h1><a href="{{ .URL }}">{{ .Title }}</a></h1>
|
|
|
135
|
<header>
|
|
|
136
|
<h1><a href="{{ .URL }}">{{ .Title }}</a></h1>
|
|
|
137
|
{{- if .Date }}<time>{{ .Date }}</time>{{ end -}}
|
|
|
138
|
</header>
|
|
132
|
139
|
{{- if .Content }}
|
|
133
|
140
|
|
|
134
|
141
|
{{ markdown .Content }}
|