1
0
mirror of https://github.com/typemill/typemill.git synced 2025-07-31 19:30:40 +02:00

Version 1.0.3 meta-title and namespaces

This commit is contained in:
Sebastian
2017-11-14 22:12:30 +01:00
parent 67d2a487de
commit 91eb536520
19 changed files with 59 additions and 63 deletions

1
.gitignore vendored
View File

@@ -3,6 +3,7 @@ cache/sitemap.xml
cache/lastSitemap.txt
cache/lastCache.txt
settings/settings.yaml
plugins
typemill.zip
typemill-1.0.1.zip
typemill-1.0.2.zip

View File

@@ -20,7 +20,7 @@
},
"autoload": {
"psr-4": {
"System\\": "system"
"Typemill\\": "system"
}
}
}

View File

@@ -2,12 +2,12 @@
There are a lot of plans for future releases of TYPEMILL, but it also follows the concept of simplicity. To prevent TYPEMILL from becomming a feature soup, it will strictly focus on the writers needs. These are some ideas:
- Image and media support.
- A dashboard for authors to create and edit content online.
- Right now a plugin system is in work to make typemill more extensible.
- An admin plugin is planned. With this, you can create content online.
- Image- and media-management is planned with the admin plugin.
- Clean API-design is planned.
- More options to create navigations.
- More themes for special publications like documentations, books or lyrics.
- Additional navigation based on the headlines of a content page.
- Extensibility (Plugins) and API design.
- Version controll and updates.
- Additional output format like mobi, epub, static html and more.
If you miss a feature or if you found a bug, please report it on GitHub.

View File

@@ -2,6 +2,13 @@
This is the version history with some release notes.
## Version 1.0.3 (14.11.2017)
- Bugfix: Deleted a config-file in the download-version, that broke the setup url.
- Improvement: Meta-title is now created with the first h1-headline in the content file. File-name is used as fall back. **Please update the theme-folder with the theme-folder of version 1.0.3!!!** This will improve SEO.
- Improvement: Stripped out all developer files in the download-version. This reduced the size of the zip-download from 2.5 MB to 800kb.
- Improvement: Changed Namespace from "System" to "Typemill".
## Version 1.0.2 (02.07.2017)
- Bugfix: The theme can now be changed in the yaml-file again.

View File

@@ -1,6 +1,6 @@
<?php
namespace System\Controllers;
namespace Typemill\Controllers;
/* Use the slim-container */
use Interop\Container\ContainerInterface;

View File

@@ -1,14 +1,14 @@
<?php
namespace System\Controllers;
namespace Typemill\Controllers;
use System\Models\Folder;
use System\Models\WriteCache;
use System\Models\WriteSitemap;
use System\Models\WriteYaml;
use Typemill\Models\Folder;
use Typemill\Models\WriteCache;
use Typemill\Models\WriteSitemap;
use Typemill\Models\WriteYaml;
use \Symfony\Component\Yaml\Yaml;
use System\Models\VersionCheck;
use System\Models\Helpers;
use Typemill\Models\VersionCheck;
use Typemill\Models\Helpers;
class PageController extends Controller
{
@@ -113,9 +113,12 @@ class PageController extends Controller
$Parsedown = new \ParsedownExtra();
/* parse markdown-file to html-string */
$contentHTML = $Parsedown->text($contentMD);
$description = substr(strip_tags($contentHTML),0,150);
$description = trim(preg_replace('/\s+/', ' ', $description));
$contentHTML = $Parsedown->text($contentMD);
$excerpt = substr($contentHTML,0,200);
$excerpt = explode("</h1>", $excerpt);
$title = isset($excerpt[0]) ? strip_tags($excerpt[0]) : $settings['title'];
$description = isset($excerpt[1]) ? strip_tags($excerpt[1]) : false;
$description = $description ? trim(preg_replace('/\s+/', ' ', $description)) : false;
/*
$timer['topiccontroller']=microtime(true);
@@ -125,7 +128,7 @@ class PageController extends Controller
$route = empty($args) && $settings['startpage'] ? '/cover.twig' : '/index.twig';
$this->c->view->render($response, $route, array('navigation' => $structure, 'content' => $contentHTML, 'item' => $item, 'breadcrumb' => $breadcrumb, 'settings' => $settings, 'description' => $description, 'base_url' => $base_url ));
$this->c->view->render($response, $route, array('navigation' => $structure, 'content' => $contentHTML, 'item' => $item, 'breadcrumb' => $breadcrumb, 'settings' => $settings, 'title' => $title, 'description' => $description, 'base_url' => $base_url ));
}
protected function getCachedStructure($cache)
@@ -152,6 +155,4 @@ class PageController extends Controller
return $structure;
}
}
?>
}

View File

@@ -1,6 +1,6 @@
<?php
namespace System\Controllers;
namespace Typemill\Controllers;
use \Symfony\Component\Yaml\Yaml;
@@ -14,7 +14,7 @@ class SetupController extends Controller
$base_url = $uri->getBaseUrl();
$errors = false;
/* Check, if setting folder is */
/* Check, if setting folder is writable */
if(!is_writable($this->c->get('settings')['settingsPath'])){ $errors['folder'] = 'Your settings folder is not writable.'; }
$data = array(
@@ -133,6 +133,4 @@ class SetupController extends Controller
}
return $themes;
}
}
?>
}

View File

@@ -1,6 +1,6 @@
<?php
namespace System\Models;
namespace Typemill\Models;
use \URLify;
@@ -272,5 +272,4 @@ class Folder
$parts = preg_split('/\./',$fileName);
return end($parts);
}
}
?>
}

View File

@@ -1,6 +1,6 @@
<?php
namespace System\Models;
namespace Typemill\Models;
class Helpers{

View File

@@ -1,6 +1,6 @@
<?php
namespace System\Models;
namespace Typemill\Models;
class VersionCheck
{
@@ -27,7 +27,4 @@ class VersionCheck
return false;
}
}
}
?>
}

View File

@@ -1,6 +1,6 @@
<?php
namespace System\Models;
namespace Typemill\Models;
class Write
{
@@ -21,6 +21,7 @@ class Write
throw new Exception("The folder '{$folder}' is missing and we could not create it. Please create the folder manually on your server.");
return false;
}
if(!is_writable($folderPath))
{
throw new Exception("Please make the folder '{$folder}' writable.");
@@ -56,6 +57,4 @@ class Write
}
return false;
}
}
?>
}

View File

@@ -1,6 +1,6 @@
<?php
namespace System\Models;
namespace Typemill\Models;
class WriteCache extends Write
{
@@ -28,6 +28,7 @@ class WriteCache extends Write
}
$lastRefresh = file_get_contents($folderName . DIRECTORY_SEPARATOR . $fileName);
if(time() - $lastRefresh > $duration)
{
return false;
@@ -80,6 +81,4 @@ class WriteCache extends Write
public function clearAllCacheFiles()
{
}
}
?>
}

View File

@@ -1,6 +1,6 @@
<?php
namespace System\Models;
namespace Typemill\Models;
class WriteSitemap extends Write
{
@@ -42,6 +42,4 @@ class WriteSitemap extends Write
$urlset .= ' </url>' . "\n";
return $urlset;
}
}
?>
}

View File

@@ -1,6 +1,6 @@
<?php
namespace System\Models;
namespace Typemill\Models;
class WriteYaml extends Write
{
@@ -30,6 +30,4 @@ class WriteYaml extends Write
$yaml = \Symfony\Component\Yaml\Yaml::dump($contentArray);
$this->writeFile($folderName, $yamlFileName, $yaml);
}
}
?>
}

View File

@@ -1,7 +1,7 @@
<?php
use System\Controllers\PageController;
use System\Controllers\SetupController;
use Typemill\Controllers\PageController;
use Typemill\Controllers\SetupController;
if(!isset($userSettings))
{
@@ -9,5 +9,4 @@ if(!isset($userSettings))
$app->post('/setup', SetupController::class . ':save')->setName('save');
}
$app->get('/[{params:.*}]', PageController::class . ':index');
?>
$app->get('/[{params:.*}]', PageController::class . ':index');

View File

@@ -72,7 +72,7 @@ $container['flash'] = function () {
$container['notFoundHandler'] = function($c)
{
return new \System\Handlers\NotFoundHandler($c['view']);
return new \Typemill\Handlers\NotFoundHandler($c['view']);
};
require __DIR__ . '/Routes/api.php';

View File

@@ -6,8 +6,8 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname(dirname($vendorDir));
return array(
'Typemill\\' => array($baseDir . '/system'),
'Twig\\' => array($vendorDir . '/twig/twig/src'),
'System\\' => array($baseDir . '/system'),
'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'),
'Slim\\Views\\' => array($vendorDir . '/slim/twig-view/src'),
'Slim\\Flash\\' => array($vendorDir . '/slim/flash/src'),

View File

@@ -13,11 +13,11 @@ class ComposerStaticInit836351be733ecbf4741aea17e1973480
public static $prefixLengthsPsr4 = array (
'T' =>
array (
'Typemill\\' => 9,
'Twig\\' => 5,
),
'S' =>
array (
'System\\' => 7,
'Symfony\\Component\\Yaml\\' => 23,
'Slim\\Views\\' => 11,
'Slim\\Flash\\' => 11,
@@ -39,14 +39,14 @@ class ComposerStaticInit836351be733ecbf4741aea17e1973480
);
public static $prefixDirsPsr4 = array (
'Typemill\\' =>
array (
0 => __DIR__ . '/../../..' . '/system',
),
'Twig\\' =>
array (
0 => __DIR__ . '/..' . '/twig/twig/src',
),
'System\\' =>
array (
0 => __DIR__ . '/../../..' . '/system',
),
'Symfony\\Component\\Yaml\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/yaml',

View File

@@ -1,6 +1,6 @@
{% extends '/partials/layout.twig' %}
{% block title %}{{ item.name|title }} | {{ settings.title }}{% endblock %}
{% block title %}{{ title|title }} | {{ settings.title }}{% endblock %}
{% block content %}