better tag templating

This commit is contained in:
Heydon Pickering 2017-07-04 15:00:26 +01:00
parent bee496b364
commit fc36d9138b
9 changed files with 38 additions and 30 deletions

View File

@ -634,6 +634,10 @@ a .wcag-icon {
width: 1.5em;
}
h1 svg {
vertical-align: -0.5rem;
}
/* color palettes */
.colors {

View File

@ -201,8 +201,6 @@
<main id="main">
<h1>
Coding
</h1>
<ul class="patterns-list">

View File

@ -201,8 +201,6 @@
<main id="main">
<h1>
Patterns
</h1>
<ul class="patterns-list">

View File

@ -201,8 +201,6 @@
<main id="main">
<h1>
Writing
</h1>
<ul class="patterns-list">

View File

@ -28,7 +28,7 @@
<link rel="stylesheet" type="text/css" href="https://heydon.github.io/infusion/css/styles.css">
<title>
Example Tag | Infusion
Patterns tagged Example Tag | Infusion
</title>
</head>
@ -201,13 +201,10 @@
<main id="main">
<h1>
<svg class="tag" aria-hidden="true" height="50" width="50" viewBox="0 0 177.16535 177.16535">
<use xlink:href="#tag"></use>
</svg>
Example Tag
<svg class="tag" aria-hidden="true" height="50" width="50" viewBox="0 0 177.16535 177.16535">
<use xlink:href="#tag"></use>
</svg>
Tagged &#x201c;Example Tag&#x201d;
</h1>
<ul class="patterns-list">

View File

@ -28,7 +28,7 @@
<link rel="stylesheet" type="text/css" href="https://heydon.github.io/infusion/css/styles.css">
<title>
Quickstart | Infusion
Patterns tagged Quickstart | Infusion
</title>
</head>
@ -201,13 +201,10 @@
<main id="main">
<h1>
<svg class="tag" aria-hidden="true" height="50" width="50" viewBox="0 0 177.16535 177.16535">
<use xlink:href="#tag"></use>
</svg>
Quickstart
<svg class="tag" aria-hidden="true" height="50" width="50" viewBox="0 0 177.16535 177.16535">
<use xlink:href="#tag"></use>
</svg>
Tagged &#x201c;Quickstart&#x201d;
</h1>
<ul class="patterns-list">

View File

@ -1,12 +1,6 @@
{{ define "main" }}
<main id="main">
<h1>
{{ $URLparts := split .URL "/" }}
{{ if in $URLparts "tags" }}
<svg class="tag" aria-hidden="true" height="50" width="50" viewBox="0 0 177.16535 177.16535">
<use xlink:href="#tag"></use>
</svg>
{{ end }}
{{ .Title }}
</h1>
<ul class="patterns-list">

View File

@ -0,0 +1,18 @@
{{ define "title" }}
Patterns tagged {{ .Title }} | {{ .Site.Title }}
{{ end }}
{{ define "main" }}
<main id="main">
<h1>
<svg class="tag" aria-hidden="true" height="50" width="50" viewBox="0 0 177.16535 177.16535">
<use xlink:href="#tag"></use>
</svg>
Tagged &#x201c;{{ .Title }}&#x201d;
</h1>
<ul class="patterns-list">
{{ range .Data.Pages }}
{{ .Render "li"}}
{{ end }}
</ul>
</main>
{{ end }}

View File

@ -634,6 +634,10 @@ a .wcag-icon {
width: 1.5em;
}
h1 svg {
vertical-align: -0.5rem;
}
/* color palettes */
.colors {