hexojs / hexo-generator-archive

Archive generator plugin for Hexo.
MIT License
37 stars 18 forks source link

404 only for archive page? #215

Open CookieHCl opened 1 year ago

CookieHCl commented 1 year ago

Hi, I recently started using Hexo and Next with GitHub Pages!

Hexo has a cool archive feature where if you go to myblog.com/archives/2023, you can see all the posts you wrote in 2023! However, if there are no posts wrote in 2022, myblog.com/archives/2022 will show a 404 page.

I made the 404 page to be "page not found", but I think it's misleading to have a "page not found" when you're searching for posts written in specific date.

Is it possible to create a special 404 page only for archives that shows "no posts" instead of a generic 404 page "page not found"?

tomap commented 1 year ago

It might be possible if you specified to this plugin to use a fixed time range instead of determining it based upon the posts dates. This is something to code of course