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; width: 1.5em;
} }
h1 svg {
vertical-align: -0.5rem;
}
/* color palettes */ /* color palettes */
.colors { .colors {

View File

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

View File

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

View File

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

View File

@ -1,12 +1,6 @@
{{ define "main" }} {{ define "main" }}
<main id="main"> <main id="main">
<h1> <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 }} {{ .Title }}
</h1> </h1>
<ul class="patterns-list"> <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; width: 1.5em;
} }
h1 svg {
vertical-align: -0.5rem;
}
/* color palettes */ /* color palettes */
.colors { .colors {