GithubHelp home page GithubHelp logo

jekyll-archive-page's Introduction

Jekyll Archives

A really simple Jekyll plugin for building an archive page.

For an example page, see http://www.philnewton.net/blog/archives/.

Usage

  • Copy the archive_page.rb file into your Jekyll plugins directory
  • Copy the page-archives.html file into your _layouts directory
  • Update your configuration file with the desired location of your archive page.

Example Configuration Value

_config.yml

archive_path: blog/archives/

This will create an archive file at /blog/archives/index.html.

Licence

jekyll-archive-page - A simple archive plugin for Jekyll

Copyright (C) 2013 Phil Newton

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

jekyll-archive-page's People

Contributors

sodaware avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

jekyll-archive-page's Issues

Deprecation: posts.[] should be changed to posts.docs.[].

When I applied the plugin, it shows error during bundle exec jekyll serve with the detail as followings:

      Generating...
       Deprecation: posts.[] should be changed to posts.docs.[].
                    Called by /SOURCEDIR/_plugins/archive_page.rb:49:in `get_grouped_posts'.
jekyll 3.1.6 | Error:  undefined method `year' for #<Jekyll::Document:0x2a182ef8>

Deprecation is pointing to the codes in this function:

    def get_grouped_posts
      
      # Get date of first post
start_year = site.posts[0].year
                          ^^^^^^^^

version:

$ jekyll --version
jekyll 3.1.6

Please kindly look it up?

Reference:
http://stackoverflow.com/questions/24179283/get-jekyll-posts-by-year
http://stackoverflow.com/questions/19086284/jekyll-liquid-templating-how-to-group-blog-posts-by-year

Liquid Warning: Expected dotdot but found pipe...

On build in Jekyll I'm seeing...

Liquid Warning: Liquid syntax error (line 25): Expected dotdot but found pipe in "{{(page.grouped_posts[year][month] | size) }}" in archives/index.html
    Liquid Warning: Liquid syntax error (line 40): Expected dotdot but found pipe in "{{(page.grouped_posts[year][month] | size) }}" in archives/index.html

It still builds correctly but after some Googling, I can't figure out how to fix that. Recommendations welcome. Using jekyll 3.8.5.

Error: undefined method `year' for #<Jekyll::Document:0x29590154>

Is using version:

$ jekyll --version
jekyll 3.3.1

And now facing "Error: undefined method `year' for #Jekyll::Document:0x29590154"
bundle exec output is:

Generating...
jekyll 3.3.1 | Error:  undefined method `year' for #<Jekyll::Document:0x295901b8>

I don't understand the error message myself, assuming the method.year is not object .year?
Perhaps different naming is needed? This one is not related to depreciation.

Affected codes:

    def get_grouped_posts
      
      # Get date of first post
      start_year = site.posts.docs.first.year
      end_year   = Date.today.year
      
      years      = (start_year .. end_year).to_a
      post_map   = {}
      
      for year in years
         ^^^^^
        post_map[year] = Hash.new
        
        for month in (1..12)
          post_map[year][month] = Array.new
        end
        
      end
      
      # Add each post
      site.blog_posts.each do |post|
        post_map[post.year][post.month] << post
      end
      
      return post_map
      
    end

Thank's in advance!

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.