Lucas Stadler лет назад: 9
Родитель
Сommit
7b2b2cde49
2 измененных файлов с 11 добавлено и 2 удалено
  1. 9 2
      go/blog/blog.go
  2. 2 0
      go/blog/blog.yaml

+ 9 - 2
go/blog/blog.go

20
	Title   string `yaml:"title"`
20
	Title   string `yaml:"title"`
21
	URL     string `yaml:"url"`
21
	URL     string `yaml:"url"`
22
	Content string `yaml:"content"`
22
	Content string `yaml:"content"`
23
	Date    string `yaml:"date"`
23
	Type    string `yaml:"type"`
24
	Type    string `yaml:"type"`
24
}
25
}
25
26
117
var shellTmpl = template.Must(template.New("shell").
118
var shellTmpl = template.Must(template.New("shell").
118
	Funcs(funcs).Parse(`
119
	Funcs(funcs).Parse(`
119
<article id="{{ .Id }}" class="shell">
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
	{{- if .Content }}
125
	{{- if .Content }}
122
126
123
	{{ markdown .Content }}
127
	{{ markdown .Content }}
128
var linkTmpl = template.Must(template.New("link").
132
var linkTmpl = template.Must(template.New("link").
129
	Funcs(funcs).Parse(`
133
	Funcs(funcs).Parse(`
130
<article id="{{ .Id }}" class="link">
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
	{{- if .Content }}
139
	{{- if .Content }}
133
140
134
	{{ markdown .Content }}
141
	{{ markdown .Content }}

+ 2 - 0
go/blog/blog.yaml

4
    Find infrequently used binaries on your system.  `ls --time=atime`
4
    Find infrequently used binaries on your system.  `ls --time=atime`
5
    is the key here, it uses the access time instead of the modification
5
    is the key here, it uses the access time instead of the modification
6
    time, which is the default.
6
    time, which is the default.
7
  date: "2016-09-20"
7
  type: shell
8
  type: shell
8
- title: XOXO Festival videos (2012-2015)
9
- title: XOXO Festival videos (2012-2015)
9
  url: https://www.youtube.com/user/xoxofest/videos
10
  url: https://www.youtube.com/user/xoxofest/videos
10
  content: Unfortunately, the ones for 2016 are missing.  I'm not sure if there will be video, I haven't found anything official so far.
11
  content: Unfortunately, the ones for 2016 are missing.  I'm not sure if there will be video, I haven't found anything official so far.
12
  date: "2016-09-24"
11
  type: link
13
  type: link