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

Open
yacoob opened this issue Aug 29, 2014 · 23 comments
Open

Add ability to generate per-{year, month, day} archives #448

yacoob opened this issue Aug 29, 2014 · 23 comments
Assignees
Milestone

Comments

@yacoob
Copy link
Contributor

@yacoob 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? :)

@yacoob
Copy link
Contributor Author

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

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

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

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

@spf13 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 removed this from the v0.13 milestone Feb 22, 2015
@spf13 spf13 added this to the v0.14 milestone Feb 22, 2015
@spf13 spf13 added this to the v0.14 milestone Feb 22, 2015
@spf13 spf13 removed this from the v0.13 milestone Feb 22, 2015
@anthonyfok anthonyfok added this to the v0.15 milestone Sep 16, 2015
@anthonyfok anthonyfok removed this from the v0.14 milestone Sep 16, 2015
@anthonyfok anthonyfok added this to the v0.16 milestone Nov 30, 2015
@anthonyfok anthonyfok removed this from the v0.15 milestone Nov 30, 2015
@matrixik
Copy link

@matrixik matrixik commented Dec 10, 2015

@moorereason moorereason added this to the future milestone May 7, 2016
@moorereason moorereason removed this from the v0.16 milestone May 7, 2016
@AriaFallah
Copy link

@AriaFallah AriaFallah commented Jun 30, 2016

Any progress on this or workarounds?

@vielmetti
Copy link
Contributor

@vielmetti vielmetti commented Feb 27, 2017

Any ideas on this one?

@yacoob
Copy link
Contributor Author

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

@mcliment 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.

@bep bep removed this from the v0.76 milestone Oct 6, 2020
@bep bep added this to the v0.77 milestone Oct 6, 2020
@bep bep removed this from the v0.77 milestone Oct 30, 2020
@bep bep added this to the v0.78 milestone Oct 30, 2020
@bep bep removed this from the v0.78 milestone Apr 23, 2021
@bep bep added this to the v0.83 milestone Apr 23, 2021
@bep bep removed this from the v0.83 milestone May 1, 2021
@bep bep added this to the v0.84 milestone May 1, 2021
@bep bep removed this from the v0.84 milestone Jun 18, 2021
@bep bep added this to the v0.85 milestone Jun 18, 2021
@bep bep removed this from the v0.85 milestone Jul 5, 2021
@bep bep added this to the v0.86 milestone Jul 5, 2021
@bep bep removed this from the v0.86 milestone Jul 26, 2021
@bep bep added this to the v0.87 milestone Jul 26, 2021
@bep bep removed this from the v0.87 milestone Jul 30, 2021
@bep bep added this to the v0.88 milestone Jul 30, 2021
@bep bep removed this from the v0.88 milestone Sep 2, 2021
@bep bep added this to the v0.89 milestone Sep 2, 2021
@bep bep removed this from the v0.89 milestone Nov 2, 2021
@bep bep added this to the v0.90 milestone Nov 2, 2021
@asmaier
Copy link

@asmaier asmaier commented Nov 12, 2021

We have 2021 and this ticket is now open for seven years (and so it is the oldest ticket still open here). It is surprising for a newcomer to hugo to see such a basic functionality missing given that hugo has no problems auto-generating pages for tags and categories. And it is not that this feature isn't needed. The internet is full of workarounds to this problem:

I collected these just to underline the need for this feature. It would be very nice if you could consider giving this feature a higher priority. I think hugo should not release v1.0 before it hasn't implemented automatic generation of a per-{year, month, day} archive if hugo wants to be a relevant framework for bloggers.

@jmooring
Copy link
Member

@jmooring jmooring commented Nov 12, 2021

@asmaier

Thank you for this list.

Although their approaches may be imperfect, to characterize the authors' efforts and generosity as "half baked" is... unfortunate.

@asmaier
Copy link

@asmaier asmaier commented Nov 12, 2021

Sorry, I did not mean to belittle the work of the authors of these solutions. English it not my mother tongue. I edited my post and now call these solutions workarounds. I hope that is a more neutral description.

@bep bep removed this from the v0.90 milestone Dec 8, 2021
@bep bep added this to the v0.91.0 milestone Dec 8, 2021
@bep bep removed this from the v0.91.0 milestone Dec 20, 2021
@bep bep added this to the v0.92.0 milestone Dec 20, 2021
@President
Copy link

@President President commented Dec 23, 2021

Any news here? Will this be implemented. This is a blocker issue!

@bep bep removed this from the v0.92.0 milestone Jan 12, 2022
@bep bep added this to the v0.93.0 milestone Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet