Commit 92e4c74e authored by Thomas Citharel's avatar Thomas Citharel 🌲

use demo pages & set correct route for home

parent 1a74e72c
Pipeline #25783 passed with stage
in 4 minutes and 33 seconds
......@@ -109,6 +109,8 @@ class AsyncAccountGrav extends AbstractMakeAccount implements AsyncAccountInterf
$fs->symlink( $this->enginePath . '/user/themes/', $this->accountsPath . '/' . $this->site->getSubdomain() . '/user/themes');
$this->logger->info("Created theme symlink for " . $this->site->getSubdomain());
$customHomePage = null;
/** Pages */
if (null === $this->site->getSiteModules() || empty($this->site->getSiteModules())) { // if we have no selections on modules, give them all
$this->rcopy(
......@@ -133,27 +135,27 @@ class AsyncAccountGrav extends AbstractMakeAccount implements AsyncAccountInterf
switch ($module) {
case Blog::MODULE_BLOG:
$this->rcopy(
$this->enginePath . '/user/pages/04.blog/',
$this->accountsPath . '/demo-blog/user/pages/04.blog/',
$this->accountsPath . '/' . $this->site->getSubdomain() . '/user/pages/04.blog'
);
$customHomePage = '/blog';
break;
case Blog::MODULE_CV:
$this->rcopy(
$this->enginePath . '/user/pages/05.a-propos/',
$this->accountsPath . '/demo-cv/user/pages/05.a-propos/',
$this->accountsPath . '/' . $this->site->getSubdomain() . '/user/pages/05.a-propos'
);
$customHomePage = '/a-propos';
break;
case Blog::MODULE_SINGLE_PAGE:
$this->rcopy(
$this->enginePath . '/user/pages/02.page_simple/',
$this->accountsPath . '/demo-page/user/pages/02.page_simple/',
$this->accountsPath . '/' . $this->site->getSubdomain() . '/user/pages/02.page_simple'
);
$customHomePage = '/page_simple';
break;
case Blog::MODULE_SINGLE_PAGE_CARROUSEL:
$this->rcopy(
$this->enginePath . '/user/pages/03.page_carousel/',
$this->accountsPath . '/' . $this->site->getSubdomain() . '/user/pages/03.page_carousel'
);
// disable this for now
break;
default:
break;
......@@ -169,7 +171,15 @@ class AsyncAccountGrav extends AbstractMakeAccount implements AsyncAccountInterf
$this->rcopy($this->enginePath . '/user/data/', $this->accountsPath . '/' . $this->site->getSubdomain() . '/user/data/');
/** Config */
$fs->copy($this->enginePath . '/user/config/system.yaml', $this->accountsPath . '/' . $this->site->getSubdomain() . '/user/config/system.yaml');
$systemFilePath = $this->accountsPath . '/' . $this->site->getSubdomain() . '/user/config/system.yaml';
$fs->copy($this->enginePath . '/user/config/system.yaml', $systemFilePath);
if (null != $customHomePage) {
$system = Yaml::parse(file_get_contents($systemFilePath));
$system['home']['alias'] = $customHomePage;
file_put_contents($systemFilePath, Yaml::dump($system));
}
$fs->symlink($this->enginePath . '/user/config/media.yaml', $this->accountsPath . '/' . $this->site->getSubdomain() . '/user/config/media.yaml');
$this->rcopy($this->enginePath . '/user/config/plugins/', $this->accountsPath . '/' . $this->site->getSubdomain() . '/user/config/plugins/');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment