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

Remove date from "About" etc? Limit "preview" text for posts on home page #46

Open
jslingsby opened this issue Sep 27, 2018 · 7 comments

Comments

@jslingsby
Copy link

Thanks for a great theme!!!

These are more questions than issues, so apologies in advance.

  1. I have a date popping up at the top of the "About" and other pages I've set to navigate in the sidebar. This is useful for blog posts, but not for "About" and other pages with relatively static content. If I remove the date from the index.md it just displays 01 January. How can I remove it?

  2. Where does one set the limit on the length of preview text shown for each post on the home page?

Thanks!!!

@jslingsby
Copy link
Author

For demonstration I've launched a page at http://www.ecologi.st/. This has raised a couple of other issues:

  1. Related to the date issue above - the "About" etc pages are rendered with tags and categories on the side too. This likely because are rendered as blog posts? How can one fix this?

  2. The Disqus app is squashed into a very thin box somehow...

I'm no CSS or Hugo expert, but I'll report back if I find fixes myself.

Thanks!!!

@Pinaute
Copy link

Pinaute commented Jan 18, 2019

Hi @jslingsby

I have a date popping up at the top of the "About" and other pages I've set to navigate in the sidebar. This is useful for blog posts, but not for "About" and other pages with relatively static content. If I remove the date from the index.md it just displays 01 January. How can I remove it?

I have the same issue.
I edited the file hugo-nederburg-theme/layouts/_default/single.html
Added {{ if not .Date.IsZero }} ... {{ end }} around the class "date"
As below

{{ if not .Date.IsZero }}
    <span class="date">{{ .Date.Format "02 January 2006" }}</span>	<span> / </span>
{{ end }}

Related to the date issue above - the "About" etc pages are rendered with tags and categories on the side too. This likely because are rendered as blog posts? How can one fix this?

Indeed the page "About", etc. uses the same template as blog posts.

Always in the same file hugo-nederburg-theme/layouts/_default/single.html.
Add the following condition to display comments only if they are defined{{ if ( .Params.categories ) and ( .Params.categories "!=" "") }} ... {{ end }} and the same thing for tags {{ if ( .Params.tags ) and ( .Params.tags "!=" "") }} ... {{ end }}

This should look like:

  {{ if ( .Params.categories ) and ( .Params.categories "!=" "") }}
  <div class="entry-categories"><p><span>Categories</span>
    {{ range $index, $name := .Params.categories }}
    <a href="{{ "/categories/" | relLangURL }}{{ $name | urlize }}" title="View all posts in {{ $name }}">{{ $name }}</a>{{ end }}
  </p>
</div>
{{ end }}

{{ if ( .Params.tags ) and ( .Params.tags "!=" "") }}
<div class="entry-tags"><p><span>Tags</span>
  {{ range $index, $name := .Params.tags }}
  <a href="{{ "/tags/" | relLangURL }}{{ $name | urlize }}" title="View all posts tagged {{ $name }}">{{ $name }}</a>
  {{ end }}

</p></div>	{{ end }} </div>

I don't know if it's a good thing to do, there may be edge effects.
Anyway, it works for me :-)

jslingsby added a commit to jslingsby/jslingsby.github.io that referenced this issue Feb 11, 2019
Fixed "About" etc dates, categories and tags

see appernetic/hugo-nederburg-theme#46
@jslingsby
Copy link
Author

Brilliant, seems to work perfectly! Thanks!

@appernetic
Copy link
Collaborator

I think the best soluton is to do a separate template for About, similar to the one for contact.

@MatthewMcD
Copy link
Contributor

MatthewMcD commented Mar 3, 2019

Based on feedback from Discourse
I reviewed this with the current build of the theme and example site. I have what I think is a good resolution that makes it a lot cleaner and there are no code changes required to the page. This just forces Hugo to build the pages correctly.

  • Renamed contact/_index.md to index.md
  • Renamed layouts/contact/list.html to single.html
  • Added the type = "contact" to contact/index.md front matter
  • Added the type = "about" to about/index.md front matter

I don't want to overwhelm you with PRs, so I'll submit this one after you decide on my previous PRs.

@appernetic
Copy link
Collaborator

@MatthewMcD I have done a sprint on this theme now. You can submit the PR!

@MatthewMcD
Copy link
Contributor

Great, I'll pull and rebuild then submit the PR.

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

3 participants