Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sommerregen committed Feb 21, 2015
2 parents 8d7f857 + 2f72241 commit ef720c4
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 46 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# v1.1.0
## 02/21/2015

1. [](#new)
* Implemented new `param_sep` variable from Grav 0.9.18
2. [](#improved)
* Refactored code, fixed INSTALL.md

# v1.0.2
## 02/05/2015

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Installing or updating the `Archive Plus` plugin can be done in one of two ways.

/your/site/grav/user/plugins/archive_plus

For more informations, please check the [Installation and update guide](INSTALL.md).
For more informations, please check the [Installation and update guide](docs/INSTALL.md).

## Usage

Expand Down Expand Up @@ -75,13 +75,13 @@ You can now edit the override and tweak it however you prefer.
## Contributing

You can contribute at any time! Before opening any issue, please search for existing issues and review the [guidelines for contributing](CONTRIBUTING.md).
You can contribute at any time! Before opening any issue, please search for existing issues and review the [guidelines for contributing](docs/CONTRIBUTING.md).

After that please note:

* If you find a bug or would like to make a feature request or suggest an improvement, [please open a new issue][issues]. If you have any interesting ideas for additions to the syntax please do suggest them as well!
* Feature requests are more likely to get attention if you include a clearly described use case.
* If you wish to submit a pull request, please make again sure that your request match the [guidelines for contributing](CONTRIBUTING.md) and that you keep track of adding unit tests for any new or changed functionality.
* If you wish to submit a pull request, please make again sure that your request match the [guidelines for contributing](docs/CONTRIBUTING.md) and that you keep track of adding unit tests for any new or changed functionality.

### Support and donations

Expand Down
46 changes: 11 additions & 35 deletions archive_plus.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Archive Plus v1.0.2
* Archive Plus v1.1.0
*
* An enhanced version of the Grav Archives plugin with more
* configuration options and the ability to show a blogger-like
Expand All @@ -9,24 +9,22 @@
* Licensed under MIT, see LICENSE.
*
* @package Archive Plus
* @version 1.0.2
* @version 1.1.0
* @link <https://github.com/sommerregen/grav-plugin-archive-plus>
* @author Benjamin Regler <sommergen@benjamin-regler.de>
* @author Benjamin Regler <sommerregen@benjamin-regler.de>
* @copyright 2015, Benjamin Regler
* @license <http://opensource.org/licenses/MIT> MIT
*/

namespace Grav\Plugin;

use Grav\Common\Plugin;
use Grav\Common\Grav;
use Grav\Common\Page\Collection;
use Grav\Common\Page\Page;
use Grav\Common\Debugger;
use Grav\Common\Plugin;
use Grav\Common\Taxonomy;
use Grav\Common\Page\Page;
use Grav\Common\Page\Collection;
use RocketTheme\Toolbox\Event\Event;


/**
* Archive Plus Plugin
*
Expand Down Expand Up @@ -98,7 +96,6 @@ public function onTwigTemplatePaths() {
public function onPageProcessed(Event $event) {
// Get the page header
$page = $event['page'];
$header = $page->header();
$taxonomy = $page->taxonomy();

if (!isset($taxonomy['archive'])) {
Expand Down Expand Up @@ -130,7 +127,6 @@ public function onTwigSiteVariables() {

// Initialize variables
$id = $this->grav['page']->id();
$this->mergeConfig($this->grav['page']);

$archives = array();
$current = NULL;
Expand Down Expand Up @@ -207,39 +203,19 @@ public function onTwigSiteVariables() {
}
}

// Get configurations of archive_plus plugin
// Get configurations of Archive Plus plugin
$config = (array) $this->config->get('plugins.archive_plus');

$config['data'] = $archives;
$config['current'] = $current;
$config['show_more'] = $show_more;

// Add the archives configurations to the twig variables
// Add Archive Plus configurations to the twig variables
$this->grav['twig']->twig_vars['archive_plus'] = $config;

// Inject built in CSS if desired
if ( $this->config->get('plugins.breadcrumbs.built_in_css') ) {
$this->grav['assets']->add('plugin://archive_plus/css/archive_plus.css');
}
}

/** -------------------------------
* Private/protected helper methods
* --------------------------------
*/

/**
* Merge global and page configurations.
*
* @param Page $page The page to merge the configurations with the
* plugin settings.
*/
protected function mergeConfig(Page $page) {
$defaults = (array) $this->config->get('plugins.archive_plus');
if ( isset($page->header()->archive_plus) ) {
$this->config->set('plugins.archive_plus',
array_merge($defaults, $page->header()->archive_plus)
);
// Inject built-in CSS if desired
if ( $this->config->get('plugins.archive_plus.built_in_css') ) {
$this->grav['assets']->add('plugin://archive_plus/assets/css/archive_plus.css');
}
}
}
File renamed without changes.
4 changes: 2 additions & 2 deletions blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Archive Plus
version: 1.0.2
version: 1.1.0
description: "The **Archive Plus** plugin is an enhanced version of the [Grav Archives plugin](https://github.com/getgrav/grav-plugin-archives) with more configuration options and the ability to show a blogger like hierarchical archive menu for links grouped by month and/or year."
icon: university
author:
name: Sommerregen
email: [email protected]
homepage: https://github.com/sommerregen/grav-plugin-archive-plus
docs: https://github.com/sommerregen/grav-plugin-archive-plus/blob/master/README.md
keywords: archive, plugin, blog, month, year, date, navigation, history
keywords: [archive, plugin, blog, month, year, date, navigation, history]
bugs: https://github.com/sommerregen/grav-plugin-archive-plus/issues
license: MIT

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions INSTALL.md → docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Installing the `Archive Plus` plugin can be done in one of two ways. The GPM (Gr

The simplest way to install this plugin is via the [Grav Package Manager (GPM)](http://learn.getgrav.org/advanced/grav-gpm) through your system's Terminal (also called the command line). From the root of your Grav install type:

bin/gpm install mathjax
bin/gpm install archive_plus

This will install the `Archive Plus` plugin into your `/user/plugins` directory within Grav. Its files can be found under `/your/site/grav/user/plugins/archive_plus`.

Expand All @@ -19,7 +19,7 @@ To install this plugin, just download the zip version of this repository and unz

You should now have all the plugin files under

/your/site/grav/user/plugins/archive_plus
/your/site/grav/user/plugins/archive_plus

>> NOTE: This plugin is a modular component for Grav which requires [Grav](http://github.com/getgrav/grav), the [Error](https://github.com/getgrav/grav-plugin-error) and [Problems](https://github.com/getgrav/grav-plugin-problems) plugins, and a theme to be installed in order to operate.
Expand All @@ -31,7 +31,7 @@ As development for `Archive Plus` continues, new versions may become available t

The simplest way to update this plugin is via the [Grav Package Manager (GPM)](http://learn.getgrav.org/advanced/grav-gpm). You can do this with this by navigating to the root directory of your Grav install using your system's Terminal (also called command line) and typing the following:

bin/gpm update mathjax
bin/gpm update archive_plus

This command will check your Grav install to see if your `Archive Plus` plugin is due for an update. If a newer release is found, you will be asked whether or not you wish to update. To continue, type `y` and hit enter. The plugin will automatically update and clear Grav's cache.

Expand All @@ -41,7 +41,7 @@ Manually updating `Archive Plus` is pretty simple. Here is what you will need to

* Delete the `your/site/user/plugins/archive_plus` directory.
* Downalod the new version of the Archive Plus plugin from either [GitHub](https://github.com/sommerregen/grav-plugin-archive-plus) or [GetGrav.org](http://getgrav.org/downloads/plugins#dropcaps).
* Unzip the zip file in `your/site/user/plugins` and rename the resulting folder to `Archive Plus`.
* Unzip the zip file in `your/site/user/plugins` and rename the resulting folder to `archive_plus`.
* Clear the Grav cache. The simplest way to do this is by going to the root Grav directory in terminal and typing `bin/grav clear-cache`.

>> Note: Any changes you have made to any of the files listed under this directory will also be removed and replaced by the new set. Any files located elsewhere (for example a YAML settings file placed in `user/config/plugins`) will remain intact.
4 changes: 2 additions & 2 deletions templates/partials/archive_plus.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<label for="input-archive-{{ year_index }}"></label>
{% endif %}

<a href="{{ base_url }}/archive:{{ year|e('url') }}">
<a href="{{ base_url }}/archive{{ config.system.param_sep }}{{ year|e('url') }}">
<span class="archive_year">{{ year }}</span>
</a>

Expand Down Expand Up @@ -62,7 +62,7 @@
<label for="input-archive-{{ year_index }}-{{ loop.index }}"></label>
{% endif %}

<a href="{{ base_url }}/archive:{{ month|date('M_Y')|lower|e('url') }}">
<a href="{{ base_url }}/archive{{ config.system.param_sep }}{{ month|date('M_Y')|lower|e('url') }}">
<span class="archive_month">{{ month }}</span>
</a>

Expand Down

0 comments on commit ef720c4

Please sign in to comment.