- commit
- 399ac5a90547c49309ad30dba97ac3730a068ba8
- parent
- 6bf88fe90a31a8eccac44696e1d06ba272dc68c2
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2023-11-03 12:20
optimize templates
Diffstat
M | _templates/base.html | 38 | +++++++++++++++++++------------------- |
M | _templates/feed.xml | 18 | ++++++++---------- |
M | posts.sh | 11 | +++++------ |
3 files changed, 32 insertions, 35 deletions
diff --git a/_templates/base.html b/_templates/base.html
@@ -28,28 +28,28 @@ 28 28 29 29 <main class="l-main"> 30 30 ${if(title)}<h1>${title}</h1>${endif}31 -1 ${if(date)}32 -1 <div class="post__meta">33 -1 Published on ${date}34 -1 ${for(tags)}35 -1 <a href="/#${it}" class="tag">${it}</a>36 -1 ${endfor}37 -1 </div>38 -1 ${endif}-1 31 ${if(date)} -1 32 <div class="post__meta"> -1 33 Published on ${date} -1 34 ${for(tags)} -1 35 <a href="/#${it}" class="tag">${it}</a> -1 36 ${endfor} -1 37 </div> -1 38 ${endif} 39 3940 -1 ${body}-1 40 ${^}${body} 41 4142 -1 ${if(blog)}43 -1 <ul class="blog">44 -1 ${for(blog.posts)}45 -1 <li class="blog__post" data-tags="${for(it.tags)}${it}${sep} ${endfor}">46 -1 <a href="${it.url}">${it.title}</a>47 -1 </li>48 -1 ${endfor}49 -1 </ul>-1 42 ${if(posts)} -1 43 <ul class="blog"> -1 44 ${for(posts)} -1 45 <li class="blog__post" data-tags="${for(it.tags)}${it}${sep} ${endfor}"> -1 46 <a href="${it.url}">${it.title}</a> -1 47 </li> -1 48 ${endfor} -1 49 </ul> 50 5051 -1 <script src="/static/blogsearch.js" type="module"></script>52 -1 ${endif}-1 51 <script src="/static/blogsearch.js" type="module"></script> -1 52 ${endif} 53 53 </main> 54 54 </body> 55 55 </html>
diff --git a/_templates/feed.xml b/_templates/feed.xml
@@ -7,14 +7,12 @@ 7 7 <id>https://blog.ce9e.org/</id> 8 8 <link href="https://blog.ce9e.org/" rel="self" /> 9 910 -1 ${if(blog)}11 -1 ${for(blog.posts)}12 -1 <entry>13 -1 <title>${it.title}</title>14 -1 <link href="https://blog.ce9e.org${it.url}"/>15 -1 <id>https://blog.ce9e.org${it.url}</id>16 -1 <updated>${it.date}T00:00:00Z</updated>17 -1 </entry>18 -1 ${endfor}19 -1 ${endif}-1 10 ${for(posts)} -1 11 <entry> -1 12 <title>${it.title}</title> -1 13 <link href="https://blog.ce9e.org${it.url}"/> -1 14 <id>https://blog.ce9e.org${it.url}</id> -1 15 <updated>${it.date}T00:00:00Z</updated> -1 16 </entry> -1 17 ${endfor} 20 18 </feed>
diff --git a/posts.sh b/posts.sh
@@ -1,12 +1,11 @@ 1 1 #!/bin/sh 2 23 -1 echo "blog:"4 -1 echo " posts:"-1 3 echo "posts:" 5 4 6 5 ls _content/posts | tac | while read l; do 7 6 yml="_content/posts/$l/index.yml"8 -1 echo " - url: /posts/$l/"9 -1 echo " title: $(grep 'title:' "$yml" | sed 's/title: //')"10 -1 echo " date: $(grep 'date:' "$yml" | sed 's/date: //')"11 -1 echo " tags: $(grep 'tags:' "$yml" | sed 's/tags: //')"-1 7 echo " - url: /posts/$l/" -1 8 echo " title: $(grep 'title:' "$yml" | sed 's/title: //')" -1 9 echo " date: $(grep 'date:' "$yml" | sed 's/date: //')" -1 10 echo " tags: $(grep 'tags:' "$yml" | sed 's/tags: //')" 12 11 done