Commit 6153feef authored by nirgendswo's avatar nirgendswo

adding new comments

adding example for md-files
parent 2d989ea6
......@@ -73,6 +73,26 @@ This option is used to hide sites by calling them with their slug. You can use t
If this option is set true, the page will be ignored by any query function. A direct call by its slug will show the page. For example, the **404-Page** is hidden.
### 4.3 Example
This how can the index.md look like,
```
{
"title": "Home",
"meta": {
"description": "Fuzzy CMS - fast, simple and customizable"
},
"view": "page",
"type": "page"
}
# A flat fast CMS
## Build simple fast websites with Fuzzy CMS
This is a Simple Paragraph
```
## 5. ViewHelper
There are a few functions to help in the view.
......
......@@ -8,6 +8,8 @@ use Illuminate\Support\Facades\Facade;
* Facade for ImageHelper
*
* @author Björn Hase
* @license http://opensource.org/licenses/MIT The MIT License
* @link https://github.com/nirgendswo/fuzzy-cms GitHub Repository
*/
class ImageHelperFacade extends Facade
{
......
......@@ -8,6 +8,8 @@ use Illuminate\Support\Facades\Facade;
* Facade for PageParser
*
* @author Björn Hase
* @license http://opensource.org/licenses/MIT The MIT License
* @link https://github.com/nirgendswo/fuzzy-cms GitHub Repository
*/
class PageParserFacade extends Facade
{
......
......@@ -8,6 +8,8 @@ use Illuminate\Support\Facades\Facade;
* Facade for PageRepository
*
* @author Björn Hase
* @license http://opensource.org/licenses/MIT The MIT License
* @link https://github.com/nirgendswo/fuzzy-cms GitHub Repository
*/
class PageRepositoryFacade extends Facade
{
......
......@@ -8,6 +8,8 @@ use Illuminate\Support\Facades\Facade;
* Facade for ViewHelper
*
* @author Björn Hase
* @license http://opensource.org/licenses/MIT The MIT License
* @link https://github.com/nirgendswo/fuzzy-cms GitHub Repository
*/
class ViewHelperFacade extends Facade
{
......
......@@ -12,15 +12,45 @@ use Illuminate\Support\Facades\Log;
* @TODO Find a better Wsy to create Path, use more Function, checkout for a shortcut for public directory
*
* @author Björn Hase
* @license http://opensource.org/licenses/MIT The MIT License
* @link https://github.com/nirgendswo/fuzzy-cms GitHub Repository
*/
class ImageHelper
{
/**
* regex to find last dot in a string
* @var string
*/
const FIND_LAST_DOT = '/(\.[^.]+)$/';
/**
* underscore
* @var string
*/
const UNDERSCORE = '_';
/**
* replace for sprintf
* @var string
*/
const REPLACE = '%s$1';
/**
* namespace for width
* @var string
*/
const FILE_NAMESPACE_WIDTH = 'width';
/**
* namespace for height
* @var string
*/
const FILE_NAMESPACE_HEIGHT = 'height';
/**
* namespace for relative
* @var string
*/
const FILE_NAMESPACE_RELATIVE = 'relative';
/**
......@@ -50,7 +80,7 @@ class ImageHelper
*/
public function scale($relativePath, $percentage)
{
$destinationPath = $this->getFilePathname($relativePath, 'relative'.self::UNDERSCORE.$percentage);
$destinationPath = $this->getFilePathname($relativePath, self::FILE_NAMESPACE_RELATIVE.self::UNDERSCORE.$percentage);
$image = $this->has($destinationPath, $relativePath);
if ($image) {
......@@ -91,7 +121,7 @@ class ImageHelper
*/
public function resizeToHeight($relativePath, $height)
{
$destinationPath = $this->getFilePathname($relativePath, 'height'.self::UNDERSCORE.$height);
$destinationPath = $this->getFilePathname($relativePath, self::FILE_NAMESPACE_HEIGHT.self::UNDERSCORE.$height);
$image = $this->has($destinationPath, $relativePath);
if ($image) {
......@@ -111,7 +141,7 @@ class ImageHelper
*/
public function resizeToWidth($relativePath, $width)
{
$destinationPath = $this->getFilePathname($relativePath, 'width'.self::UNDERSCORE.$width);
$destinationPath = $this->getFilePathname($relativePath, self::FILE_NAMESPACE_WIDTH.self::UNDERSCORE.$width);
$image = $this->has($destinationPath, $relativePath);
if ($image) {
......
......@@ -9,9 +9,15 @@ use App\Facades\ImageHelperFacade;
* Helper to extend Parsedown
*
* @author Björn Hase
* @license http://opensource.org/licenses/MIT The MIT License
* @link https://github.com/nirgendswo/fuzzy-cms GitHub Repository
*/
class MarkdownHelper extends Parsedown
{
/**
*
* @var string
*/
const EXTERNAL_LINK = "/^(http|https):\/\//";
const INNER_BRACKETS = "/\){(.*?)\}/";
const TARGET_BLANK = "_blank";
......
......@@ -12,13 +12,19 @@ use DateTime;
* Helper for View
*
* @author Björn Hase
* @license http://opensource.org/licenses/MIT The MIT License
* @link https://github.com/nirgendswo/fuzzy-cms GitHub Repository
*/
class ViewHelper
{
/**
* default truncted length
* @var integer
*/
const TRUNCATED_LENGTH = 150;
/**
* truncated html
* truncated html
*
* @param string $markdown
* @param integer $length
......
......@@ -3,7 +3,6 @@
namespace App\Http\Actions;
use Illuminate\Http\Request;
use App\Models\PageModel as Page;
/**
......@@ -11,21 +10,33 @@ use App\Models\PageModel as Page;
*
*
* @author Björn Hase
* @license http://opensource.org/licenses/MIT The MIT License
* @link https://github.com/nirgendswo/fuzzy-cms GitHub Repository
*/
abstract class PostActionAbstract implements PostActionInterface
{
/** */
/**
* array with results for the action
* @var array
*/
protected $result = [];
/** */
/**
* request object from lumen
* @var Request
*/
protected $request;
/** */
/**
* current page object
* @var Page
*/
protected $page;
/**
* adding parameters
*
* @param Page $page
* @param Page $page
* @param Request $request
*/
public function __construct(Page $page, Request $request)
......@@ -35,9 +46,9 @@ abstract class PostActionAbstract implements PostActionInterface
}
/**
* getting result
*
*
* @return mixed
* @return array
*/
public function getResult()
{
......
......@@ -5,8 +5,9 @@ namespace App\Http\Actions;
/**
* Interface to handle post-action
*
*
* @author Björn Hase
* @license http://opensource.org/licenses/MIT The MIT License
* @link https://github.com/nirgendswo/fuzzy-cms GitHub Repository
*/
interface PostActionInterface
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment