Skip to content

Instantly share code, notes, and snippets.

@naufdotal
Created February 18, 2023 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naufdotal/b3976e3fe15278ae551213b8dad117ab to your computer and use it in GitHub Desktop.
Save naufdotal/b3976e3fe15278ae551213b8dad117ab to your computer and use it in GitHub Desktop.
Custom Tags Page ghost blog
{{!< default}}
<header class="post-header {{#if feature_image}} has-cover {{/if}}">
<div class="inner">
<h1 class="post-title">{{{title}}}</h1>
{{#if feature_image}}
<div class="post-cover cover">
<img
srcset="{{img_url feature_image size="s"}} 320w,
{{img_url feature_image size="m"}} 640w,
{{img_url feature_image size="l"}} 960w,
{{img_url feature_image size="xl"}} 1920w"
src="{{img_url feature_image size="xl"}}"
alt="{{title}}" />
</div>
{{/if}}
</div>
</header>
{{#post}}
<main class="content" role="main">
<article class="{{post_class}}">
<div class="inner">
<section class="post-content">
<div class="popular-wrapper">
<h4 class="popular-title">{{t "Tags"}}</h4>
<span class="popular-tags post-tags">
{{#get 'tags' limit='all' include='count.posts' order='count.posts desc'}}
{{#foreach tags}}
<a href='{{ url }}'>{{ name }}: {{ count.posts }}</a>
{{/foreach}}
{{/get}}
</span>
</div>
</section>
</div>
</article>
</main>
{{/post}}
{{!< default}}
<header class="blog-header{{#if tag.feature_image}} has-cover{{/if}}">
<div class="inner">
<div class="archive archive-tag box archive-box">
<span class="archive-info">
<span class="archive-type">{{t "Topic"}}</span>
<span class="archive-count">{{plural pagination.total empty=(t "No Posts") singular=(t "% Post") plural=(t "% Posts")}}</span>
</span>
<h2 class="archive-title">{{tag.name}}</h2>
{{#if tag.description}}
<span class="archive-description">{{{tag.description}}}</span>
{{/if}}
</div>
{{#if tag.feature_image}}
<div class="blog-cover cover">
<img
srcset="{{img_url tag.feature_image size="s"}} 320w,
{{img_url tag.feature_image size="m"}} 640w,
{{img_url tag.feature_image size="l"}} 960w,
{{img_url tag.feature_image size="xl"}} 1920w"
src="{{img_url tag.feature_image size="xl"}}"
alt="{{@site.title}}" />
</div>
{{/if}}
</div>
</header>
<div id="index" class="container">
<main class="content" role="main">
{{> "loop"}}
</main>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment