-
Notifications
You must be signed in to change notification settings - Fork 281
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
Add read-more to summary #198
Conversation
@@ -13,9 +13,7 @@ <h2 class="post-title"> | |||
{{ partial "utils/summary.html" . }} | |||
</summary> | |||
{{ if .Truncated }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, we can solve this issue simply by adding a or
condition, {{ if or .Truncated .Params.summary }}
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that seems to be the better solution.
Also, the But the changes you made reminds me that maybe we should add read more to Atom and RSS too. /cc @palant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
summary.html
is also used for <meta name="description">
for example if no explicit description is set. So having "read more" in the partial definitely makes no sense. Also, the current change will result in "read more" being shown even for short posts where the summary is all of the post.
As to having a "Read more" link in RSS and Atom - I looked through the blogs I subscribed in the past, and showing summary only in RSS is definitely very uncommon. Found only three commercial sites doing it, all private blogs went for full post in RSS with no exception. Out of the commercial sites, one has something resembling a "Read more" link. So I'm inclined to say: not worth the effort.
@@ -13,9 +13,7 @@ <h2 class="post-title"> | |||
{{ partial "utils/summary.html" . }} | |||
</summary> | |||
{{ if .Truncated }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that seems to be the better solution.
Only when summary exists in font-matter
Made the changes accordingly. Should have checked the consequences of the proposed partial :-( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reverted the indentation change, looks good to me now.
Thanks! |
Read-more isn't shown at home-posts when summary is specified in the post front-matter. Co-authored-by: Yusman Kamaleri <ybkamaleri@gmail.com> Co-authored-by: Wladimir Palant <fqcgithub@palant.de>
Read-more isn't shown at home-posts when summary is specified in the post front-matter. Add partial
read-more.html
to the summary.html