Giter Site home page Giter Site logo

jekyll-archive's People

Contributors

itafroma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

jekyll-archive's Issues

Do not pollute default Jekyll variables

Currently, JAG replaces page.date with a hash containing a value and a pattern. This should be filled with what Jekyll users expect: just the date.

Anything JAG-specific should be contained in its own variable: let's use page.archive.

Feature request: previous and next archive links

Hello again,

Not sure if this is the right place to make feature request, but is it possible to extend this plugin so that archive pages can have links to their previous and next day/month/year? Or is there an easy way to do this with Jekyll/Liquid already without adapting this plugin?

(Forgive me, but I am new to Jekyll, and just learning how it all works and understanding what's possible. I also programme in so much as I copy and paste bits of code, cross my fingers and hoping that something works!)

Thanks!

Paul

paginator.posts contains the wrong information

According to Jekyll's pagination docs, paginator.posts should contain "a list of posts for the current page". However, JAG's paginator.posts contains a list of pages generated for the current page's archive type.

This should be corrected, but there is still value to having the list of archive pages generated. These should be added to a new attribute, paginator.pages.

Deprecate the paginator override and move the pager to page.archive

Jekyll's paginator is a good starting point, but it's clear it's designed for its specific use case and shows some cracks when translating it to JAG's use case (see #2, #5, and #6). Continuing to override paginator on archive layout pages is going to be confusing since JAG's paginator doesn't work exactly like Jekyll's paginator.

In keeping with #4, JAG's pager should be moved to within the page.archive Liquid object and named page.archive.pager.

Bug: JAG should ignore global `paginate` value

I figured out the issue with my archive pagination: I had paginate: 10 set in my _config.yml file. Not only does thus mean pagination advances by this value rather than +/- 1, but information about archives immediately proceeding/following is incorrect as well.

Shouldn’t JAG ignore this value?

archive: title: config value doesn’t generate content for {{ page.title }}

Hello Mark,

One of the shortcomings of Jekyll is that it doesn’t generate archive pages by default, leaving a lot of blogs with URLs that generate 404s. Your plugin has thankfully plugged that hole!

However, using the provided example template and config values, page.title is not generated for archive pages. I note that on your own site you create a datename variable (sourced from page.date.pattern), and that you don't have a title set up in your _config.yml. Is that the recommended use?

Thanks,

Paul

Provide a way to define arbitrary archive types

Currently, JAG hard defines three archive "types": all posts filtered by day, all posts filtered by month, and all posts filtered by year. For each archive type, it also hard defines the path and title.

This configuration probably covers 80% of the use-cases for archives, but it'd be cool if there was some more flexibility. I mentioned in #1 for example that on my website, the default path pattern suits me (YYYY/MM/DD), but I wanted a different date pattern for the archive titles (Month D, YYYY).

I think it'll require a new configuration schema to do this properly. The current archive nested mapping will be replaced with a collection of sequences, which each sequence corresponding to an archive type. To give an example, the current hardcoded archive types would be defined like so:

archive:
    - layout: archive
      path: /blog/:year/:month/:day
      title: Blog archive - :year/:month/:day
      exclude: ['projects']
    - layout: archive
      path: /blog/:year/:month
      title: Blog archive - :year/:month
      exclude: ['projects']
    - layout: archive
      path: /blog/:year
      title: Blog archive - :year
      exclude: ['projects']

(The top three could/should be pre-defined as defaults so you wouldn't have to type all that if you just want the 80% use case)

You could then customize each type however you'd like: want a different title, but just for the yearly archives? No problem!

Taking this one step farther, this new schema should allow for arbitrary collections of posts, not just all posts with a simple exclude filter. So exclude will become a nested mapping, with two keys—categories and tags—and will gain a complementary include nesting mapping with the same keys:

archive:
    - layout: archive
      path: /blog/:year/:month/:day
      title: Blog archive - :year/:month/:day
      exclude:
          tags: ['hidden']
      include:
          categories: ['blog']
    - layout: archive
      path: /blog/:year/:month
      title: Blog archive - :year/:month
      exclude:
          tags: ['hidden']
      include:
          categories: ['blog']
    - layout: archive
      path: /blog/:year
      title: Blog archive - :year
      exclude:
          tags: ['hidden']
      include:
          categories: ['blog']
    - layout: archive
      path: /projects/:year
      title: Project archive - :year
      include:
          categories: ['projects']

The logic with the include and exclude keys would be the following:

  • If include is missing, all posts will be included.
  • If include is present, only posts matching the include criteria will be included.
  • exclude is resolved after include.

For example, this would mean only posts in the blog category that do not have the hidden tag will be present in the archive type:

include:
    categories: ['blog']
exclude:
    tags: ['hidden']

Open question: should the path and title keys only support Jekyll's permalink tokens? There's not a lot of flexibility with them, but they are what everyone knows. Alternatively, it'd be cool to just support whatever Ruby's DateTime.strftime supports. Maybe do both?

Provide more robust filtering

Splitting off from #3, JAG should have more robust filtering now that you can have more than one archive. The idea is that exclude will become a nested mapping, with two keys—categories and tags—and will gain a complementary include nesting mapping with the same keys:

archive:
    - layout: archive
      path: /blog/:year/:month/:day
      title: Blog archive - :year/:month/:day
      exclude:
          tags: ['hidden']
      include:
          categories: ['blog']
    - layout: archive
      path: /blog/:year/:month
      title: Blog archive - :year/:month
      exclude:
          tags: ['hidden']
      include:
          categories: ['blog']
    - layout: archive
      path: /blog/:year
      title: Blog archive - :year
      exclude:
          tags: ['hidden']
      include:
          categories: ['blog']
    - layout: archive
      path: /projects/:year
      title: Project archive - :year
      include:
          categories: ['projects']

The logic with the include and exclude keys would be the following:

  • If include is missing, all posts will be included.
  • If include is present, only posts matching the include criteria will be included.
  • exclude is resolved after include.

For example, this would mean only posts in the blog category that do not have the hidden tag will be present in the archive type:

include:
    categories: ['blog']
exclude:
    tags: ['hidden']

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.