Download the PHP package aheenam/mozhi without Composer
On this page you can find all versions of the php package aheenam/mozhi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aheenam/mozhi
More information about aheenam/mozhi
Files in aheenam/mozhi
Informations about the package mozhi
Do not use in production yet
Mozhi
The package provides a simple way to add a static files based CMS to your Laravel project. It uses Markdown files as the content provider and uses Laravel's Blade for templating.
Requirements
This package requires PHP 7.2
and a Laravel version >= 5.7
.
Installation
You can install the package via composer:
Configuration
Mozhi comes with a set of configuration possibilities, so make sure to check the config file's content:
All the keys are commented well enough, so the usage should not be too tough. If there is something not that clear, feel free to post an issue.
As you see all the config variables can be set using the env file, but if you want, you can also publish them to change the values.
Usage
After the setup all of your routes will be caught by Mozhi and the package will try to find the appropriate content file for it.
Consider the config as above and then a call to /blog/awesome-blog
. Now Mozhi will look for a file in storage/contents/blog/
that is named awesome-blog.md
.
If it is found, it will render the specified template of the currenty theme and pass the content and the header of the markdown file.
The MarkDown files are parsed using Spatie's awesome package called YAML Front Matter before parsing the markdown, so you can (and should decorate) your markdown files.
So in your template file you can use the $content
and the $meta
variables. First is the html of the content file and $meta
is an array of all header data specified in the Markdown file.
Note: If no template was specified it will fallback to the
default_theme
specified in the config.
Parsing Markdown
Mozhi uses the CommonMark implementation of The PHP League to parse Markdown to HTML. They offer a way to extend the specification. Mozhi uses the Table Extension by default, but you can manage all the extension by changing the markdown_extensions
array in the config.
Changelog
Check CHANGELOG for the changelog
Testing
To run tests use
$ composer test
Contributing
Security
If you discover any security related issues, please email [email protected] or use the issue tracker of GitHub.
About
Aheenam is a small company from NRW, Germany creating custom digital solutions. Visit our website to find out more about us.
License
The MIT License (MIT). Please see License File for more information.
All versions of mozhi with dependencies
spatie/yaml-front-matter Version ^2.0
illuminate/support Version ^5.7|^5.8
illuminate/routing Version ^5.7|^5.8
illuminate/http Version ^5.7|^5.8
league/commonmark Version ^0.16.0
webuni/commonmark-table-extension Version ^0.8.0