Skip to content

Commit

Permalink
feat(amsf): thumb_force_logo to force using site logo regardless fi…
Browse files Browse the repository at this point in the history
…rst image of a post
  • Loading branch information
sparanoid committed Dec 10, 2016
1 parent 27feb67 commit dec56bc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions _app/_includes/_amsf.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,22 @@
Page thumbnail
TODO: https://regex101.com/r/N2hoxV/1
{% endcomment %}
{% assign amsf_site_logo = "/logo.png" | prepend: amsf_site_base %}
{% capture amsf_post_first_image %}
{% assign hero_image = page.content | match_regex: '<img .*?src="([^"]+)"' %}
{% if hero_image == nil %}
{% assign hero_image = "/logo.png" | prepend: amsf_site_base %}
{% assign hero_image = amsf_site_logo %}
{% endif %}
{{ hero_image }}
{% endcapture %}

{% capture amsf_page_thumb %}
{% if page.thumb %}
{{ site.file }}/thumb/{% if page.thumb %}{{ page.thumb }}{% else %}na.png{% endif %}
{% if page.thumb_force_logo %}
{{ amsf_site_logo }}
{% elsif page.thumb %}
{{ site.file }}/thumb/{{ page.thumb }}
{% elsif page.thumb_url %}
{{ page.thumb_url }}
{% else %}
{{ amsf_post_first_image }}
{% endif %}
Expand Down

0 comments on commit dec56bc

Please sign in to comment.