Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
/ php-slimdown Public archive

Slimdown is a simple library to allow you to easily add static pages to your app via a folder full of Markdown files.

License

Notifications You must be signed in to change notification settings

APMG/php-slimdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slimdown

PLEASE NOTE: This library is deprecated and no longer supported.

Slimdown is a simple library to allow you to easily add static pages to your app via a folder full of Markdown files.

Justin Heideman conceived and built the original version.

Build Status

Installation

Add this library to your application's composer.json:

{
    "require": {
        "apmg/slimdown": "*"
    }
}

And then execute:

$ composer update

Usage

To add to your app, in the method that handles the static pages, add code to load the page.

class SlimdownController extends ApplicationController {
  public function show() {
    $page = \Slimdown\Page::find($params['slug']);
  }
}

Then add a view for the show action.

{$page->body}

Add a globbing route to direct all unhandled requests to your controller. Make sure that it doesn't supersede other routes.

Finally, add configuration to set the path to your pages. This could be done as part of a bootstrapping routine.

\Slimdown\Slimdown::config(function($config){
  $config->set_location('lib/pages');
});

General notes

The use case for us is that we have a distinct repo containing the markdown (and some other files) which is editable by producers. This is autodeployed to a location on our servers which is accessible from our PHP app.

Development

After checking out the repo, run composer install to install dependencies.

Contributing

  1. Fork it ( https://github.com/apmg/php-slimdown/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

Slimdown is a simple library to allow you to easily add static pages to your app via a folder full of Markdown files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published