pupupu

simple static CMS for crappy servers
git clone https://git.ce9e.org/pupupu.git

commit
4fb3174179d87e74d7377e2233d773934e11451f
parent
70145ca1f95bd0cce6376831dd3cd04b51d02557
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2018-10-14 10:55
switch markdown implementation

Diffstat

M composer.json 4 ++--
M index.php 5 +++--

2 files changed, 5 insertions, 4 deletions


diff --git a/composer.json b/composer.json

@@ -1,7 +1,7 @@
    1     1 {
    2     2     "require": {
    3    -1         "erusev/parsedown": "^1.7",
    4     3         "symfony/yaml": "^3.4",
    5    -1         "twig/twig": "^2.0"
   -1     4         "twig/twig": "^2.0",
   -1     5         "michelf/php-markdown": "^1.8"
    6     6     }
    7     7 }

diff --git a/index.php b/index.php

@@ -2,6 +2,7 @@
    2     2 
    3     3 require __DIR__ . '/vendor/autoload.php';
    4     4 use Symfony\Component\Yaml\Yaml;
   -1     5 use Michelf\Markdown;
    5     6 
    6     7 function rrmdir($path)
    7     8 {
@@ -58,7 +59,6 @@ class Pupupu
   58    59         $this->srcDir = $srcDir;
   59    60         $this->targetDir = $targetDir;
   60    61 
   61    -1         $this->parsedown = new Parsedown();
   62    62         $loader = new Twig_Loader_Filesystem($srcDir . '/_templates');
   63    63         $this->twig = new Twig_Environment($loader);
   64    64 
@@ -102,7 +102,7 @@ class Pupupu
  102   102     {
  103   103         $key = "body:$path";
  104   104         if (!in_array($key, $this->cache)) {
  105    -1             $v = $this->parsedown->text($this->get($path, 'index.md'));
   -1   105             $v = Markdown::defaultTransform($this->get($path, 'index.md'));
  106   106             $this->cache[$key] = $v;
  107   107         }
  108   108         return $this->cache[$key];
@@ -167,6 +167,7 @@ class Pupupu
  167   167             'site' => $this->getSite(),
  168   168             'body' => $this->getBody($path),
  169   169             'date' => time(),
   -1   170             'pupupu' => $this,
  170   171         ));
  171   172 
  172   173         $filename = $page['filename'] ?? 'index.html';