completes #58 default theme links adapt to dynamic rendering, no page rendering if dynamic active

pull/84/head
Ro 3 years ago
parent 35c780bba6
commit 4796431076

@ -21,8 +21,16 @@ class SettingsAPI
file_get_contents("../content/themes/" . $theme . "/theme.json"), file_get_contents("../content/themes/" . $theme . "/theme.json"),
true true
); );
//if render flag is set and false, just render index page for one page sites //check to see if dynamic rendering is active
//otherwise, render all pages according to theme template files if (
isset($settings["global"]["dynamicRender"]) &&
$settings["global"]["dynamicRender"] === "true"
) {
$result = [
"message" => "Dynamic Render Active! You're good!",
"type" => "RENDER_SUCCESS",
];
} else {
$render = new Render(); $render = new Render();
if (isset($themeConfig["render"])) { if (isset($themeConfig["render"])) {
if (!$themeConfig["render"] || $themeConfig["render"] === "false") { if (!$themeConfig["render"] || $themeConfig["render"] === "false") {
@ -50,6 +58,10 @@ class SettingsAPI
"type" => "RENDER_SUCCESS", "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; break;
case "add-avatar": case "add-avatar":

@ -46,6 +46,7 @@ class IndexControl
"tag_list" => $item["pages"], "tag_list" => $item["pages"],
"info" => $pageInfo, "info" => $pageInfo,
"menu" => $settings["menu"], "menu" => $settings["menu"],
"dynamicRender" => $settings["global"]["dynamicRender"],
]; ];
break; break;
case "archives": case "archives":
@ -57,6 +58,7 @@ class IndexControl
"archives" => $archive, "archives" => $archive,
"info" => $pageInfo, "info" => $pageInfo,
"menu" => $settings["menu"], "menu" => $settings["menu"],
"dynamicRender" => $settings["global"]["dynamicRender"],
]; ];
break; break;

@ -210,6 +210,7 @@ class Sorting
"featured" => $featured, "featured" => $featured,
"info" => $pageInfo, "info" => $pageInfo,
"menu" => $settings["menu"], "menu" => $settings["menu"],
"dynamicRender" => $settings["global"]["dynamicRender"],
]; ];
} else { } else {
//$template = $this->theme . "/page.twig"; //$template = $this->theme . "/page.twig";
@ -222,6 +223,7 @@ class Sorting
"meta" => $meta, "meta" => $meta,
"info" => $pageInfo, "info" => $pageInfo,
"menu" => $settings["menu"], "menu" => $settings["menu"],
"dynamicRender" => $settings["global"]["dynamicRender"],
]; ];
} }
return $pageOptions; return $pageOptions;

@ -11,7 +11,7 @@
{% endblock %} {% endblock %}
{% block stylesheets %} {% 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 %} {% endblock %}
{% block mainContent %} {% block mainContent %}
@ -160,11 +160,11 @@
</div> </div>
<div id="backup-settings"> <div id="backup-settings">
<div class="columns">
<div id="util-1" class="column is-one-third"> <div class="column">
<button id="create-backup">BACK UP YOUR SITE</button><br /> <button id="create-backup">BACK UP YOUR SITE</button><br />
</div> </div>
<div id="util-2" class="column is-three-fifths"> <div class="column">
{% if lastBackup != '' %} {% if lastBackup != '' %}
<div class="backup-meta"> <div class="backup-meta">
LAST BACK UP <a href="/api/v1/files">{{lastBackup}}</a><br /> LAST BACK UP <a href="/api/v1/files">{{lastBackup}}</a><br />
@ -173,6 +173,7 @@
<span>span No back ups. Frowny face.</span> <span>span No back ups. Frowny face.</span>
{% endif %} {% endif %}
</div> </div>
</div>
</div> </div>

@ -23,7 +23,16 @@
{{data.full_month}} {{data.full_month}}
</span> </span>
{% for page in data.pages %} {% for page in data.pages %}
{% 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 /> <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 %} {% endfor %}
</div> </div>

@ -34,7 +34,16 @@
<div class="right"> <div class="right">
{% if menu is defined %} {% if menu is defined %}
{% for link in menu %} {% for link in menu %}
{% 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 /> <a href="{{"/"~link.path~"/"~link.slug~".html"}}" class="menu-link">{{link.title}}</a><br />
{% endif %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
</div> </div>
@ -50,7 +59,16 @@
<footer> <footer>
<div class="inner"> <div class="inner">
{% 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 /> <a href="/archives.html">Archives</a><br />
{% endif %}
© 2020 By Fipamo © 2020 By Fipamo
</div> </div>
</footer> </footer>

@ -17,14 +17,31 @@
<div class="recent"> <div class="recent">
<span>RECENT</span><br /> <span>RECENT</span><br />
{% for item in recent %} {% for item in recent %}
{% 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 /> <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 %} {% endfor %}
</div> </div>
<div class="featured"> <div class="featured">
<span>FEATURED</span><br /> <span>FEATURED</span><br />
{% for item in featured %} {% for item in featured %}
{% 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 /> <a href="{{ "/"~item.path~"/"~item.slug~".html" }}"> {{item.title}} </a><br />
{% endif %}
{% endfor %} {% endfor %}
</div> </div>

@ -18,7 +18,16 @@
{{meta['who']}} dropped this {{ meta['when'] }}<br /> {{meta['who']}} dropped this {{ meta['when'] }}<br />
<strong>tags: </strong> <strong>tags: </strong>
{% for tag in meta['tags'] %} {% for tag in meta['tags'] %}
{% if dynamicRender is defined %}
{% if dynamicRender %}
<a href="{{ "/tags/"~tag.slug }}">{{ tag.label }}</a>
{% else %}
<a href="{{ "/tags/"~tag.slug~".html" }}">{{ tag.label }}</a> <a href="{{ "/tags/"~tag.slug~".html" }}">{{ tag.label }}</a>
{% endif %}
{% else %}
<a href="{{ "/tags/"~tag.slug~".html" }}">{{ tag.label }}</a>
{% endif %}
{% endfor %} {% endfor %}
</div> </div>
</div> </div>

@ -13,7 +13,17 @@
<article> <article>
<div class="page"> <div class="page">
{% for tag in tag_list %} {% 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 /> <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 %} {% endfor %}
</div> </div>

File diff suppressed because one or more lines are too long

@ -633,9 +633,9 @@
} }
}, },
"bulma": { "bulma": {
"version": "0.9.2", "version": "0.9.3",
"resolved": "https://registry.npmjs.org/bulma/-/bulma-0.9.2.tgz", "resolved": "https://registry.npmjs.org/bulma/-/bulma-0.9.3.tgz",
"integrity": "sha512-e14EF+3VSZ488yL/lJH0tR8mFWiEQVCMi/BQUMi2TGMBOk+zrDg4wryuwm/+dRSHJw0gMawp2tsW7X1JYUCE3A==" "integrity": "sha512-0d7GNW1PY4ud8TWxdNcP6Cc8Bu7MxcntD/RRLGWuiw/s0a9P+XlH/6QoOIrmbj6o8WWJzJYhytiu9nFjTszk1g=="
}, },
"cacheable-request": { "cacheable-request": {
"version": "6.1.0", "version": "6.1.0",

@ -12,7 +12,7 @@
"@babel/eslint-parser": "^7.14.5", "@babel/eslint-parser": "^7.14.5",
"animejs": "^3.2.1", "animejs": "^3.2.1",
"apidoc": "^0.28.1", "apidoc": "^0.28.1",
"bulma": "^0.9.2", "bulma": "^0.9.3",
"caret-pos": "^2.0.0", "caret-pos": "^2.0.0",
"jsdoc": "^3.6.7", "jsdoc": "^3.6.7",
"minami": "^1.2.3", "minami": "^1.2.3",

@ -43,7 +43,7 @@
width: 100% width: 100%
height: 33px height: 33px
#member-settings, #feature-settings, #option-settings, #token-settings #member-settings, #feature-settings, #option-settings, #token-settings, #backup-settings
background: $white background: $white
padding: 0px padding: 0px
border-radius: 5px 0 5px 0 border-radius: 5px 0 5px 0

Loading…
Cancel
Save