Skip to content

Commit

Permalink
Initial work on categories page #55
Browse files Browse the repository at this point in the history
  • Loading branch information
jethrokuan committed Jul 1, 2017
1 parent e5df2f0 commit 3f82167
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
19 changes: 12 additions & 7 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{{ define "main" }}
<h1>Posts</h1>
{{ range .Data.Pages }}
<article>
<h2>{{ .Title }}</h2>
{{ .Content }}
</article>
{{ end }}
{{ $ctx := . }}
<h1>
{{ if .Data.Singular }}
<span class="taxonomy-type"> {{ .Data.Singular | title }}</span>
{{ end }}
{{ .Title }}
</h1>
{{ range .Data.Pages }}
<article>
<h2><a href="{{ .URL }}">{{ .Title }}</a></h2>
</article>
{{ end }}
{{ end }}
7 changes: 4 additions & 3 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{ define "main" }}
{{ $ctx := . }}
<main class="row single">
<section class="col-12 col-md-8 offset-md-2 section">
<article>
Expand All @@ -20,13 +21,13 @@ <h2 class="posted">Posted on <time>{{ .Date.Format "Jan 2" }}</time> by {{ .Para
<aside class="col-12 col-md-10 offset-md-1 aside">
<div class="row">
<ul class="col categories">
{{ range .Params.topics }}
<li><a href="{{ .BaseURL }}/topics/{{ . | urlize }}">{{ . }}</a> </li>
{{ range .Params.categories }}
<li><a href="{{ $ctx.Site.BaseURL }}/categories/{{ . | urlize }}">{{ . }}</a></li>
{{ end }}
</ul>
<ul class="col tags">
{{ range .Params.tags }}
<li> <a href="{{ .BaseURL }}/tags/{{ . | urlize }}">{{ . }}</a> </li>
<li> <a href="{{ $ctx.Site.BaseURL }}/tags/{{ . | urlize }}">{{ . }}</a> </li>
{{ end }}
</ul>
<div class="col-12">
Expand Down
3 changes: 3 additions & 0 deletions static/scss/lists.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.taxonomy-type::after {
content: ":";
}
1 change: 1 addition & 0 deletions static/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ h1, h2, h3, h4, h5, h6 {
@import "./section.scss";
@import "./footer.scss";
@import "./front-page.scss";
@import "./lists.scss";

.front {
&-list {
Expand Down

0 comments on commit 3f82167

Please sign in to comment.