2017 © Pedro PelĂĄez
 

library blogdown

Simple Laravel blog package using markdown

image

swiftmade/blogdown

Simple Laravel blog package using markdown

  • Monday, June 4, 2018
  • by aozisik
  • Repository
  • 1 Watchers
  • 7 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Blogdown

Add a simple, flat-file markdown blog to your existing Laravel application., (*1)

Latest Version on Packagist Total Downloads GitHub Actions StandWithUkraine, (*2)

Install

You can install the package via composer:, (*3)

# Require it as a dependency
composer require swiftmade/blogdown

# Publish the config file
php artisan vendor:publish --provider "Swiftmade\Blogdown\BlogdownProvider"

Go to config/blogdown.php to configure authors (example included in the file)., (*4)

Post generator

Simply run this command to make a new article:, (*5)

php artisan blog:new

Follow the instructions, and you'll have your first blog post ready in seconds., (*6)

Anatomy of a post

Each post consists of a meta section (mandatory) and the content. You can use Markdown to enrich your post's format., (*7)

To use markdown inside blade, simply invoke @markdown / @endmarkdown. Or, you can also add .md extension before .blade.php and skip the markdown calls., (*8)

{{--
title: Hello World!
tags: blog, first post
date: 18.03.2020
--}}
Use blade to compose post content.

@markdown
**Or even use markdown** if you want.

### Isn't that great?
@endmarkdown

Draft vs Published

Let's say you're working on a long post and it's not production ready yet. Just do this:, (*9)

{{--
... other attributes
draft: true
--}}

... Your awesome content ...

Since you added the draft meta attribute, this post will be hidden in production environments., (*10)

Meta Attributes are Dynamic

You can declare as many meta attributes as you want., (*11)

{{--
random_attribute: 51231
--}}

You can access your post's meta attributes like so:, (*12)

$post->random_attribute; // 51231

Force Clear Cache

php artisan blog:index, (*13)

Customizing Blogdown

You can change most things about Blogdown. To get started, publish the config:, (*14)

php artisan vendor:publish  --provider "Swiftmade\Blogdown\BlogdownProvider"

Things you can customize, (*15)

  • Override views to change how your blog looks
  • Add list of authors to quickly load author meta
  • Format and content of post slugs
  • Enable/disable default routes.
  • Change date format.
  • And probably more...

Format and content of post slugs

By default, this is how a post's slug is built:, (*16)

public function slug()
{
    return Str::slug($this->view_name);
}

If needed, you can override the Post model and build a better slug:, (*17)

public function slug()
{
    return Str::slug($this->date->format('Y-m-d') . ' ' . $this->title);
}

Don't forget to register your custom Post model in config/blogdown.php!, (*18)

Pull Requests Are Welcome

If you want to see more features or report bugs feel free to open issues and send pull requests., (*19)

Contributors:, (*20)

The Versions

04/06 2018

dev-master

9999999-dev

Simple Laravel blog package using markdown

  Sources   Download

MIT

The Requires

 

by Ahmet Ozisik

04/06 2018

v1.2.0

1.2.0.0

Simple Laravel blog package using markdown

  Sources   Download

MIT

The Requires

 

by Ahmet Ozisik

21/05 2018

v1.1.1

1.1.1.0

Simple Laravel blog package using markdown

  Sources   Download

MIT

The Requires

 

by Ahmet Ozisik

13/03 2017

1.1.0

1.1.0.0

Simple Laravel blog package using markdown

  Sources   Download

MIT

The Requires

 

by Ahmet Ozisik

20/02 2017

1.0.0

1.0.0.0

Simple Laravel blog package using markdown

  Sources   Download

MIT

The Requires

 

by Ahmet Ozisik