sharkpp/sculpin-calendarian-bundle

This is a Bundle that generates the index page to blog date directory for Sculpin.

Installs: 145

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Type:sculpin-bundle

pkg:composer/sharkpp/sculpin-calendarian-bundle

dev-master 2016-09-03 06:35 UTC

This package is not auto-updated.

Last update: 2025-10-01 14:52:18 UTC


README

日本語 ENGLISH

What is this?

This is a Bundle that generates the index page to blog date directory for Sculpin.

Setup

Add this bundle in your sculpin.json file:

{
    // ...
    "require": {
        // ...
        "sharkpp/sculpin-calendarian-bundle": "dev-master"
    }
}

and install this bundle running sculpin update.

Now you can register the bundle in SculpinKernel class available on app/SculpinKernel.php file:

<?php

class SculpinKernel extends \Sculpin\Bundle\SculpinBundle\HttpKernel\AbstractKernel
{
    protected function getAdditionalSculpinBundles()
    {
        return array(
           'Sharkpp\Sculpin\Bundle\CalendarianBundle\SculpinCalendarianBundle'
        );
    }
}

How to use

For example, create a source/blog/date.html file:

---
generator: calendarian
---

<h2>
{% if page.calendarian.year %}{{ page.calendarian.year }}-{% endif %}
{% if page.calendarian.month %}{{ page.calendarian.month }}-{% endif %}
{% if page.calendarian.day %}{{ page.calendarian.day }}-{% endif %}
</h2>

<ul>
    {% for item in page.calendarian.items %}
        <li><a href="{{ item.url }}">{{ item.title }}</a></li>
    {% endfor %}
</ul>

By creating in such content, and http://your.site.url/blog/2015/08/09/hoge.html, when there is such a page, the page is created based on the content that was created to http://your.site.url/blog/2015/ and http://your.site.url/blog/2015/08/ and http://your.site.url/blog/2015/08/09/, it can be accessed.

License

© 2015 sharkpp

This software is released under the MIT License, see LICENSE.