forked from projects/fipamo
completes #58 default theme links adapt to dynamic rendering, no page rendering if dynamic active
This commit is contained in:
parent
35c780bba6
commit
4796431076
13 changed files with 115 additions and 35 deletions
|
@ -21,17 +21,35 @@ class SettingsAPI
|
|||
file_get_contents("../content/themes/" . $theme . "/theme.json"),
|
||||
true
|
||||
);
|
||||
//if render flag is set and false, just render index page for one page sites
|
||||
//otherwise, render all pages according to theme template files
|
||||
$render = new Render();
|
||||
if (isset($themeConfig["render"])) {
|
||||
if (!$themeConfig["render"] || $themeConfig["render"] === "false") {
|
||||
$render->renderIndex();
|
||||
$result = [
|
||||
"message" => "Index Rendered. HAND CLAPS",
|
||||
"type" => "RENDER_SUCCESS",
|
||||
];
|
||||
//check to see if dynamic rendering is active
|
||||
if (
|
||||
isset($settings["global"]["dynamicRender"]) &&
|
||||
$settings["global"]["dynamicRender"] === "true"
|
||||
) {
|
||||
$result = [
|
||||
"message" => "Dynamic Render Active! You're good!",
|
||||
"type" => "RENDER_SUCCESS",
|
||||
];
|
||||
} else {
|
||||
$render = new Render();
|
||||
if (isset($themeConfig["render"])) {
|
||||
if (!$themeConfig["render"] || $themeConfig["render"] === "false") {
|
||||
$render->renderIndex();
|
||||
$result = [
|
||||
"message" => "Index Rendered. HAND CLAPS",
|
||||
"type" => "RENDER_SUCCESS",
|
||||
];
|
||||
} else {
|
||||
$render->renderTags();
|
||||
$render->renderArchive();
|
||||
$render->renderPages();
|
||||
$result = [
|
||||
"message" => "Site Rendered. GOOD EFFORT",
|
||||
"type" => "RENDER_SUCCESS",
|
||||
];
|
||||
}
|
||||
} else {
|
||||
// just incase the render flag is missing
|
||||
$render->renderTags();
|
||||
$render->renderArchive();
|
||||
$render->renderPages();
|
||||
|
@ -40,17 +58,11 @@ class SettingsAPI
|
|||
"type" => "RENDER_SUCCESS",
|
||||
];
|
||||
}
|
||||
} else {
|
||||
// just incase the render flag is missing
|
||||
$render->renderTags();
|
||||
$render->renderArchive();
|
||||
$render->renderPages();
|
||||
$result = [
|
||||
"message" => "Site Rendered. GOOD EFFORT",
|
||||
"type" => "RENDER_SUCCESS",
|
||||
];
|
||||
}
|
||||
|
||||
//if render flag is set and false, just render index page for one page sites
|
||||
//otherwise, render all pages according to theme template files
|
||||
|
||||
break;
|
||||
case "add-avatar":
|
||||
$result = ImagesAPI::uploadImage($request, "avatar");
|
||||
|
|
|
@ -46,6 +46,7 @@ class IndexControl
|
|||
"tag_list" => $item["pages"],
|
||||
"info" => $pageInfo,
|
||||
"menu" => $settings["menu"],
|
||||
"dynamicRender" => $settings["global"]["dynamicRender"],
|
||||
];
|
||||
break;
|
||||
case "archives":
|
||||
|
@ -57,6 +58,7 @@ class IndexControl
|
|||
"archives" => $archive,
|
||||
"info" => $pageInfo,
|
||||
"menu" => $settings["menu"],
|
||||
"dynamicRender" => $settings["global"]["dynamicRender"],
|
||||
];
|
||||
|
||||
break;
|
||||
|
|
|
@ -210,6 +210,7 @@ class Sorting
|
|||
"featured" => $featured,
|
||||
"info" => $pageInfo,
|
||||
"menu" => $settings["menu"],
|
||||
"dynamicRender" => $settings["global"]["dynamicRender"],
|
||||
];
|
||||
} else {
|
||||
//$template = $this->theme . "/page.twig";
|
||||
|
@ -222,6 +223,7 @@ class Sorting
|
|||
"meta" => $meta,
|
||||
"info" => $pageInfo,
|
||||
"menu" => $settings["menu"],
|
||||
"dynamicRender" => $settings["global"]["dynamicRender"],
|
||||
];
|
||||
}
|
||||
return $pageOptions;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block stylesheets %}
|
||||
<link rel="stylesheet" type="text/css" href="/assets/css/dash.css?=cvbvbv">
|
||||
<link rel="stylesheet" type="text/css" href="/assets/css/dash.css?=werer">
|
||||
{% endblock %}
|
||||
|
||||
{% block mainContent %}
|
||||
|
@ -160,11 +160,11 @@
|
|||
|
||||
</div>
|
||||
<div id="backup-settings">
|
||||
|
||||
<div id="util-1" class="column is-one-third">
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
<button id="create-backup">BACK UP YOUR SITE</button><br />
|
||||
</div>
|
||||
<div id="util-2" class="column is-three-fifths">
|
||||
<div class="column">
|
||||
{% if lastBackup != '' %}
|
||||
<div class="backup-meta">
|
||||
LAST BACK UP <a href="/api/v1/files">{{lastBackup}}</a><br />
|
||||
|
@ -173,6 +173,7 @@
|
|||
<span>span No back ups. Frowny face.</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -23,7 +23,16 @@
|
|||
{{data.full_month}}
|
||||
</span>
|
||||
{% for page in data.pages %}
|
||||
<a href="{{ "/"~item.year~"/"~data.month~"/"~page.slug~".html" }}">{{page.title}}</a><br />
|
||||
{% if dynamicRender is defined %}
|
||||
{% if dynamicRender %}
|
||||
<a href="{{ "/"~item.year~"/"~data.month~"/"~page.slug }}">{{page.title}}</a><br />
|
||||
{% else %}
|
||||
<a href="{{ "/"~item.year~"/"~data.month~"/"~page.slug~".html" }}">{{page.title}}</a><br />
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
<a href="{{ "/"~item.year~"/"~data.month~"/"~page.slug~".html" }}">{{page.title}}</a><br />
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -34,7 +34,16 @@
|
|||
<div class="right">
|
||||
{% if menu is defined %}
|
||||
{% for link in menu %}
|
||||
<a href="{{"/"~link.path~"/"~link.slug~".html"}}" class="menu-link">{{link.title}}</a><br />
|
||||
{% if dynamicRender is defined %}
|
||||
{% if dynamicRender %}
|
||||
<a href="{{"/"~link.path~"/"~link.slug}}" class="menu-link">{{link.title}}</a><br />
|
||||
{% else %}
|
||||
<a href="{{"/"~link.path~"/"~link.slug~".html"}}" class="menu-link">{{link.title}}</a><br />
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<a href="{{"/"~link.path~"/"~link.slug~".html"}}" class="menu-link">{{link.title}}</a><br />
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
@ -50,7 +59,16 @@
|
|||
|
||||
<footer>
|
||||
<div class="inner">
|
||||
<a href="/archives.html">Archives</a><br />
|
||||
{% if dynamicRender is defined %}
|
||||
{% if dynamicRender %}
|
||||
<a href="/archives">Archives</a><br />
|
||||
{% else %}
|
||||
<a href="/archives.html">Archives</a><br />
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<a href="/archives.html">Archives</a><br />
|
||||
{% endif %}
|
||||
|
||||
© 2020 By Fipamo
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -17,14 +17,31 @@
|
|||
<div class="recent">
|
||||
<span>RECENT</span><br />
|
||||
{% for item in recent %}
|
||||
<a href="{{ "/"~item.path~"/"~item.slug~".html" }}"> {{item.title}} </a><br />
|
||||
{% if dynamicRender is defined %}
|
||||
{% if dynamicRender %}
|
||||
<a href="{{ "/"~item.path~"/"~item.slug}}"> {{item.title}} </a><br />
|
||||
{% else %}
|
||||
<a href="{{ "/"~item.path~"/"~item.slug~".html" }}"> {{item.title}} </a><br />
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
<a href="{{ "/"~item.path~"/"~item.slug~".html" }}"> {{item.title}} </a><br />
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
</div>
|
||||
<div class="featured">
|
||||
<span>FEATURED</span><br />
|
||||
{% for item in featured %}
|
||||
<a href="{{ "/"~item.path~"/"~item.slug~".html" }}"> {{item.title}} </a><br />
|
||||
{% if dynamicRender is defined %}
|
||||
{% if dynamicRender %}
|
||||
<a href="{{ "/"~item.path~"/"~item.slug}}"> {{item.title}} </a><br />
|
||||
{% else %}
|
||||
<a href="{{ "/"~item.path~"/"~item.slug~".html" }}"> {{item.title}} </a><br />
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<a href="{{ "/"~item.path~"/"~item.slug~".html" }}"> {{item.title}} </a><br />
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -18,7 +18,16 @@
|
|||
{{meta['who']}} dropped this {{ meta['when'] }}<br />
|
||||
<strong>tags: </strong>
|
||||
{% for tag in meta['tags'] %}
|
||||
<a href="{{ "/tags/"~tag.slug~".html" }}">{{ tag.label }}</a>
|
||||
{% if dynamicRender is defined %}
|
||||
{% if dynamicRender %}
|
||||
<a href="{{ "/tags/"~tag.slug }}">{{ tag.label }}</a>
|
||||
{% else %}
|
||||
<a href="{{ "/tags/"~tag.slug~".html" }}">{{ tag.label }}</a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<a href="{{ "/tags/"~tag.slug~".html" }}">{{ tag.label }}</a>
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -13,7 +13,17 @@
|
|||
<article>
|
||||
<div class="page">
|
||||
{% for tag in tag_list %}
|
||||
{% if dynamicRender is defined %}
|
||||
{% if dynamicRender %}
|
||||
<a href="{{"/"~tag.path~"/"~tag.slug}}">{{tag.title}}</a><br />
|
||||
{% else %}
|
||||
<a href="{{"/"~tag.path~"/"~tag.slug~".html"}}">{{tag.title}}</a><br />
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
<a href="{{"/"~tag.path~"/"~tag.slug~".html"}}">{{tag.title}}</a><br />
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
</div>
|
||||
|
|
File diff suppressed because one or more lines are too long
6
src/package-lock.json
generated
6
src/package-lock.json
generated
|
@ -633,9 +633,9 @@
|
|||
}
|
||||
},
|
||||
"bulma": {
|
||||
"version": "0.9.2",
|
||||
"resolved": "https://registry.npmjs.org/bulma/-/bulma-0.9.2.tgz",
|
||||
"integrity": "sha512-e14EF+3VSZ488yL/lJH0tR8mFWiEQVCMi/BQUMi2TGMBOk+zrDg4wryuwm/+dRSHJw0gMawp2tsW7X1JYUCE3A=="
|
||||
"version": "0.9.3",
|
||||
"resolved": "https://registry.npmjs.org/bulma/-/bulma-0.9.3.tgz",
|
||||
"integrity": "sha512-0d7GNW1PY4ud8TWxdNcP6Cc8Bu7MxcntD/RRLGWuiw/s0a9P+XlH/6QoOIrmbj6o8WWJzJYhytiu9nFjTszk1g=="
|
||||
},
|
||||
"cacheable-request": {
|
||||
"version": "6.1.0",
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"@babel/eslint-parser": "^7.14.5",
|
||||
"animejs": "^3.2.1",
|
||||
"apidoc": "^0.28.1",
|
||||
"bulma": "^0.9.2",
|
||||
"bulma": "^0.9.3",
|
||||
"caret-pos": "^2.0.0",
|
||||
"jsdoc": "^3.6.7",
|
||||
"minami": "^1.2.3",
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
width: 100%
|
||||
height: 33px
|
||||
|
||||
#member-settings, #feature-settings, #option-settings, #token-settings
|
||||
#member-settings, #feature-settings, #option-settings, #token-settings, #backup-settings
|
||||
background: $white
|
||||
padding: 0px
|
||||
border-radius: 5px 0 5px 0
|
||||
|
|
Loading…
Reference in a new issue