diff options
author | Benny Mei <meibenny@gmail.com> | 2022-07-20 20:31:30 +0300 |
---|---|---|
committer | Benny Mei <meibenny@gmail.com> | 2022-07-20 20:31:30 +0300 |
commit | 83b32091d5dae3d47b6ecca86758b82c43f3673a (patch) | |
tree | 1ea3c373103743ccf25f719be7779bfeffae45f2 | |
parent | 66dbbf388a0524f38e4526d3e29ead2ca15cb991 (diff) |
support tags
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | layouts/_default/list.html | 19 | ||||
-rw-r--r-- | layouts/_default/single.html | 13 | ||||
-rw-r--r-- | layouts/_default/taxonomy.html | 18 | ||||
-rw-r--r-- | layouts/index.html | 20 | ||||
-rw-r--r-- | layouts/partials/footer.html | 2 | ||||
-rw-r--r-- | static/css/stylesheet.css | 19 |
7 files changed, 80 insertions, 12 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1377554 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.swp diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 5c3f32f..c2004b4 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1 +1,18 @@ -Hello List
\ No newline at end of file +{{ partial "header.html" . }} + +<section id="content"> + <ul> + <div id="posts"> + {{ range .Pages.ByPublishDate.Reverse }} + <div class="post-container"> + <div class="date-time-title date-time-font"> + <time>{{ .Date.Format (.Site.Params.datefrom | default "Jan 02 2006") }}</time> + </div> + <div class="date-time-title post"> + <a href="{{ .Permalink }}">{{ .Title }}</a> + </div> + </div> + {{ end }} + </div> + </ul> +</section> diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 3db642b..3c453a7 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -9,5 +9,16 @@ {{ .Content }} </div> </section> +{{ if .Params.Tags }} +<section class="post-tags"> + <hr> + Tags: + <ul class="post-tag-list"> + {{ range (.GetTerms "tags") }} + <li class="post-tag-list-item"><a href="{{ .Permalink }}">{{ .LinkTitle }}</a>;</li> + {{ end }} + </ul> +</section> +{{ end }} -{{ partial "footer.html" . }}
\ No newline at end of file +{{ partial "footer.html" . }} diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html new file mode 100644 index 0000000..c2004b4 --- /dev/null +++ b/layouts/_default/taxonomy.html @@ -0,0 +1,18 @@ +{{ partial "header.html" . }} + +<section id="content"> + <ul> + <div id="posts"> + {{ range .Pages.ByPublishDate.Reverse }} + <div class="post-container"> + <div class="date-time-title date-time-font"> + <time>{{ .Date.Format (.Site.Params.datefrom | default "Jan 02 2006") }}</time> + </div> + <div class="date-time-title post"> + <a href="{{ .Permalink }}">{{ .Title }}</a> + </div> + </div> + {{ end }} + </div> + </ul> +</section> diff --git a/layouts/index.html b/layouts/index.html index 55be404..235530f 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -2,16 +2,18 @@ <section id=content> <ul class=posts_listing> - {{ range .Site.RegularPages.ByPublishDate.Reverse }} - <div id="posts"> - <div id=date class="date-time-title date-time-font"> - <time>{{ .Date.Format (.Site.Params.dateform | default "Jan 02 2006") }}</time> + <div id="posts"> + {{ range .Site.RegularPages.ByPublishDate.Reverse }} + <div class="post-conatiner"> + <div class="date-time-title date-time-font"> + <time>{{ .Date.Format (.Site.Params.dateform | default "Jan 02 2006") }}</time> + </div> + <div class="date-time-title post"> + <a href="{{ .Permalink }}">{{ .Title }}</a> + </div> </div> - <div class="date-time-title post"> - <a href="{{ .Permalink }}">{{ .Title }}</a> - </div> - </div> - {{ end }} + {{ end }} + </div> </ul> </section> diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index b317cc2..2ab5c0d 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,2 +1,2 @@ </body> -</html>
\ No newline at end of file +</html> diff --git a/static/css/stylesheet.css b/static/css/stylesheet.css index 3542356..ad5966e 100644 --- a/static/css/stylesheet.css +++ b/static/css/stylesheet.css @@ -40,3 +40,22 @@ a { .blog-post { padding-left: 1em; } + +.post-container { + display: block; +} + +.post-tags { + padding-left: 1em; +} + +.post-tag-list { + list-style-type: none; + display: inline-block; + padding-left: 0; +} + +.post-tag-list-item { + white-space: nowrap; + display: inline-block; +} |