Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIth an image for a post, the site.title and site.description still get rendered #322

Closed
metacodez opened this issue Jan 6, 2019 · 0 comments

Comments

@metacodez
Copy link

First of all, I love the so-simple-theme! It is great work and I just upgraded to the newest version. Thanks a lot for providing this theme!

While upgrading I encountered a small issue: When using an image in a post being declared in the front matter section (as below), I will still have the stite.title and site.description beeing rendered:

image: /images/banner-xyz.png

This is because the masthead.html expected a notation for the image as follows:

image:
    path: /images/banner-xyz.png

Though as of the documentation, the first one is also valid for the image declaration.

Something like below line 1 fixes this issue ({% unless page.image %}):

masthead.html:

...
  {% unless page.image %}
      {% unless page.image.path %}
        <h1 class="site-title animated fadeIn"><a href="{{ '/' | relative_url }}">{{ site.title }}</a></h1>
        <p class="site-description animated fadeIn" itemprop="description">{{ site.description }}</p>
      {% endunless %}
    {% endunless %}

I use Ruby version ruby 2.6.0 on an Arch Linux distribution (4.20.0-arch1-1-ARCH).

Thanks again for the great work!


OT: One could also allow the site.logo to be "overwritten" with a page.logo, which could look as follows:

masthead.html:

<header class="masthead">
  <div class="wrap">
    {% if page.logo %}
      <a href="{{ '/' | relative_url }}" class="site-logo" rel="home" title="{{ site.title }}">
        <img src="{{ page.logo | relative_url }}" class="site-logo-img animated fadeInDown" alt="{{ site.title }}">
      </a>
    {% elsif site.logo %}
      <a href="{{ '/' | relative_url }}" class="site-logo" rel="home" title="{{ site.title }}">
        <img src="{{ site.logo | relative_url }}" class="site-logo-img animated fadeInDown" alt="{{ site.title }}">
      </a>
    {% endif %}
    
    {% unless page.image %}
      {% unless page.image.path %}
        <h1 class="site-title animated fadeIn"><a href="{{ '/' | relative_url }}">{{ site.title }}</a></h1>
        <p class="site-description animated fadeIn" itemprop="description">{{ site.description }}</p>
      {% endunless %}
    {% endunless %}
  </div>
</header><!-- /.masthead -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants