Giter VIP home page Giter VIP logo

docpad-plugin-navlinks's Introduction

NavLinks Plugin for DocPad

Build Status NPM version Dependency Status Development Dependency Status

Adds the ability to generate a navigation bar for documents with links to the next and previous document of a specified collection for DocPad.

Install

  • Use: require('docpad-plugin-navlinks')
  • Install: npm install --save docpad-plugin-navlinks

Usage

The purpose of this plugin is to generate a navigation bar for documents with links to the next and previous document of a specified collection. Useful especially for posts.

Setup

Edit the docpad.coffee configuration file.

Identify one o more collections you want add navbar links in the

  collections:
    pages: (database) ->
      database.findAllLive({pageOrder: $exists: true}, [pageOrder:1,title:1])
    posts: (database) ->
      database.findAllLive({layout:$has:'post'}, [date:-1])

Define collections you want to enable navbar links. You may also specifies collection sorting (-1 for reverse order).

  # Plugins configurations
  plugins:
    navlinks:
      collections:
        posts: -1
        pages: 1

In the eco template (i.e. post.html.eco) add:

    <%- @getNavLinks() %>

You may style the navlinks usign the following css classes:

.navlinks {}

.navlinks-prev {
    float: left;
}

.navlinks-next {
    float: right;
}

History

Discover the change history by heading on over to the HISTORY.md file.

Contribute

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

Backers

Maintainers

These amazing people are maintaining this project:

Sponsors

No sponsors yet! Will you be the first?

Contributors

These amazing people have contributed code to this project:

Become a contributor!

License

Licensed under the incredibly permissive MIT license

Copyright ยฉ Luca Corbo [email protected] (http://lucor.github.io)

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.