Turaylon / Blog

A Blog module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blog module

Slack SensioLabsInsight Scrutinizer Code Quality Code Climate

Installation

Execute the following command in your terminal

composer require "asgardcms/blog-module"  "dev-develop"

Or add the package to your require key in the composer.json file:

"asgardcms/blog-module": "dev-develop"

Followed by a composer update

Note: After installation you'll have to give you the required permissions to get to the blog module pages in the backend.

Usage

  • You have to create a blog.index and blog.show page in your front end theme.
  • You can link to the blog index page using : route(locale() . '.blog')
  • In the blog index you'll have access to a $posts variable on which you can loop
  • To create a link to a specific post: route(locale() . '.blog.slug', [$post->slug])
  • On the blog index and blog show pages you'll have access to a $latestPosts variable containing the latest posts, this amount can be configured in the admin.
  • On a post detail page, you can have access to the next and previous post by calling:
    • $post->present()->previous
    • $post->present()->next

Resources

Info

All AsgardCMS modules respect Semantic Versioning.

About

A Blog module

License:Other


Languages

Language:PHP 87.6%Language:CSS 8.5%Language:JavaScript 3.8%