Styled the categories on the site
This commit is contained in:
parent
f45bdcd83c
commit
d9aec4af2c
16 changed files with 176 additions and 59 deletions
10
layouts/simplecss/templates/_post_meta.html
Normal file
10
layouts/simplecss/templates/_post_meta.html
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<div class="post-meta">
|
||||
<a href="{{ url_abs .Path }}">{{ format_date .Post.PublishedAt }}</a>
|
||||
{{ if .Categories }}
|
||||
<div class="post-categories">
|
||||
{{ range .Categories }}
|
||||
<a href="{{ url_abs (printf "/categories/%s" .Slug) }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
9
layouts/simplecss/templates/categories_list.html
Normal file
9
layouts/simplecss/templates/categories_list.html
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<h2>Categories</h2>
|
||||
<ul class="category-list">
|
||||
{{ range .Categories }}
|
||||
<li>
|
||||
<span class="category-list-name"><a href="{{ url_abs .Path }}">{{ .Name }}</a> ({{ .PostCount }})</span>
|
||||
{{ if .DescriptionBrief }}<small>{{ .DescriptionBrief }}</small>{{ end }}
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
11
layouts/simplecss/templates/categories_single.html
Normal file
11
layouts/simplecss/templates/categories_single.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<h2>{{ .Category.Name }}</h2>
|
||||
{{ if .DescriptionHTML }}
|
||||
<div class="notice category-description">{{ .DescriptionHTML }}</div>
|
||||
{{ end }}
|
||||
{{ range .Posts }}
|
||||
<div class="h-entry">
|
||||
{{ if .Post.Title }}<h3>{{ .Post.Title }}</h3>{{ end }}
|
||||
{{ .HTML }}
|
||||
{{ template "_post_meta.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
26
layouts/simplecss/templates/layout_main.html
Normal file
26
layouts/simplecss/templates/layout_main.html
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ .Site.Title }}</title>
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS Feed" href="{{ url_abs "/feed.xml" }}"/>
|
||||
<link rel="alternate" type="application/json" title="JSON feed" href="{{ url_abs "/feed.json" }}"/>
|
||||
<link rel="stylesheet" href="https://cdn.simplecss.org/simple.min.css">
|
||||
<link rel="stylesheet" href="{{ url_abs "/static/style.css" }}">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>{{ .Site.Title }}</h1>
|
||||
<p>{{ .Site.Tagline }}</p>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
{{ .Body }}
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<p>This site under construction.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
8
layouts/simplecss/templates/posts_list.html
Normal file
8
layouts/simplecss/templates/posts_list.html
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{{ range .Posts }}
|
||||
<div class="h-entry">
|
||||
{{ if .Post.Title }}<h3>{{ .Post.Title }}</h3>{{ end }}
|
||||
{{ .HTML }}
|
||||
|
||||
{{ template "_post_meta.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
5
layouts/simplecss/templates/posts_single.html
Normal file
5
layouts/simplecss/templates/posts_single.html
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<div class="h-entry">
|
||||
{{ if .Post.Title }}<h3>{{ .Post.Title }}</h3>{{ end }}
|
||||
{{ .HTML }}
|
||||
{{ template "_post_meta.html" . }}
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue