Skip to content

Commit

Permalink
Issue #17: Use {{meta_description}} as post excerpt when defined.
Browse files Browse the repository at this point in the history
  • Loading branch information
nileane committed Jun 3, 2015
1 parent e885bf1 commit 8519769
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions partials/loop.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
<a href="{{url}}">
<h2 class="post-title">{{{title}}}</h2>
<div class="post-excerpt">
<p>{{excerpt words="36"}}…</p>
{{#if meta_description}}
<p>{{meta_description}}…</p>

This comment has been minimized.

Copy link
@gllmhyt

gllmhyt Jun 4, 2015

Collaborator

Question: why the "..."? If the excerpt or meta_description (no words limit?) doesn't exceed the number of words allowed and have a final dot, it'll end with ".…" what's a fault. :/

This comment has been minimized.

Copy link
@nileane

nileane Jun 4, 2015

Author Owner

I did not actually think about that :p

This comment has been minimized.

Copy link
@gllmhyt

gllmhyt Jun 4, 2015

Collaborator

If had to try it to figure it out.

{{else}}
<p>{{excerpt words="36"}}…</p>
{{/if}}
</div>
</a>
<footer class="post-meta">
Expand All @@ -34,7 +38,11 @@
<a href="{{url}}">
<h2 class="post-title">{{{title}}}</h2>
<div class="post-excerpt">
<p>{{excerpt words="36"}}…</p>
{{#if meta_description}}
<p>{{meta_description}}…</p>
{{else}}
<p>{{excerpt words="36"}}…</p>
{{/if}}
</div>
</a>
<footer class="post-meta">
Expand Down

1 comment on commit 8519769

@gllmhyt
Copy link
Collaborator

@gllmhyt gllmhyt commented on 8519769 Jun 4, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, thanks, it seems to be working well!

Please sign in to comment.