Simple markdown blog for 12in12 apps

v2.1.0 2024-10-25 11:07 UTC

This package is auto-updated.

Last update: 2025-03-24 21:31:15 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Installation

You can install the package via composer:

composer require stumason12in12/blog

You can publish and run the migrations with:

php artisan vendor:publish --tag="blog-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="blog-config"

Config

<?php

return [
    'storage_disk' => 'blog',
    'default_author' => 'Stu Mason',
    'words_per_minute' => 200,
];

and then in file system, add the blog disk:

    'disks' => [

        'blog' => [
            'driver' => 'local',
            'root' => storage_path('app/blog'),
        ],

        'local' => [
            'driver' => 'local',
            'root' => storage_path('app/private'),

Creating posts

update Storage/app/.gitignore to include blog:

*
!private/
!public/
!blog/
!blog/*
!.gitignore

Create markdown files in the blog directory:

./storage/app/blog - markdown files go here.

If you don't want the file being synced with the database, add draft to the filename.

Routes

/blog - index of blog posts. /blog/{slug} - view a single blog post. /blog-sync - get markdown files that don't have draft in their name and sync them with the database.

Not sure what to do with views yet, so for now, the controller just expects them to exist... will update eventually when I know what I'm doing.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.