diff options
author | Olivier Fredon <the2ne@gmail.com> | 2016-10-23 13:34:03 +0300 |
---|---|---|
committer | Olivier Fredon <the2ne@gmail.com> | 2016-10-23 13:34:03 +0300 |
commit | be983a846f85e3c005ea9070b6d7b143a828c5d9 (patch) | |
tree | 54523211b6c3d44efdbbce817573b394256ba94e | |
parent | 6a6a0aa92eb83e4f8c3cfc5fc729ecaffad2c63a (diff) |
fix url for taxonomies and refactor template
-rw-r--r-- | archetypes/default.md | 1 | ||||
-rw-r--r-- | layouts/index.html | 7 | ||||
-rw-r--r-- | layouts/partials/post-list.html | 7 | ||||
-rw-r--r-- | layouts/partials/post-meta.html | 7 | ||||
-rw-r--r-- | layouts/partials/post-taxonomies.html | 9 | ||||
-rw-r--r-- | static/css/style.css | 2 | ||||
-rw-r--r-- | static/sass/custom/layout.scss | 4 |
7 files changed, 16 insertions, 21 deletions
diff --git a/archetypes/default.md b/archetypes/default.md index e111a46..e5a889b 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -2,4 +2,5 @@ title = "" description = "" tags = ["x", "y"] +categories = ["x", "y"] +++ diff --git a/layouts/index.html b/layouts/index.html index 1a783ed..8d51ea5 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -7,7 +7,6 @@ </section> <main class="content" role="main" id="main-content"> <h1>Yay!</h1> - {{ $baseurl := .Site.BaseURL }} {{ $paginator := .Paginate (where .Data.Pages.ByDate.Reverse "Type" "post") 3 }} {{ range $paginator.Pages }} <article class="post post--preview"> @@ -18,11 +17,7 @@ <ul class="post__meta__infos"> <li class="post-meta__date"><time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "02 January 2006" }}</time></li> </ul> - <ul class="post__meta__tags"> - {{ range .Params.tags }} - <li><a href="{{ $baseurl }}tags/{{ . }}">{{ . }} </a></li> - {{ end }} - </ul> + {{ partial "post-taxonomies" . }} </footer> <section class="post__excerpt"> <p>{{ .Summary }}…</p> diff --git a/layouts/partials/post-list.html b/layouts/partials/post-list.html index 486e423..941ceb0 100644 --- a/layouts/partials/post-list.html +++ b/layouts/partials/post-list.html @@ -1,4 +1,3 @@ -{{ $baseurl := .Site.BaseURL }} {{ $paginator := .Paginate (where .Data.Pages.ByDate.Reverse "Type" "post") }} {{ range $paginator.Pages }} <article class="post post--preview"> @@ -9,11 +8,7 @@ <ul class="post__meta__infos"> <li class="post-meta__date"><time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "02 January 2006" }}</time></li> </ul> - <ul class="post__meta__tags"> - {{ range .Params.tags }} - <li><a href="{{ $baseurl }}tags/{{ . }}">{{ . }} </a></li> - {{ end }} - </ul> + {{ partial "post-taxonomies" . }} </footer> </article> {{ end }} diff --git a/layouts/partials/post-meta.html b/layouts/partials/post-meta.html index 1790b69..411db61 100644 --- a/layouts/partials/post-meta.html +++ b/layouts/partials/post-meta.html @@ -1,13 +1,8 @@ -{{ $baseurl := .Site.BaseURL }} <ul class="post__meta__infos"> <li class="post__meta__author" itemprop="author">{{ .Site.Params.author }}</li> <li class="post__meta__date"><time datetime="{{ .Date.Format "2006-01-02" }}" itemprop="datePublished">{{ .Date.Format "02 January 2006" }}</time></li> </ul> -<ul class="post__meta__tags"> - {{ range .Params.tags }} - <li><a href="{{ $baseurl }}tags/{{ . }}">{{ . }} </a></li> - {{ end }} -</ul> +{{ partial "post-taxonomies" . }} <meta itemprop="url" content="{{ .Permalink }}"> <meta itemprop="wordCount" content="{{ .WordCount }}" /> <meta itemprop="timeRequired" content="{{ .ReadingTime }} Min" /> diff --git a/layouts/partials/post-taxonomies.html b/layouts/partials/post-taxonomies.html new file mode 100644 index 0000000..da4733d --- /dev/null +++ b/layouts/partials/post-taxonomies.html @@ -0,0 +1,9 @@ +{{ $baseurl := .Site.BaseURL }} +<ul class="post__meta__taxonomies"> + {{ range .Params.tags }} + <li class="tags"><a href="{{ $baseurl }}tags/{{ . | urlize }}">{{ . }} </a></li> + {{ end }} + {{ range .Params.categories }} + <li class="categories"><a href="{{ $baseurl }}categories/{{ . | urlize }}">{{ . }} </a></li> + {{ end }} +</ul>
\ No newline at end of file diff --git a/static/css/style.css b/static/css/style.css index e91623f..ca10bfd 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -590,7 +590,7 @@ html { text-align: left; } -.post__meta .post__meta__tags { +.post__meta .post__meta__taxonomies { text-align: right; } diff --git a/static/sass/custom/layout.scss b/static/sass/custom/layout.scss index 23859ab..abe4883 100644 --- a/static/sass/custom/layout.scss +++ b/static/sass/custom/layout.scss @@ -100,7 +100,7 @@ html { text-align: left; } - .post__meta__tags { + .post__meta__taxonomies { text-align: right; } } @@ -142,7 +142,7 @@ html { display: table; padding: .5em 1.5em; width: 100%; - + .headline { padding: 0; } |