From a616757ee081773bdb87deed4bb164b4690a566f Mon Sep 17 00:00:00 2001 From: Awilum Date: Wed, 28 Feb 2018 15:45:05 +0300 Subject: [PATCH] #431 general structure changes --- .DS_Store | Bin 12292 -> 12292 bytes monstra/Blocks.php | 4 +-- monstra/Pages.php | 16 +++++----- monstra/boot/defines.php | 11 +++---- site/accounts/.gitkeep | 0 .../blocks/fansoro-docs.md | 0 .../404.md => content/pages/404/index.md} | 0 .../pages/contact/index.md} | 2 +- site/content/pages/home/index.md | 7 +++++ site/storage/pages/index.md | 28 ------------------ 10 files changed, 22 insertions(+), 46 deletions(-) delete mode 100755 site/accounts/.gitkeep rename site/{storage => content}/blocks/fansoro-docs.md (100%) rename site/{storage/pages/404.md => content/pages/404/index.md} (100%) rename site/{storage/pages/contact.md => content/pages/contact/index.md} (89%) create mode 100755 site/content/pages/home/index.md delete mode 100755 site/storage/pages/index.md diff --git a/.DS_Store b/.DS_Store index 4ec2d6f672bd2b297063bd23e69e5c6880ade031..1a4c0299a1ff059cf5a8716e0d4d35c68c6c74af 100755 GIT binary patch delta 1560 zcmds$O-vML9LE38b{A&`D(}KF%i``ju#3ybpf18LAGU6TB32s=0l`3oRpzi!7GxJ% z+^$%q9|vP=-zL!Zpb&0qQr+mGZQ@ZHdZ^JutI|Vz=%I)D)k81pyE`6COgwlnv6IYX z=KbaUC-Xe-Z)Rv_=(`qcX0Uw7(sk(Oo2v_%+Mt9awo~q%G{zIL(YU$Tth7pY=yKnI z(UB1&o=lj_Z>tfBElK-^qe){|G?DBaGvdau$=vEz?p0O3Vw0z3lE_8tDMB4IKn9J` z6rH3~^f`S?i*%kY(T{YEmS~xNrt5TzZqo|=PJhu|xgPHQGmP-xBkT2pRvb1SQ{{1bm~UXRGl_<%=BN~hVXtWMHR)miFVt9d*u z>yh~>`#lP~EXg@mLj<4+as%0pX(|d>j)#CXhrL)A$I-SK|au;uKEfOK^O}*}AJQ>DF8z Y$iMKnW~^2JT1Q`Tru?G4?0=W!6G1I_GXMY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R4u+1UxMRX|G?Z^@j$y8x*{Dz5#vGW< XEl#>=vWAe({;MujZ`gtV>koeeHH*8w diff --git a/monstra/Blocks.php b/monstra/Blocks.php index ca990fe..783d49d 100755 --- a/monstra/Blocks.php +++ b/monstra/Blocks.php @@ -38,7 +38,7 @@ class Blocks { $blocks_cache_id = ''; - $blocks = File::scan(STORAGE_PATH . '/blocks', 'md'); + $blocks = File::scan(CONTENT_PATH . '/blocks', 'md'); if ($blocks) { foreach ($blocks as $block) { @@ -70,7 +70,7 @@ class Blocks */ public static function get($name) { - if (File::exists($block_path = STORAGE_PATH .'/blocks/' . $name . '.md')) { + if (File::exists($block_path = CONTENT_PATH .'/blocks/' . $name . '.md')) { // Create Unique Cache ID for Block $block_cache_id = md5('block' . ROOT_DIR . $block_path . filemtime($block_path)); diff --git a/monstra/Pages.php b/monstra/Pages.php index abcca2f..3707120 100755 --- a/monstra/Pages.php +++ b/monstra/Pages.php @@ -88,7 +88,7 @@ class Pages */ public static function getPages($url = '', $order_by = 'date', $order_type = 'DESC', $ignore = array('404'), $limit = null) { - $pages = File::scan(STORAGE_PATH . '/pages/' . $url, 'md'); + $pages = File::scan(CONTENT_PATH . '/pages/' . $url, 'md'); if ($pages) { foreach ($pages as $page) { @@ -110,7 +110,7 @@ class Pages $_pages[$key] = Yaml::parse($_page[1]); - $url = str_replace(STORAGE_PATH . '/pages', Url::getBase(), $page); + $url = str_replace(CONTENT_PATH . '/pages', Url::getBase(), $page); $url = str_replace('index.md', '', $url); $url = str_replace('.md', '', $url); $url = str_replace('\\', '/', $url); @@ -165,23 +165,23 @@ class Pages public static function getPage($url) { - // If url is empty that its a homepage + // If url is empty then its a homepage if ($url) { - $file = STORAGE_PATH . '/pages/' . $url; + $file = CONTENT_PATH . '/pages/' . $url; } else { - $file = STORAGE_PATH . '/pages/' . 'index'; + $file = CONTENT_PATH . '/pages/' . Config::get('site.pages.main') . '/' . 'index'; } // Select the file if (is_dir($file)) { - $file = STORAGE_PATH . '/pages/' . $url .'/index.md'; + $file = CONTENT_PATH . '/pages/' . $url .'/index.md'; } else { $file .= '.md'; } // Get 404 page if file not exists if (!file_exists($file)) { - $file = STORAGE_PATH . '/pages/' . '404.md'; + $file = CONTENT_PATH . '/pages/404/' . 'index.md'; Response::status(404); } @@ -197,7 +197,7 @@ class Pages $page = Yaml::parse($_page[1]); - $url = str_replace(STORAGE_PATH . '/pages', Url::getBase(), $file); + $url = str_replace(CONTENT_PATH . '/pages', Url::getBase(), $file); $url = str_replace('index.md', '', $url); $url = str_replace('.md', '', $url); $url = str_replace('\\', '/', $url); diff --git a/monstra/boot/defines.php b/monstra/boot/defines.php index 5a90bf4..aef9214 100755 --- a/monstra/boot/defines.php +++ b/monstra/boot/defines.php @@ -12,11 +12,11 @@ // Define the path to the root directory (without trailing slash). define('ROOT_DIR', str_replace(DIRECTORY_SEPARATOR, '/', getcwd())); -// Define the path to the storage directory (without trailing slash). -define('SITE_PATH', ROOT_DIR . '/site'); +// Define the path to the site directory (without trailing slash). +define('SITE_PATH', ROOT_DIR . '/site-katerinasitnikova'); -// Define the path to the storage directory (without trailing slash). -define('STORAGE_PATH', SITE_PATH . '/storage'); +// Define the path to the content directory (without trailing slash). +define('CONTENT_PATH', SITE_PATH . '/content'); // Define the path to the themes directory (without trailing slash). define('THEMES_PATH', SITE_PATH . '/themes'); @@ -29,6 +29,3 @@ define('CONFIG_PATH', SITE_PATH . '/config'); // Define the path to the cache directory (without trailing slash). define('CACHE_PATH', SITE_PATH . '/cache'); - -// Define the path to the cache directory (without trailing slash). -define('ACCOUNTS_PATH', SITE_PATH . '/cache'); diff --git a/site/accounts/.gitkeep b/site/accounts/.gitkeep deleted file mode 100755 index e69de29..0000000 diff --git a/site/storage/blocks/fansoro-docs.md b/site/content/blocks/fansoro-docs.md similarity index 100% rename from site/storage/blocks/fansoro-docs.md rename to site/content/blocks/fansoro-docs.md diff --git a/site/storage/pages/404.md b/site/content/pages/404/index.md similarity index 100% rename from site/storage/pages/404.md rename to site/content/pages/404/index.md diff --git a/site/storage/pages/contact.md b/site/content/pages/contact/index.md similarity index 89% rename from site/storage/pages/contact.md rename to site/content/pages/contact/index.md index bcc9a93..dbbd90c 100755 --- a/site/storage/pages/contact.md +++ b/site/content/pages/contact/index.md @@ -5,7 +5,7 @@ description: Monstra is a simple and light-weighted Content Management System ## Stay in touch -[Monstra official site](http://monstra.org/) +[Monstra official site](http://Monstra.org/) [Monstra forum](http://forum.Monstra.org/) [Monstra on Github](https://github.com/Monstra/Monstra) [Monstra Gitter chat room](https://gitter.im/Monstra/Monstra) diff --git a/site/content/pages/home/index.md b/site/content/pages/home/index.md new file mode 100755 index 0000000..871da36 --- /dev/null +++ b/site/content/pages/home/index.md @@ -0,0 +1,7 @@ +--- +title: Главная страница +description: страница +template: home +--- + +home diff --git a/site/storage/pages/index.md b/site/storage/pages/index.md deleted file mode 100755 index 3b98abc..0000000 --- a/site/storage/pages/index.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: Welcome -description: Monstra is a simple and light-weighted Content Management System -template: index ---- -## Monstra is succesfully installed! -You can start editing the content and customising your site. - -### Edit this Page -To edit this page, simply go to the folder you installed Monstra, and then browse to the `/storage/pages/` folder and open the `index.md` file in your editor. - -### Create a New page -Creating a new page is very simple in Monstra. - -1. Launch your text editor and paste this sample text: - - ``` - --- - title: My New Page - --- - My new page body. - ``` - -2. Save this file in the `/storage/pages/` folder as `my-new-page.md` and its will be available by this url: http://yoursite/my-new-page - -That is it! - -{block name=Monstra-docs}