Skip to content

gnugat-legacy/carew-next

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Carew - next

This Carew plugin adds two new functions:

  • next_document()
  • previous_document()

With these, you'll be able to automatically have links pointing to the next and previous pages:

{% block content_main %}
    {{ carew.document.body|raw }}

    <ul>
        {% set next = next_document(carew.posts, carew.document) %}
        {% if next %}
        <li>Next: <a href="{{ render_document_path(next) }}">{{ next.title }}</a></li>
        {% endif %}

        {% set previous = previous_document(carew.posts, carew.document) %}
        {% if previous %}
        <li>Previous: <a href="{{ render_document_path(previous) }}">{{ previous.title }}</a></li>
        {% endif %}
    <ul>
{% endblock %}

Installation

Use Composer:

composer require "gnugat/carew-next:~1.0"

Then register the plugin:

engine:
    extensions:
        - Gnugat\CarewNext\NextExtension

Further documentation

You can see the current and past versions using one of the following:

You can find more documentation at the following links:

About

[DEPRECATED] Carew Plugin: adds functions to get next/previous document

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages