#load "../../lib/app.uce" COMPONENT(Request& context) { starter_boot(context); String page_type = first(context.var["starter"]["page_type"].to_string(), "html"); if(context.flags.status >= 300 && context.flags.status < 400) return; if(page_type == "blank") { print(context.call["main_html"].to_string()); return; } if(page_type == "json") { context.header["Content-Type"] = "application/json"; context.header["Cache-Control"] = "no-cache, no-store, must-revalidate"; if(context.var["starter"]["json"].get_type_name() == "array") { print(json_encode(context.var["starter"]["json"])); } else { print(context.call["main_html"].to_string()); } return; } 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") body_class = "portal-theme portal-dark-theme dark-theme" + String(embed_mode ? " embed-mode" : ""); else if(theme_key == "portal-light") body_class = "portal-theme portal-light-theme" + String(embed_mode ? " embed-mode" : ""); else if(theme_key == "localfirst") body_class = "admin-page localfirst-theme dark-theme" + String(embed_mode ? " embed-mode" : ""); else if(theme_key == "retro-gaming") body_class = embed_mode ? "embed-mode" : ""; <> "> >
>
} COMPONENT:HEAD(Request& context) { starter_boot(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); <> <?= title + " | " + context.cfg.get_by_path("site/name").to_string() ?> }