punch-blog-content-handler

0.0.9 • Public • Published

Punch Blog Content Handler

A special content handler to manage a blog with Punch.

How to Use

  • Install the package:

    npm install punch-blog-content-handler

  • Open your Punch project's configurations (config.json) and add the following:

     "plugins": {
     	"content_handler": "punch-blog-content-handler"
     }
  • You can use blog section to provide blog specific configurations.

     "blog": {
     	"posts_dir": "posts",
     	"post_format": "markdown",
     	"post_url": "/{year}/{month}/{date}/{title}",
     	"archive_urls": {
     		"all": "/archive",
     		"year": "/{year}",
     		"year_month": "/{year}/{month}",
     		"year_month_date": "/{year}/{month}/{date}",
     		"tag": "/tag/{tag}"
     	}
     }
  • posts_dir - directory within the project, where your posts are saved. ( default: posts )

  • post_format - Punch will use the available parser for the given format to convert your posts to HTML. ( default: markdown )

  • post_url - You can use the following tags to compose the desired post permalink - {year}, {month}, {date} & {title}. ( default: /{year}/{month}/{date}/{title} )

  • archive_url - URLs to be used for different archive sections. Following archive sections are available.

    • all - to show all published posts. ( default: /archive )
    • year - to show posts published in the given year. ( default: /{year} )
    • year_month - to show posts published in the given month in the year. ( default: /{year}/{month} )
    • year_month_date - to show posts published in the given date. ( default: /{year}/{month}/{date} )
    • tag - to show posts tagged with the given tag. ( default: /tag/{tag} )

Note that content handler will create only the necessary URLs for the above archive pages. You will need to create a helper to fetch the matching posts.

License

Copyright (c) 2012 Lakshan Perera Licensed under the MIT license.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.9
    2
    • latest

Version History

Package Sidebar

Install

npm i punch-blog-content-handler

Weekly Downloads

2

Version

0.0.9

License

none

Last publish

Collaborators

  • laktek