From 6e27db301f29f5b618a6fa19941be3a6b63d89e5 Mon Sep 17 00:00:00 2001 From: Giuseppe Criscione <18699708+giuscris@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:14:49 +0100 Subject: [PATCH] Move config, content and templates to sites/ --- formwork/src/Core/Formwork.php | 4 ++-- formwork/src/Template/Template.php | 2 +- index.php | 3 ++- {config => site/config}/site.yml | 0 {config => site/config}/system.yml | 0 {content => site/content}/1-about/page.md | 0 {content => site/content}/2-blog/20180615-hello-world/post.md | 0 .../content}/2-blog/20180616-another-blog-post/post.md | 0 {content => site/content}/2-blog/blog.md | 0 {content => site/content}/3-typography/page.md | 0 {content => site/content}/404/page.md | 0 {content => site/content}/index/page.md | 0 {templates => site/templates}/assets/css/style.css | 0 {templates => site/templates}/assets/css/style.min.css | 0 {templates => site/templates}/assets/js/script.js | 0 {templates => site/templates}/assets/js/script.min.js | 0 {templates => site/templates}/blog.php | 0 {templates => site/templates}/controllers/blog.php | 0 {templates => site/templates}/layouts/site.php | 0 {templates => site/templates}/page.php | 0 {templates => site/templates}/partials/cover-image.php | 0 {templates => site/templates}/partials/menu.php | 0 {templates => site/templates}/partials/meta.php | 0 {templates => site/templates}/partials/pagination.php | 0 {templates => site/templates}/partials/tags.php | 0 {templates => site/templates}/post.php | 0 {templates => site/templates}/schemes/blog.yml | 0 {templates => site/templates}/schemes/page.yml | 0 {templates => site/templates}/schemes/post.yml | 0 29 files changed, 5 insertions(+), 4 deletions(-) rename {config => site/config}/site.yml (100%) rename {config => site/config}/system.yml (100%) rename {content => site/content}/1-about/page.md (100%) rename {content => site/content}/2-blog/20180615-hello-world/post.md (100%) rename {content => site/content}/2-blog/20180616-another-blog-post/post.md (100%) rename {content => site/content}/2-blog/blog.md (100%) rename {content => site/content}/3-typography/page.md (100%) rename {content => site/content}/404/page.md (100%) rename {content => site/content}/index/page.md (100%) rename {templates => site/templates}/assets/css/style.css (100%) rename {templates => site/templates}/assets/css/style.min.css (100%) rename {templates => site/templates}/assets/js/script.js (100%) rename {templates => site/templates}/assets/js/script.min.js (100%) rename {templates => site/templates}/blog.php (100%) rename {templates => site/templates}/controllers/blog.php (100%) rename {templates => site/templates}/layouts/site.php (100%) rename {templates => site/templates}/page.php (100%) rename {templates => site/templates}/partials/cover-image.php (100%) rename {templates => site/templates}/partials/menu.php (100%) rename {templates => site/templates}/partials/meta.php (100%) rename {templates => site/templates}/partials/pagination.php (100%) rename {templates => site/templates}/partials/tags.php (100%) rename {templates => site/templates}/post.php (100%) rename {templates => site/templates}/schemes/blog.yml (100%) rename {templates => site/templates}/schemes/page.yml (100%) rename {templates => site/templates}/schemes/post.yml (100%) diff --git a/formwork/src/Core/Formwork.php b/formwork/src/Core/Formwork.php index 261367b8..d6700ad5 100644 --- a/formwork/src/Core/Formwork.php +++ b/formwork/src/Core/Formwork.php @@ -142,11 +142,11 @@ final class Formwork 'date.week_starts' => 0, 'languages.available' => [], 'languages.http_preferred' => false, - 'content.path' => ROOT_PATH . 'content' . DS, + 'content.path' => SITE_PATH . 'content' . DS, 'content.extension' => '.md', 'files.allowed_extensions' => ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.pdf'], 'parsers.use_php_yaml' => 'parse', - 'templates.path' => ROOT_PATH . 'templates' . DS, + 'templates.path' => SITE_PATH . 'templates' . DS, 'templates.extension' => '.php', 'pages.index' => 'index', 'pages.error' => '404', diff --git a/formwork/src/Template/Template.php b/formwork/src/Template/Template.php index f86e1d6f..d6b13561 100644 --- a/formwork/src/Template/Template.php +++ b/formwork/src/Template/Template.php @@ -125,7 +125,7 @@ class Template } return $this->assets = new Assets( $this->path() . 'assets' . DS, - Formwork::instance()->site()->uri('/templates/assets/', false) + Formwork::instance()->site()->uri('/site/templates/assets/', false) ); } diff --git a/index.php b/index.php index d980d273..b67241e0 100644 --- a/index.php +++ b/index.php @@ -5,7 +5,8 @@ use Formwork\Core\Formwork; const DS = DIRECTORY_SEPARATOR; const ROOT_PATH = __DIR__ . DS; const FORMWORK_PATH = ROOT_PATH . 'formwork' . DS; -const CONFIG_PATH = ROOT_PATH . 'config' . DS; +const SITE_PATH = ROOT_PATH . 'site' . DS; +const CONFIG_PATH = SITE_PATH . 'config' . DS; const ADMIN_PATH = ROOT_PATH . 'admin' . DS; require ROOT_PATH . 'vendor' . DS . 'autoload.php'; diff --git a/config/site.yml b/site/config/site.yml similarity index 100% rename from config/site.yml rename to site/config/site.yml diff --git a/config/system.yml b/site/config/system.yml similarity index 100% rename from config/system.yml rename to site/config/system.yml diff --git a/content/1-about/page.md b/site/content/1-about/page.md similarity index 100% rename from content/1-about/page.md rename to site/content/1-about/page.md diff --git a/content/2-blog/20180615-hello-world/post.md b/site/content/2-blog/20180615-hello-world/post.md similarity index 100% rename from content/2-blog/20180615-hello-world/post.md rename to site/content/2-blog/20180615-hello-world/post.md diff --git a/content/2-blog/20180616-another-blog-post/post.md b/site/content/2-blog/20180616-another-blog-post/post.md similarity index 100% rename from content/2-blog/20180616-another-blog-post/post.md rename to site/content/2-blog/20180616-another-blog-post/post.md diff --git a/content/2-blog/blog.md b/site/content/2-blog/blog.md similarity index 100% rename from content/2-blog/blog.md rename to site/content/2-blog/blog.md diff --git a/content/3-typography/page.md b/site/content/3-typography/page.md similarity index 100% rename from content/3-typography/page.md rename to site/content/3-typography/page.md diff --git a/content/404/page.md b/site/content/404/page.md similarity index 100% rename from content/404/page.md rename to site/content/404/page.md diff --git a/content/index/page.md b/site/content/index/page.md similarity index 100% rename from content/index/page.md rename to site/content/index/page.md diff --git a/templates/assets/css/style.css b/site/templates/assets/css/style.css similarity index 100% rename from templates/assets/css/style.css rename to site/templates/assets/css/style.css diff --git a/templates/assets/css/style.min.css b/site/templates/assets/css/style.min.css similarity index 100% rename from templates/assets/css/style.min.css rename to site/templates/assets/css/style.min.css diff --git a/templates/assets/js/script.js b/site/templates/assets/js/script.js similarity index 100% rename from templates/assets/js/script.js rename to site/templates/assets/js/script.js diff --git a/templates/assets/js/script.min.js b/site/templates/assets/js/script.min.js similarity index 100% rename from templates/assets/js/script.min.js rename to site/templates/assets/js/script.min.js diff --git a/templates/blog.php b/site/templates/blog.php similarity index 100% rename from templates/blog.php rename to site/templates/blog.php diff --git a/templates/controllers/blog.php b/site/templates/controllers/blog.php similarity index 100% rename from templates/controllers/blog.php rename to site/templates/controllers/blog.php diff --git a/templates/layouts/site.php b/site/templates/layouts/site.php similarity index 100% rename from templates/layouts/site.php rename to site/templates/layouts/site.php diff --git a/templates/page.php b/site/templates/page.php similarity index 100% rename from templates/page.php rename to site/templates/page.php diff --git a/templates/partials/cover-image.php b/site/templates/partials/cover-image.php similarity index 100% rename from templates/partials/cover-image.php rename to site/templates/partials/cover-image.php diff --git a/templates/partials/menu.php b/site/templates/partials/menu.php similarity index 100% rename from templates/partials/menu.php rename to site/templates/partials/menu.php diff --git a/templates/partials/meta.php b/site/templates/partials/meta.php similarity index 100% rename from templates/partials/meta.php rename to site/templates/partials/meta.php diff --git a/templates/partials/pagination.php b/site/templates/partials/pagination.php similarity index 100% rename from templates/partials/pagination.php rename to site/templates/partials/pagination.php diff --git a/templates/partials/tags.php b/site/templates/partials/tags.php similarity index 100% rename from templates/partials/tags.php rename to site/templates/partials/tags.php diff --git a/templates/post.php b/site/templates/post.php similarity index 100% rename from templates/post.php rename to site/templates/post.php diff --git a/templates/schemes/blog.yml b/site/templates/schemes/blog.yml similarity index 100% rename from templates/schemes/blog.yml rename to site/templates/schemes/blog.yml diff --git a/templates/schemes/page.yml b/site/templates/schemes/page.yml similarity index 100% rename from templates/schemes/page.yml rename to site/templates/schemes/page.yml diff --git a/templates/schemes/post.yml b/site/templates/schemes/post.yml similarity index 100% rename from templates/schemes/post.yml rename to site/templates/schemes/post.yml