Procházet zdrojové kódy

better tag templating

Heydon Pickering před 8 roky
rodič
revize
fc36d9138b

+ 4 - 0
docs/css/styles.css

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

+ 0 - 2
docs/patterns/coding/index.html

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

+ 0 - 2
docs/patterns/index.html

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

+ 0 - 2
docs/patterns/writing/index.html

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

+ 6 - 9
docs/tags/example-tag/index.html

@@ -28,8 +28,8 @@
     <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>
   <body>
@@ -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">
       

+ 6 - 9
docs/tags/quickstart/index.html

@@ -28,8 +28,8 @@
     <link rel="stylesheet" type="text/css" href="https://heydon.github.io/infusion/css/styles.css">
     <title>
       
-        Quickstart | Infusion
-      
+  Patterns tagged Quickstart | Infusion
+
     </title>
   </head>
   <body>
@@ -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">
       

+ 0 - 6
themes/infusion/layouts/_default/list.html

@@ -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">

+ 18 - 0
themes/infusion/layouts/taxonomy/tag.html

@@ -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 }}

+ 4 - 0
themes/infusion/static/css/styles.css

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