Skip to content

Commit

Permalink
Merge pull request #29 from academicpages/read-more
Browse files Browse the repository at this point in the history
add support for "read more" in excerpts, configure in _config.yml
  • Loading branch information
staeiou committed Jul 21, 2017
2 parents 2cdc88b + 14bf751 commit 78167c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ repository : "academicpages/academicpages.github.io"
teaser : # filename of teaser fallback teaser image placed in /images/, .e.g. "500x300.png"
breadcrumbs : false # true, false (default)
words_per_minute : 160
read_more : "enabled" # if enabled, adds "Read more" links to excerpts
comments:
provider : # false (default), "disqus", "discourse", "facebook", "google-plus", "staticman", "custom"
disqus:
Expand Down
7 changes: 4 additions & 3 deletions _includes/archive-single.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ <h2 class="archive__item-title" itemprop="headline">
<p class="page__date"><strong><i class="fa fa-fw fa-calendar" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].date_label | default: "Published:" }}</strong> <time datetime="{{ post.date | default: "1900-01-01" | date_to_xmlschema }}">{{ post.date | default: "1900-01-01" | date: "%B %d, %Y" }}</time></p>
{% endif %}

{% if post.excerpt %}
<p class="archive__item-excerpt" itemprop="description">{{ post.excerpt | markdownify }}
<a href="{{ base_path }}{{ post.url }}" rel="permalink"><strong> Read more</strong></a></p>
{% if post.excerpt and site.read_more != 'enabled' %}
<p class="archive__item-excerpt" itemprop="description">{{ post.excerpt | markdownify }}</p>
{% elsif post.excerpt and site.read_more == 'enabled' %}
<p class="archive__item-excerpt" itemprop="description"><p>{{ post.excerpt | markdownify | remove: '<p>' | remove: '</p>' }}<strong><a href="{{ base_path }}{{ post.url }}" rel="permalink"> Read more</a></strong></p></p>
{% endif %}

{% if post.citation and post.paperurl %}
Expand Down

0 comments on commit 78167c4

Please sign in to comment.