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

How to properly define the main blog page's post descriptions? #20

Open
BillyHilly opened this issue May 24, 2018 · 0 comments
Open

How to properly define the main blog page's post descriptions? #20

BillyHilly opened this issue May 24, 2018 · 0 comments

Comments

@BillyHilly
Copy link

Hello,
First off, this theme is absolutely incredible! Tons of important details. I'm very impressed it has built in schema data. Nice work!

That being said, there's one update I'd like to make to the template and can't seem to get.
Basically, on the main page that shows the listing of block posts with pic/title/description/link, I'd like for the description area to show meta descriptions by default. I'm putting a lot of work into my meta descriptions in hopes of higher click through rates in SERPs, and believe it'd give me more bang-for-the-buck to have those meta descriptions showing in the blog posts list on the homepage. Hope that makes sense.

I've dug through the template files and can't quite grasp how to do that. I have the following code I've written to pull the meta description if available:

{% if page.header.metadata.description %}
              {{ page.header.metadata.description }}
            {% elseif page.header.description %}
              {{ page.header.description }}
            {% else %}
              {{ page.content }}
            {% endif %}

But I can't seem to get it to work as expected and show in the main page posts list for each post.
As far as I can tell, it should be in the blog_item.html.twig partial. But that also controls the actual post, and everything I've tried affects the post rather than main page post listing. I do see an item there for summary, but when I add summary to the front matter, it blows up and I get a GRAV page error.
So where would my code go to make this happen?
Thanks for this truly awesome theme, and for your time and consideration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant