weflock/home.hbs
2023-02-13 22:48:12 +05:30

94 lines
3 KiB
Handlebars

{{!< default}}
{{!-- The tag above means: insert everything in this file
into the {body} of the default.hbs template --}}
<div class="site-header-content">
{{#if @site.cover_image}}
{{!-- This is a responsive image, it loads different sizes depending on device
https://medium.freecodecamp.org/a-guide-to-responsive-images-with-ready-to-use-templates-c400bd65c433 --}}
<img class="site-header-cover"
srcset="{{img_url @site.cover_image size="s"}} 300w,
{{img_url @site.cover_image size="m"}} 600w,
{{img_url @site.cover_image size="l"}} 1000w,
{{img_url @site.cover_image size="xl"}} 2000w"
sizes="100vw"
src="{{img_url @site.cover_image size="xl"}}"
alt=""
/>
{{/if}}
<h1 class="site-title">
{{#if @site.logo}}
<img class="site-logo" src="{{img_url @site.logo size="m"}}" alt="{{@site.title}}" />
{{else}}
{{@site.title}}
{{/if}}
</h1>
<p>{{@site.description}}</p>
<a class="header-cta-button" href="#/search">
<div>
{{#if @custom.search_bar_text}}
{{@custom.search_bar_text}}
{{else}}
I want to think about...
{{/if}}
</div>
<span>Search</span>
</a>
{{#unless @member}}
<a class="header-cta-secondary" href="#/portal">
<p>
{{> "icons/email"}}
{{#if @custom.subscribe_cta_text}}
{{@custom.subscribe_cta_text}}
{{else}}
Think about something new every week
{{/if}}
</p>
</a>
{{/unless}}
</div>
{{!-- The main content area --}}
<main id="site-main" class="site-main outer">
<div class="inner posts">
<section>
<header class="gh-topic-header">
{{#match pagination.pages ">" 1}}
<a href="{{@site.url}}/page/2"><h2>Latest</h2></a>
{{else}}
<h2>Latest</h2>
{{/match}}
</header>
<div class="post-feed">
{{#foreach posts limit="4"}}
{{!-- The tag below includes the markup for each post - partials/post-card.hbs --}}
{{> "post-card"}}
{{/foreach}}
</div>
</section>
{{#if @custom.enter_tag_slugs}}
{{#get "tags" filter="slug:[{{@custom.enter_tag_slugs}}]"}}
{{#foreach tags}}
<hr />
{{> "topic-grid"}}
{{/foreach}}
{{/get}}
{{else}}
{{#match posts.length ">" 1}}
{{#get "tags" include="count.posts" order="count.posts desc" limit="6"}}
{{#foreach tags}}
<hr />
{{> "topic-grid"}}
{{/foreach}}
{{/get}}
{{/match}}
{{/if}}
</div>
</main>