Code Monkey home page Code Monkey logo

jekyll-monthly-archive-plugin's Introduction

Monthly archive plugin for Jekyll

Generate a monthly archive much like MovableType does.

This code is based on following hacks:

Installation

To use this plugin,

  • Place _plugins/monthly_archive_plugin.rb into _plugins directory of Jekyll site working directory.

  • Copy _layouts/monthly_archive.html into _layouts directory of Jekyll site working directory, then edit it appropriately.

Parameter configuration

Archive layout can be specified by layout key in the monthly_archive site configuration. Default is monthly_archive.

Archive generation directory prefix can be specified by path key in the monthly_archive site configuration. If specified, archive will be generated in PATH/YYYY/MM/index.html, where PATH is substituted by path, YYYY and MM are year and month. Default is null string.

Liquid variables for template

page.year, page.month contains the year and month of the archive page.

page.date also contains date (page.year/page.month/1)

Copyright

The MIT License (MIT)

Copyright (c) 2013 Shigeya Suzuki

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

jekyll-monthly-archive-plugin's People

Contributors

shigeya avatar z3bi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

jekyll-monthly-archive-plugin's Issues

Link URL not being generated

Hi,

I've installed this plugin on my Jekyll website, it generates the archive page, the header now contains a link on the top with the words "Monthly archive for 2014/7" but the href property of the anchor is left blank.

I'm using ruby 2.0.0p451 and jekyll 2.1.1

Thanks,
Marco Lopes

The header gets large with 15 years of material

With material from several years the header of the default Jekyll layout gets flooded with "Monthly archive for YYYY/M" links.

Monthly archive for 2000/10 thru 2014/11

What is the recommended way to avoid this? Maybe generate a listing for each year and link to that which in turn link to each month?

TypeError Thrown When Building

I am using generator-jekyllrb to power Jekyll during development. The Monthly Archive plugin causes Ruby to throw an error when building.

Running:

bundle exec jekyll build --source app --destination .jekyll --config _config.yml --trace

Causes:

/Users/XXX/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.3/lib/jekyll/page.rb:127:in `join': no implicit conversion of nil into String (TypeError)
  from /Users/XXX/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.3/lib/jekyll/page.rb:127:in `relative_path'
  from /Users/XXX/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.3/lib/jekyll/page.rb:122:in `path'
  from /Users/XXX/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.3/lib/jekyll/generators/pagination.rb:118:in `pagination_candidate?'
  from /Users/XXX/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.3/lib/jekyll/generators/pagination.rb:77:in `block in template_page'
  from /Users/XXX/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.3/lib/jekyll/generators/pagination.rb:76:in `select'
  from /Users/XXX/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.3/lib/jekyll/generators/pagination.rb:76:in `template_page'
  from /Users/XXX/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.3/lib/jekyll/generators/pagination.rb:17:in `generate'
  from /Users/XXX/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.3/lib/jekyll/site.rb:227:in `block in generate'
  from /Users/XXX/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.3/lib/jekyll/site.rb:226:in `each'
  from /Users/XXX/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.3/lib/jekyll/site.rb:226:in `generate'
  from /Users/XXX/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.3/lib/jekyll/site.rb:38:in `process'
  from /Users/XXX/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.3/lib/jekyll/command.rb:18:in `process_site'
  from /Users/XXX/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.3/lib/jekyll/commands/build.rb:23:in `build'
  from /Users/XXX/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.3/lib/jekyll/commands/build.rb:7:in `process'
  from /Users/XXX/.rvm/gems/ruby-2.1.0/gems/jekyll-1.4.3/bin/jekyll:77:in `block (2 levels) in <top (required)>'
  from /Users/XXX/.rvm/gems/ruby-2.1.0/gems/commander-4.1.6/lib/commander/command.rb:180:in `call'
  from /Users/XXX/.rvm/gems/ruby-2.1.0/gems/commander-4.1.6/lib/commander/command.rb:180:in `call'
  from /Users/XXX/.rvm/gems/ruby-2.1.0/gems/commander-4.1.6/lib/commander/command.rb:155:in `run'
  from /Users/XXX/.rvm/gems/ruby-2.1.0/gems/commander-4.1.6/lib/commander/runner.rb:422:in `run_active_command'
  from /Users/XXX/.rvm/gems/ruby-2.1.0/gems/commander-4.1.6/lib/commander/runner.rb:82:in `run!'
  from /Users/XXX/.rvm/gems/ruby-2.1.0/gems/commander-4.1.6/lib/commander/delegates.rb:8:in `run!'
  from /Users/XXX/.rvm/gems/ruby-2.1.0/gems/commander-4.1.6/lib/commander/import.rb:10:in `block in <top (required)>'

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.