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

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

Open
willquill opened this issue May 17, 2017 · 5 comments
Open

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

willquill opened this issue May 17, 2017 · 5 comments
Labels
enhancement New feature or request
Milestone

Comments

@willquill
Copy link

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
Copy link

ghost commented May 17, 2017

@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
Copy link
Author

willquill commented May 17, 2017

@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
Copy link

ghost commented May 18, 2017

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.

@kakawait kakawait added this to the 0.5.0 milestone Jun 3, 2017
@hellt
Copy link

hellt commented Jun 21, 2017

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
Copy link

ghost commented Jun 21, 2017

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.

@kakawait kakawait modified the milestones: 0.5.0-BETA, 0.6.0 Mar 29, 2020
@kakawait kakawait added enhancement New feature or request and removed feature request labels Aug 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants