jekyll-archives icon indicating copy to clipboard operation
jekyll-archives copied to clipboard

Produces empty title for year/month/day

Open tbm opened this issue 7 years ago • 5 comments

jekyll-archives produces an empty "

" element for year/month/day pages. It seems this is intentional: <pre><code> # Returns a String (for tag and category archives) and nil for # date-based archives. def title @title if @title.is_a? String end </code></pre> <p>This is quite ugly though. Firefox, for example, will display the URL if the title is not set. Why not set a title like "Archive for year yyyy", "Archive for month ... of year yyyy", etc. Or easier to implement: "Archive for" and then append, year, month, day (whatever is available).</p>

tbm avatar Apr 26 '18 19:04 tbm

I’m generally not a fan of mixing Liquid and YAML, but in this instance it really would be very handy to just let the user specify an archives.title in _config.yml for us to parse as Liquid and use.

This would also allow users to format the date in a way that makes sense for their own site.

pathawks avatar Apr 26 '18 21:04 pathawks

You can already specify a title using the layouts. I do that for my yearly archives:

title: {{ page.date | date: "%Y" }}

Exagone313 avatar Jun 04 '18 09:06 Exagone313

You can already specify a title using the layouts. I do that for my yearly archives:

title: {{ page.date | date: "%Y" }}

This doesn't work. You can't use Liquid in the front matter.

janosrusiczki avatar Dec 14 '22 11:12 janosrusiczki

This doesn't work. You can't use Liquid in the front matter.

This is a post from 5 years ago. I no longer use this plugin.

EDIT: I removed it a year ago in my blog and I had Jekyll version 4.1 at that time. Things might have changed in newer releases.

Exagone313 avatar Dec 14 '22 12:12 Exagone313

@Exagone313 There was a plugin which permitted what you said, but it doesn't work with newer releases of Jekyll. Anyway, sorry, my first comment might have sounded a little aggressive, I'm just researching this topic and I might come with a fork / PR fork for this repo which permits some sort of title generation for date based archives.

janosrusiczki avatar Dec 14 '22 12:12 janosrusiczki