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 ability to generate per-{year, month, day} archives #448

Open
yacoob opened this Issue Aug 29, 2014 · 18 comments

Comments

Projects
None yet
@yacoob
Copy link
Contributor

yacoob commented Aug 29, 2014

I'm in process of migrating a blogger based blog to hugo. Compare blogger site to hugo-backed site (source here).

One thing that I'll lose as a result of this migration is an archive of posts (like this one). I don't really care all that much, and I'll most likely replace it with a list of all posts, with a different layout, generated from layouts/section/post.html. I'd like to ask you, however, to consider adding a capability for hugo to generate time-based archives. Such archives would most likely be useful to people who want to preserve their existing archive pages.

It'd generate content under public/<section>/2014/index.html for example, from layouts/post/list.html. It'd need to allow per-section and per-level (yearly, monthly, daily) control. It'd also need to play well with permalinks parameter from config.yaml - I don't really have a good idea how to address that.

Is such feature request a sensible one? :)

@spf13 spf13 added the enhancement label Sep 2, 2014

@yacoob

This comment has been minimized.

Copy link
Contributor

yacoob commented Sep 3, 2014

An idea for implementation: Generate one index.html file for every level of date-related data present in permalinks from the config file. For example, with:

permalinks:
  post: /:year/:month/:slug

generate

  • /2014/index.html from layouts/section/post.html with .Pages containing all 2014 posts;
  • /2014/01/index.html from layouts/section/post.html with .Pages containing all January 2014 posts.
  • etc.

This should require minimal new logic needed. Some sanity checking might be required, unless we want to allow things like /:month/:year. If you point me to the relevant bit of code where content/*list of pages to be generated is devised, I might give it a try :)

@spf13

This comment has been minimized.

Copy link
Contributor

spf13 commented Sep 3, 2014

I actually think this should be a bit different.

This assumes the year/month structure that Jekyll and others use.

I would prefer instead to register every directory and maintain a list of children content regardless of if it's using the permalinks structure or not.

This would not only give us what you need, but also support for subsections.

Does that make sense?

@yacoob

This comment has been minimized.

Copy link
Contributor

yacoob commented Sep 4, 2014

It does make sense - the only question in this kind of schema is how do we decide whether or not render an index.html page? A user may simply not want a file there. Should it be generated by default, or should it be generated only if user asks for an index on given level?

@spf13

This comment has been minimized.

Copy link
Contributor

spf13 commented Sep 4, 2014

I think by default. It doesn't hurt to have it and you don't need to link
to it. Plus all directories should have an index on the web if they have
content.

On Wednesday, September 3, 2014, Jakub Turski notifications@github.com
wrote:

It does make sense - the only question in this kind of schema is how do we
decide whether or not render an index.html page? A user may simply not
want a file there. Should it be generated by default, or should it be
generated only if user asks for an index on given level?


Reply to this email directly or view it on GitHub
#448 (comment).

Steve Francia
http://stevefrancia.com
http://spf13.com
http://twitter.com/spf13

@spf13

This comment has been minimized.

Copy link
Contributor

spf13 commented Oct 19, 2014

I think this is related or the same as #465. Tying them together.

@spf13 spf13 added this to the v0.13 milestone Oct 19, 2014

@spf13 spf13 self-assigned this Oct 19, 2014

@spf13 spf13 modified the milestones: v0.13, v0.14 Feb 22, 2015

@anthonyfok anthonyfok modified the milestones: v0.15, v0.14 Sep 16, 2015

@anthonyfok anthonyfok modified the milestones: v0.16, v0.15 Nov 30, 2015

@matrixik

This comment has been minimized.

Copy link

matrixik commented Dec 10, 2015

@moorereason moorereason modified the milestones: future, v0.16 May 7, 2016

@AriaFallah

This comment has been minimized.

Copy link

AriaFallah commented Jun 30, 2016

Any progress on this or workarounds?

@kakawait kakawait referenced this issue Jul 16, 2016

Merged

Transform hexo template to hugo #2

44 of 44 tasks complete
@vielmetti

This comment has been minimized.

Copy link
Contributor

vielmetti commented Feb 27, 2017

Any ideas on this one?

@yacoob

This comment has been minimized.

Copy link
Contributor

yacoob commented Feb 27, 2017

FWIW, I've stopped using Hugo for the site that I wanted this feature for, so I'm muting this bug - don't expect any answers here :>

@mcliment

This comment has been minimized.

Copy link

mcliment commented Feb 27, 2017

I'm not a Hugo expert and my templates may have some newbie errors but I managed to make archives work using taxonomies.

Check out this repo: https://github.com/mcliment/f1blog-archived/ -there are taxonomies per year defined in config.toml and in every post there's the corresponding frontmatter information-.

The resulting site is here: http://f1blog.climens.net/ with most of the things I had in Wordpress.

@22decembre

This comment has been minimized.

Copy link

22decembre commented Apr 14, 2018

I am keeping an eye on that as I wish to use it. (I am sad I don't understand much of the code, it's way too abstract to me.)

@bep bep modified the milestones: v0.40, v0.41 Apr 20, 2018

@bep bep modified the milestones: v0.41, v0.42 May 4, 2018

@TotallyInformation

This comment has been minimized.

Copy link

TotallyInformation commented May 5, 2018

Really hoping you can come up with a simple to use solution for this as I'm finding it a frustration with Hugo which otherwise I'm loving.

The use of a taxonomy is not scalable but the idea of having something similar to pagination would work for me I think.

Apologies that I don't know GoLang so I'm not able to contribute code here.

@bep bep modified the milestones: v0.42, v0.43 Jun 5, 2018

@bep bep modified the milestones: v0.43, v0.44 Jun 30, 2018

@bep bep modified the milestones: v0.44, v0.45, v0.46 Jul 10, 2018

@bep bep modified the milestones: v0.46, v0.47, v0.48 Aug 3, 2018

@bep bep modified the milestones: v0.48, v0.49 Aug 22, 2018

@bep bep modified the milestones: v0.49, v0.50 Sep 13, 2018

@bep bep modified the milestones: v0.50, v0.51 Oct 6, 2018

@bep bep modified the milestones: v0.51, v0.53 Nov 8, 2018

@bep bep modified the milestones: v0.53, v0.54 Dec 6, 2018

@bep bep modified the milestones: v0.54, v0.55 Dec 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment