From 91eb536520b23f2a0bf604cc213c10ebdf7ad5b8 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 14 Nov 2017 22:12:30 +0100 Subject: [PATCH] Version 1.0.3 meta-title and namespaces --- .gitignore | 1 + composer.json | 2 +- content/0_typemill/09-roadmap.md | 10 ++++---- content/4_info/01-release-notes.md | 7 ++++++ system/Controllers/Controller.php | 2 +- system/Controllers/PageController.php | 29 +++++++++++----------- system/Controllers/SetupController.php | 8 +++--- system/Models/Folder.php | 5 ++-- system/Models/Helpers.php | 2 +- system/Models/VersionCheck.php | 7 ++---- system/Models/Write.php | 7 +++--- system/Models/WriteCache.php | 7 +++--- system/Models/WriteSitemap.php | 6 ++--- system/Models/WriteYaml.php | 6 ++--- system/Routes/web.php | 7 +++--- system/system.php | 2 +- system/vendor/composer/autoload_psr4.php | 2 +- system/vendor/composer/autoload_static.php | 10 ++++---- themes/typemill/index.twig | 2 +- 19 files changed, 59 insertions(+), 63 deletions(-) diff --git a/.gitignore b/.gitignore index 9c93c4b..126e5c1 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/composer.json b/composer.json index 5494839..39c642d 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ }, "autoload": { "psr-4": { - "System\\": "system" + "Typemill\\": "system" } } } \ No newline at end of file diff --git a/content/0_typemill/09-roadmap.md b/content/0_typemill/09-roadmap.md index 608e946..206915f 100644 --- a/content/0_typemill/09-roadmap.md +++ b/content/0_typemill/09-roadmap.md @@ -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. \ No newline at end of file diff --git a/content/4_info/01-release-notes.md b/content/4_info/01-release-notes.md index 23d3815..548be03 100644 --- a/content/4_info/01-release-notes.md +++ b/content/4_info/01-release-notes.md @@ -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. diff --git a/system/Controllers/Controller.php b/system/Controllers/Controller.php index 7563cb9..d7687e2 100644 --- a/system/Controllers/Controller.php +++ b/system/Controllers/Controller.php @@ -1,6 +1,6 @@ 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("", $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; } -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/Controllers/SetupController.php b/system/Controllers/SetupController.php index 1e15ab2..bd037be 100644 --- a/system/Controllers/SetupController.php +++ b/system/Controllers/SetupController.php @@ -1,6 +1,6 @@ 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; } -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/Models/Folder.php b/system/Models/Folder.php index c5d69b6..08d8d25 100644 --- a/system/Models/Folder.php +++ b/system/Models/Folder.php @@ -1,6 +1,6 @@ \ No newline at end of file +} \ No newline at end of file diff --git a/system/Models/Helpers.php b/system/Models/Helpers.php index 1c16810..4175f57 100644 --- a/system/Models/Helpers.php +++ b/system/Models/Helpers.php @@ -1,6 +1,6 @@ \ No newline at end of file +} \ No newline at end of file diff --git a/system/Models/Write.php b/system/Models/Write.php index 0d6425e..355fa86 100644 --- a/system/Models/Write.php +++ b/system/Models/Write.php @@ -1,6 +1,6 @@ \ No newline at end of file +} \ No newline at end of file diff --git a/system/Models/WriteCache.php b/system/Models/WriteCache.php index 90e71a7..7966c6a 100644 --- a/system/Models/WriteCache.php +++ b/system/Models/WriteCache.php @@ -1,6 +1,6 @@ $duration) { return false; @@ -80,6 +81,4 @@ class WriteCache extends Write public function clearAllCacheFiles() { } -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/Models/WriteSitemap.php b/system/Models/WriteSitemap.php index 4b09a0d..d7090a7 100644 --- a/system/Models/WriteSitemap.php +++ b/system/Models/WriteSitemap.php @@ -1,6 +1,6 @@ ' . "\n"; return $urlset; } -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/Models/WriteYaml.php b/system/Models/WriteYaml.php index f91dc56..1ad1f42 100644 --- a/system/Models/WriteYaml.php +++ b/system/Models/WriteYaml.php @@ -1,6 +1,6 @@ writeFile($folderName, $yamlFileName, $yaml); } -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/system/Routes/web.php b/system/Routes/web.php index 774f6b0..38eb60c 100644 --- a/system/Routes/web.php +++ b/system/Routes/web.php @@ -1,7 +1,7 @@ post('/setup', SetupController::class . ':save')->setName('save'); } -$app->get('/[{params:.*}]', PageController::class . ':index'); -?> \ No newline at end of file +$app->get('/[{params:.*}]', PageController::class . ':index'); \ No newline at end of file diff --git a/system/system.php b/system/system.php index 1835895..ed590d4 100644 --- a/system/system.php +++ b/system/system.php @@ -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'; diff --git a/system/vendor/composer/autoload_psr4.php b/system/vendor/composer/autoload_psr4.php index dbd5716..5537dec 100644 --- a/system/vendor/composer/autoload_psr4.php +++ b/system/vendor/composer/autoload_psr4.php @@ -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'), diff --git a/system/vendor/composer/autoload_static.php b/system/vendor/composer/autoload_static.php index fd8913e..9eceadc 100644 --- a/system/vendor/composer/autoload_static.php +++ b/system/vendor/composer/autoload_static.php @@ -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', diff --git a/themes/typemill/index.twig b/themes/typemill/index.twig index 72f2b61..8d2a6af 100644 --- a/themes/typemill/index.twig +++ b/themes/typemill/index.twig @@ -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 %}