Coder Social home page Coder Social logo

smula's Introduction

smula

Minimal framework for Markdown powered websites

Requirements

  • Parsedown
  • Twig

Written in PHP

Easily extendable with new controllers, just run smula make:controller NameController to generate a NameController.

Routing

You can add routes to the file /app/routes.php.

Example routes

// Manually passing data to the view
Route::get('/', function() {
    $files = Posts::allTidy();
    return View::render('home', ['CONTENT' => '_Smula_', 'FILES' => $files]);
});

// Passing a post to the view
Route::get('/p/{post}', function($data) {
    $post = Posts::get($data);
    return View::render('post', $post);
});

// A pages route
Route::get('/about', function() {
    $page = Pages::get('about');
    return View::render('page', $page);
});

Posts

Posts can be put in the /posts folder. The naming convention is YYYYMMDD-name-of-your-post.md. These will be automatically be picked up by the post controller and displayed new -> old order.

Example filename: 20170225-example-post.md

Example post:

title:Example

content:
##This is an example

With some text, followed by a code block

```php
public function andCode()
{
    return success;
}
`` // should be one more ` here
And here is a gist included in the post

gist:461cc93eb75bfb123235

Pages

Specific pages can be put in the /pages folder. For example an about page can be useful here.

smula's People

Contributors

iszla avatar

Watchers

James Cloos avatar

smula's Issues

Creation time does not exist

Creation time of files are not available in Linux.

Parse md file name to get the date from the name as post date

Clean up in src

Clean up files that are not necessary for the base template when main development has finished

Add pagination

Add the possibility to easily use pagination, with a config variable to set the count of posts per page

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.