Post template integrated 👍🏼

This commit is contained in:
Eduardo 2019-03-03 19:32:36 +01:00
parent eefe852f30
commit 60d4426be4
5 changed files with 121 additions and 79 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -26,7 +26,11 @@
</style> </style>
<header class="m-hero with-picture" data-aos="fade"> <header class="m-hero with-picture" data-aos="fade">
<div class="m-hero__picture"></div> {{#is "post"}}
<div class="m-hero__picture in-post"></div>
{{else}}
<div class="m-hero__picture"></div>
{{/is}}
{{else}} {{else}}
<header class="m-hero" data-aos="fade"> <header class="m-hero" data-aos="fade">
{{/if}} {{/if}}

View file

@ -1,4 +1,7 @@
{{#foreach posts}} {{#foreach posts}}
{{#is "post"}}
<li class="m-recommended-slider__item">
{{/is}}
{{#if feature_image}} {{#if feature_image}}
<article class="m-article-card {{post_class}}"> <article class="m-article-card {{post_class}}">
<div class="m-article-card__picture" style="background-image: url({{feature_image}});"> <div class="m-article-card__picture" style="background-image: url({{feature_image}});">
@ -38,6 +41,9 @@
</a> </a>
</div> </div>
</article> </article>
{{#is "post"}}
</li>
{{/is}}
{{else}} {{else}}
<header class="m-heading"> <header class="m-heading">
<h3>No posts found</h3> <h3>No posts found</h3>

183
post.hbs
View file

@ -5,10 +5,13 @@
{{> hero background=feature_image}} {{> hero background=feature_image}}
</header> </header>
<main role="main"> {{/post}}
<article>
<section class="l-content"> <main role="main">
<div class="l-wrapper in-post" data-aos="fade-up" data-aos-delay="300"> <article>
<section class="l-content">
{{#post}}
<div class="l-wrapper in-post js-wrapper-aos" data-aos="fade-up" data-aos-delay="300">
<div class="l-post-content js-progress-content"> <div class="l-post-content js-progress-content">
<header class="m-heading"> <header class="m-heading">
<h1 class="m-heading__title in-post">{{title}}</h1> <h1 class="m-heading__title in-post">{{title}}</h1>
@ -41,88 +44,116 @@
</section> </section>
</div> </div>
</div> </div>
</section> <section class="m-subscribe-section">
<section class="m-subscribe-section"> <div class="l-wrapper in-post">
<div class="l-wrapper in-post"> <div class="m-subscribe-section__content">
<div class="m-subscribe-section__content"> <div class="m-subscribe-section__text">
<div class="m-subscribe-section__text"> <h4 class="m-subscribe-section__title">Subscribe to our newsletter</h4>
<h4 class="m-subscribe-section__title">Subscribe to our newsletter</h4> <p class="m-subscribe-section__description">
<p class="m-subscribe-section__description"> Get the latest posts delivered right to your inbox.
Get the latest posts delivered right to your inbox. </p>
</p> </div>
</div> <div class="m-subscribe-section__form">
<div class="m-subscribe-section__form"> {{subscribe_form
{{subscribe_form form_class="m-subscribe-section__form"
form_class="m-subscribe-section__form" input_class="m-input in-subscribe-section"
input_class="m-input in-subscribe-section" button_class="m-button primary block"
button_class="m-button primary block" placeholder="Your email address"
placeholder="Your email address" }}
autofocus="true" </div>
}}
</div> </div>
</div> </div>
</div> </section>
</section> <section class="m-author">
<section class="m-author"> <div class="m-author__content">
<div class="m-author__content"> <div class="m-author__picture">
<div class="m-author__picture"> <a href="{{primary_author.url}}" class="m-author-picture">
<a href="{{primary_author.url}}" class="m-author-picture"> {{#if primary_author.profile_image}}
{{#if primary_author.profile_image}}
<div style="background-image: url({{primary_author.profile_image}});"></div> <div style="background-image: url({{primary_author.profile_image}});"></div>
{{else}} {{else}}
<div style="background-image: url({{asset "images/default-avatar-square-small.jpg"}});"></div> <div style="background-image: url({{asset "images/default-avatar-square-small.jpg"}});"></div>
{{/if}} {{/if}}
</a> </a>
</div> </div>
<div class="m-author__info"> <div class="m-author__info">
<h4 class="m-author__name"> <h4 class="m-author__name">
<a href="{{primary_author.url}}">{{primary_author.name}}</a> <a href="{{primary_author.url}}">{{primary_author.name}}</a>
</h4> </h4>
{{#if authors}} {{#has author="count:>1"}}
<p class="m-small-text in-author-along-with"> <p class="m-small-text in-author-along-with">
{{authors separator=", " prefix="Among with " from="2"}} {{authors separator=", " prefix="Among with " from="2"}}
</p> </p>
{{/if}} {{/has}}
{{#if primary_author.bio}} {{#if primary_author.bio}}
<p class="m-author__bio">{{primary_author.bio}}</p> <p class="m-author__bio">{{primary_author.bio}}</p>
{{/if}}
<ul class="m-author-links">
{{#if primary_author.website}}
<li>
<a href="{{primary_author.website}}" target="_blank" rel="noopener">
<span class="icon-globe"></span>
</a>
</li>
{{/if}} {{/if}}
{{#if primary_author.facebook}} <ul class="m-author-links">
<li> {{#if primary_author.website}}
<a href="https://facebook.com/{{primary_author.facebook}}" target="_blank" rel="noopener"> <li>
<span class="icon-facebook"></span> <a href="{{primary_author.website}}" target="_blank" rel="noopener">
</a> <span class="icon-globe"></span>
</li> </a>
{{/if}} </li>
{{#if primary_author.twitter}} {{/if}}
<li> {{#if primary_author.facebook}}
<a href="https://twitter.com/{{primary_author.twitter}}" target="_blank" rel="noopener"> <li>
<span class="icon-twitter"></span> <a href="https://facebook.com/{{primary_author.facebook}}" target="_blank" rel="noopener">
</a> <span class="icon-facebook"></span>
</li> </a>
{{/if}} </li>
</ul> {{/if}}
{{#if primary_author.twitter}}
<li>
<a href="https://twitter.com/{{primary_author.twitter}}" target="_blank" rel="noopener">
<span class="icon-twitter"></span>
</a>
</li>
{{/if}}
</ul>
</div>
</div> </div>
</div> </section>
</section> {{!--
<section class="m-comments"> <section class="m-comments">
<div class="m-load-comments"> <div class="m-load-comments">
<div class="m-load-comments__line"></div> <div class="m-load-comments__line"></div>
<button class="m-icon-button filled as-load-comments"> <button class="m-icon-button filled as-load-comments js-tooltip js-load-comments" data-tippy-content="Load comments">
<span class="icon-comments"></span> <span class="icon-comments"></span>
</button> </button>
</div> </div>
</section> <div class="m-load-comments__iframe l-wrapper in-comments js-comments-iframe">
</article> <div id="disqus_thread"></div>
</main> <script>
{{/post}} var disqus_config = function () {
this.page.url = "{{url absolute="true"}}";
this.page.identifier = "ghost-{{comment_id}}"
};
(function () {
var d = document, s = d.createElement('script');
s.src = 'https://CHANGETHIS.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
</div>
</section>
--}}
{{/post}}
{{#get "posts" limit="3" filter="tags:[{{post.tags}}]+id:-{{post.id}}" include="tags,authors" as |related|}}
<section class="m-recommended">
<div class="l-wrapper in-recommended">
<h3 class="m-section-title in-recommended">Recommended for you</h3>
<div class="m-recommended-articles">
<ul class="m-recommended-slider js-recommended-articles">
{{> "loop"}}
</ul>
</div>
</div>
</section>
{{/get}}
</section>
</article>
</main>
{{#contentFor "scripts"}} {{#contentFor "scripts"}}
<script defer src="{{asset "js/post.js"}}"></script> <script defer src="{{asset "js/post.js"}}"></script>