decided in favor of dedicated COMPONENT() macro, updates to documentation
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#load "../../lib/app.uce"
|
||||
|
||||
RENDER(Request& context)
|
||||
COMPONENT(Request& context)
|
||||
{
|
||||
starter_boot(context);
|
||||
|
||||
@@ -29,7 +29,7 @@ RENDER(Request& context)
|
||||
return;
|
||||
}
|
||||
|
||||
String theme_key = starter_theme_value("key", context);
|
||||
String theme_key = context.cfg.get_by_path("theme/key").to_string();
|
||||
bool embed_mode = context.var["starter"]["embed_mode"].to_string() == "1";
|
||||
String body_class = embed_mode ? "embed-mode" : "";
|
||||
if(theme_key == "portal-dark")
|
||||
@@ -43,9 +43,9 @@ RENDER(Request& context)
|
||||
|
||||
<>
|
||||
<!doctype html>
|
||||
<html class="<?= starter_html_class(context) ?>" lang="en" data-theme-key="<?= starter_theme_value("key", context) ?>">
|
||||
<html class="<?= starter_html_class(context) ?>" lang="en" data-theme-key="<?= context.cfg.get_by_path("theme/key").to_string() ?>">
|
||||
<head>
|
||||
<? render_component("page_shell:HEAD", context.call, context); ?>
|
||||
<? render_component(":HEAD", context.call, context); ?>
|
||||
</head>
|
||||
<body<?: body_class != "" ? " class=\"" + html_escape(body_class) + "\"" : "" ?>>
|
||||
<? if(theme_key == "retro-gaming") { ?><div class="retro-stars"></div><? } ?>
|
||||
@@ -61,10 +61,10 @@ RENDER(Request& context)
|
||||
<nav class="admin-nav">
|
||||
<div class="admin-nav-header">
|
||||
<a class="admin-nav-title" href="<?= starter_link("", context) ?>">
|
||||
<img class="admin-nav-logo-img" src="<?= starter_asset_url("themes/localfirst/img/local_first_logo.png", context) ?>" alt="<?= starter_cfg_string("site/name", context) ?>" />
|
||||
<img class="admin-nav-logo-img" src="<?= starter_asset_url("themes/localfirst/img/local_first_logo.png", context) ?>" alt="<?= context.cfg.get_by_path("site/name").to_string() ?>" />
|
||||
</a>
|
||||
</div>
|
||||
<? starter_cfg("menu", context).each([&](DTree menu_item, String menu_key) {
|
||||
<? context.cfg.get_by_path("menu").each([&](DTree menu_item, String menu_key) {
|
||||
if(menu_item["hidden"].to_string() == "1")
|
||||
return;
|
||||
String current_path = context.var["starter"]["route"]["l_path"].to_string();
|
||||
@@ -95,17 +95,17 @@ RENDER(Request& context)
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:HEAD(Request& context)
|
||||
COMPONENT:HEAD(Request& context)
|
||||
{
|
||||
starter_boot(context);
|
||||
String title = first(context.var["starter"]["page_title"].to_string(), starter_cfg_string("site/default_page_title", context));
|
||||
String description = first(starter_theme_value("meta_description", context), "UCE starter example");
|
||||
String theme_color = first(starter_theme_value("theme_color", context), "#0f172a");
|
||||
String icon = starter_asset_url(starter_theme_value("path", context) + "icon.png", context);
|
||||
String title = first(context.var["starter"]["page_title"].to_string(), context.cfg.get_by_path("site/default_page_title").to_string());
|
||||
String description = first(context.cfg.get_by_path("theme/meta_description").to_string(), "UCE starter example");
|
||||
String theme_color = first(context.cfg.get_by_path("theme/theme_color").to_string(), "#0f172a");
|
||||
String icon = starter_asset_url(context.cfg.get_by_path("theme/path").to_string() + "icon.png", context);
|
||||
|
||||
<>
|
||||
<meta charset="utf-8">
|
||||
<title><?= title + " | " + starter_cfg_string("site/name", context) ?></title>
|
||||
<title><?= title + " | " + context.cfg.get_by_path("site/name").to_string() ?></title>
|
||||
<meta name="description" content="<?= description ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="theme-color" content="<?= theme_color ?>">
|
||||
|
||||
Reference in New Issue
Block a user