alanorth / hugo-theme-bootstrap4-blog

A blogging-centric Bootstrap v4 theme for the Hugo static site generator.
Other
203 stars 132 forks source link

blogs(n) greater than num_recent_posts #75

Open richp10 opened 6 years ago

richp10 commented 6 years ago

Great theme - but I have one problem.

It seems to me that if you have more blog posts than num_recent_posts there is no way to access older posts other than by categories. Most themes provide a sidebar listing of years so you can drill down.

Am I missing something / are you planning anything like this. Thanks again for the template..

fte378 commented 6 years ago

I added this myself. For an example see https://frank.tegtmeyer.net/

The additions are an archive list sorted by year and a previous/next navigation in side the posts.

If that's what you want I can give you my changes.

alanorth commented 6 years ago

Thanks @richp10. If I understand correctly you mean accessing older posts from the sidebar itself? When I made this theme it was basically just a spiritual copy of the Bootstrap Blog theme so I didn't think about much beyond that. I think date-based archives like in WordPress themes could be a nice addition, though. Can you point me to some Hugo themes which do that?

Jieiku commented 4 years ago

I have an additional thought about this... lets say your on page 6 of the blog, you could have something like this:

[<][1]...[4][5][6][7][8]...[29][>]

image

image

The above screenshots are from a wordpress site. I will have to see if I can find a similar page selector for Hugo.

We do have the previous and next page buttons, so maybe that is sufficient. I have also thought about adding a drop down menu to go through archives. I am still thinking about the best solution for browsing old posts.

alanorth commented 4 years ago

@xekon yes this is nice, but my goal with the theme was to replicate the traditional Bootstrap blog style as it appeared in version 4 alpha.

Jieiku commented 4 years ago

I am happy that you did! When I chose to use this theme, I evaluated all the themes listed here: https://themes.gohugo.io/ My requirements were low requests per page, and low file size transferred. Bootstrap is the most used theme for Drupal, so when I came across this theme of yours I was pretty much sold, there were a few other bootstrap themes, but they did not perform as well as this one.

I actually decided against adding a page selector like that. Instead I plan to leave it how it is and just add a search function. I plan to use https://cse.google.com/cse/ as discussed here: https://github.com/alanorth/hugo-theme-bootstrap4-blog/issues/66

With a search function on the site, there is less need to provide a way to sift through old posts, instead they can just search for whatever it is they are trying to find.

richp10 commented 4 years ago

An old thread (thanks for bumping xekon) - looking back, I like what @fte378 did and wonder if you could share the code to achieve this. To be honest, your site is exactly how I would like to use this theme.

Jieiku commented 4 years ago

@richp10 ah yes they have an overviews section to list all posts, categories and tags:

image

That does look like a really clean solution! Could you please share @fte378 I am interested in the code as well.

fte378 commented 4 years ago

@xekon, @richp10: Attached you can find my overrides for the theme. I don't know if it's elegant or the 'correct' Hugo way - I only look at it when it starts to fail and try to fix it then.

When I remember correctly the main part is layouts/archivetype/single.html

layouts.zip

Jieiku commented 4 years ago

Thank you @fte378 be sure to checkout: https://github.com/alanorth/hugo-theme-bootstrap4-blog/pull/127

It solves the issue of loading Fontawesome that you were wanting to resolve.

Jieiku commented 4 years ago

@fte378 I was able to implement this on my site, thank you. I had to pay close attention to the path of my files, IE post vs posts and rename layouts\archivetype to layouts\archives I also made an /content/archives.md:

---
title: "Archives"
type: archives
url: "/archives/"
---

One more item off my todo list, thanks :)

I will add the required changes to a clean branch in my repository and submit as a pull request.

alanorth commented 4 years ago

@fte378 thank you for sharing your solution. I will take a look at it, and search around for what other people are doing, or perhaps look into Hugo's list templates and grouping by date.

Jieiku commented 4 years ago

@alanorth are you planning to include a feature like this?

If so I wont bother with putting together a pull request.

here it is implemented on my site: https://www.solosaga.com/