From 63ea67e4c3c8caa2cf0dc6d7c940981bd40b3974 Mon Sep 17 00:00:00 2001 From: Stanisław Zagórowski Date: Mon, 15 Jan 2024 14:21:34 +0100 Subject: all: move out from luax/ --- common.luax | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 common.luax (limited to 'common.luax') diff --git a/common.luax b/common.luax new file mode 100644 index 0000000..ab29a02 --- /dev/null +++ b/common.luax @@ -0,0 +1,78 @@ +return function(props) + local use_cdn = reluax.dev_mode == false + local asset_prefix = use_cdn and "https://cdn.duckonaut.dev" or "" + + local thumbnail = props.attrs.thumbnail or + asset_prefix .. "/assets/images/thumbnail.png" + local title = props.attrs.title or "duckonaut.dev" + local description = props.attrs.description or "duckonaut's stuff" + local stylesheelts = props.attrs.stylesheets or + { 'app.css', + 'index.css', + 'contact.css', + 'project.css', + 'navbar.css', + 'carousel.css', + 'blog.css' + } + local scripts = props.attrs.scripts or + { 'index.js' } + + local style_tags = {} + for _, stylesheet in ipairs(stylesheelts) do + style_tags[#style_tags + 1] = + + end + + local script_tags = {} + for _, script in ipairs(scripts) do + script_tags[#script_tags + 1] = + + end + + return + + + + + + + + + + + + + + + + {$ script_tags $} + + {$ style_tags $} + + + + + + + + + + + {$ title $} + + + +
{$ props.children $}
+ + + +end -- cgit v1.3.1