WIP: use render function successfully

This commit is contained in:
Catalin Constantin Mititiuc 2025-06-16 20:18:04 -07:00
parent e829af2bc1
commit dee6534500
3 changed files with 18 additions and 25 deletions

View File

@ -4,4 +4,6 @@
## Posts ## Posts
$render{"test"}
- [recursive]($root/posts/2023-08-03-recursively-list-all-files-in-a-directory-with-elixir.html) - [recursive]($root/posts/2023-08-03-recursively-list-all-files-in-a-directory-with-elixir.html)

View File

@ -18,9 +18,22 @@ posts = (path=".") ->
files = [file for file in lfs.dir path when file != "." and file != ".."] files = [file for file in lfs.dir path when file != "." and file != ".."]
{join(path, file), target(file, "/posts") for _, file in ipairs files} {join(path, file), target(file, "/posts") for _, file in ipairs files}
-- renderer = require "sitegen.renderers.html"
-- Change output dir to what Openresty prefers -- Change output dir to what Openresty prefers
site! -- site = site!
site.config.out_dir = "html/" -- site.config.out_dir = "html/"
-- oof = site!
-- templates = site.templates
-- require"moon".p [k for k,v in pairs templates]
-- require"moon".p [k for k,v in pairs site.templates]
-- require"moon".p templates
-- require"moon".p renderer.Renderer.can_load("test.md")
-- require"moon".p renderer\helpers!
css = tools.system_command "cat < %s > %s", "css" css = tools.system_command "cat < %s > %s", "css"
@ -31,4 +44,5 @@ sitegen.create =>
add "index.md" add "index.md"
add path, target: target for path, target in pairs posts "docs" add path, target: target for path, target in pairs posts "docs"
build css, "app.css" build css, "app.css"

View File

@ -1,26 +1,3 @@
<!DOCTYPE html>
<html lang="en" style="scrollbar-gutter:stable;">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>$title</title>
<link
rel="stylesheet"
id="font-bitter-css"
href="//fonts.googleapis.com/css?family=Bitter:400,700"
type="text/css"
media="screen"
/>
<link rel="stylesheet" href="$root/app.css?$generate_date" />
</head>
<body class="bg-white">
<header>
<div style="display: inline-block;">
<h1><a href="/">Web Dev Solutions</a></h1>
<h3 style="text-align: left">Catalin Mititiuc</h3>
</div>
</header>
<main> <main>
$body $body
</main> </main>