From 2294bc65825972106aff44f2ad8204c4f2af30f4 Mon Sep 17 00:00:00 2001 From: Stanisław Zagórowski Date: Fri, 12 Jan 2024 18:44:38 +0100 Subject: luax: initial --- luax/components/project.luax | 60 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 luax/components/project.luax (limited to 'luax/components/project.luax') diff --git a/luax/components/project.luax b/luax/components/project.luax new file mode 100644 index 0000000..ddb8c69 --- /dev/null +++ b/luax/components/project.luax @@ -0,0 +1,60 @@ +local Carousel = require('components.carousel') + +function getProjectImageLink(project, image) + return 'assets/' .. project.type .. 's/' .. project.name_normalized .. '/' .. image +end + +function getProjectTechIconLink(tech) + return 'assets/images/' .. tech .. '.png' +end + +function getProjectTargetIconLink(target) + return 'assets/images/' .. target .. '.png' +end + +return function (props) + local project = props.attrs.project + local techs = {} + for _, tech in ipairs(project.tech) do + techs[#techs + 1] = + end + local targets = {} + for _, target in ipairs(project.targets) do + targets[#targets + 1] = + end + + local images = nil + if project.images then + images = {} + for _, image in ipairs(project.images) do + images[#images + 1] = + end + + images = {$ images $} + end + + return ( +
+ +
+
+
Made using
+
+ {$ techs $} +
+
+
+
Available on
+
+ {$ targets $} +
+
+
+
+ {$ project.description $} +
+
+ {$ images $} +
+ ) +end -- cgit v1.3.1