all repos — homestead @ 3356854425a6bef22d20858a93bd3b085a74416a

Code for my website

Add headings to tag pages

Alan Pearce
commit

3356854425a6bef22d20858a93bd3b085a74416a

parent

6e4244321f009d10af915b2674f6d831a0fdb550

3 files changed, 12 insertions(+), 0 deletions(-)

jump to
M src/templates.tssrc/templates.ts
@@ -118,6 +118,11 @@ );
const $feed = $(".h-feed"); const $tpl = $(".h-entry").remove(); $(".title").addClass("p-author h-card").attr("rel", "author"); + if (tag === "") { + $(".filter").remove(); + } else { + $(".filter").find("h3").text(`#${tag}`); + } for (const post of posts) { const $post = $tpl.clone();
M templates/list.htmltemplates/list.html
@@ -24,6 +24,12 @@ <a href="/">Home</a>
</nav> </header> <main id="content"> + <div class="filter"> + <h3>Tag</h3> + <small> + <a href="../">Remove filter</a> + </small> + </div> <ul class="h-feed"> <li class="h-entry"> <span>
M templates/tags.htmltemplates/tags.html
@@ -24,6 +24,7 @@ <a href="/">Home</a>
</nav> </header> <main id="content"> + <h3 style="margin-bottom: 0">Tags</h3> <ul class="tags"> <li class="h-feed"> <a href="/tags/tag">#tag</a>