kakawait / hugo-tranquilpeak-theme

A gorgeous responsive theme for Hugo blog framework
https://tranquilpeak.kakawait.com
GNU General Public License v3.0
922 stars 527 forks source link

Add support for full posts (non-truncated) on front page #174

Open willquill opened 7 years ago

willquill commented 7 years ago

Actual behavior

On front page, formatting for posts is removed and only a short blurb appears, followed by "Continue reading"

Expected behavior

Would you please add the option for the front page to show full posts? The Hyde theme does this, and it would be awesome if hugo-tranquilpeak-theme did this as well!

Why?

The content on my blog is essentially illegible and unhelpful when visiting the top level of my domain (the .com). Visitors must click on the title of a blog post to access the post content in its intended form.

ghost commented 7 years ago

@thepunkwolf Does the Hexo version provide this option? You can always extend the layout with Hugo. One of the best parts about it IMO. Though I wouldn't suggest it until a stable release is issued unless you're comfortable managing breaking changes.

willquill commented 7 years ago

@jhabdas I've reviewed the documentation for the Hexo version and found this " Display all post content

To display all post content on index page, don't put <!-- more --> and <!-- excerpt --> comment in your post content."

So yes, looks like it does support it. I will admit that I am very new when it comes to static site generators, let alone Hugo, and I'm more of a copy-paster than a programmer, so I'm not sure if that Hexo workaround applies to Hugo as well.

I compared several files side by site between the Hugo Hyde and Hugo Tranquilpeak themes to see if I could figure out how to make Tranquilpeak does what Hyde does with the full post content on index page, and I couldn't figure it out.

My posts (in .md format) do not contain the more or excerpt flags. Where can I modify this so that all current and future posts display all content on the index page?

ghost commented 7 years ago

Where can I modify this so that all current and future posts display all content on the index page?

The summaries for lists of post content are currently created here:

<section class="postShorten-group main-content-wrap">
  {{ $paginator := .Paginate (where .Data.Pages "Type" "post") }}
  {{ range $paginator.Pages }}
    {{ .Render "summary" }}
  {{ end }}
  {{ partial "pagination.html" . }}
</section>

The line which says {{ .Render "summary" }} is rendering the summary layout, which is outputting article summaries using Hugo built-in Summaries and creating the post excerpts it sounds like you want to expand on to show more content.

Given what you've said, if Hexo only outputs post excerpts when what Hugo calls the user-defined summary split is defined it sounds like there's some variance here between themes.

For your purposes, you could leverage Hugo's layout lookup order to override templates in your site to achieve what you want. This is a much more flexible approach than I've seen in any other blogging platform, including Jekyll, as it doesn't necessitate forking.

EDIT: Caveat on that last link. That's to the new docs site, still a WIP. It's a bit easier to consume than the regular Hugo docs for those first approaching Hugo. But it is not a replacement (yet).

Not only can you override and change layouts in your site, you can also choose how they are applied depending on the section of your site they're displayed on. In other words, if you wanted to have individual posts display differently when viewed on your homepage versus an archive or recent post listings, you can do that.

That said, if you're new to SSGs just think of them as Jetpacks for they way sites used to be written in Dreamweaver. There's a learning curve, but it's worth the effort. And I'm of the mind Hugo is the best out there. Here's why.

hellt commented 7 years ago

That is also similar to what I was looking for. If I have a short post without <!--more--> section that I want to display on my main page I loose all the formatting as hugo strips it.

So I am also looking for formatting to persist where a post has no <!--more--> defined

ghost commented 7 years ago

It's by design Hugo strips markup when creating post excerpts. You can read more about it on the Hugo Discussion forums and by searching through GitHub. But that does not prevent a theme from creating their own means of creating summary cards, as I've done with After Dark.