From d5c0555775ac835f75246a17b5e6f3ddc353d82b Mon Sep 17 00:00:00 2001 From: Stanisław Zagórowski Date: Sun, 14 Jan 2024 22:14:50 +0100 Subject: all: add dev mode for local testing, fix metadata --- luax/common.luax | 53 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 14 deletions(-) (limited to 'luax/common.luax') diff --git a/luax/common.luax b/luax/common.luax index 0bd3cf7..ab29a02 100644 --- a/luax/common.luax +++ b/luax/common.luax @@ -1,8 +1,39 @@ return function(props) -return + 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 - + @@ -23,26 +54,20 @@ return - + {$ script_tags $} - - - - - - - + {$ style_tags $} - - - + + + - duckonaut.dev + {$ title $} -- cgit v1.3.1