diff options
| author | frosty <gabriel@bwaaa.monster> | 2026-09-20 20:52:03 -0400 |
|---|---|---|
| committer | frosty <gabriel@bwaaa.monster> | 2026-09-20 20:52:03 -0400 |
| commit | a65df93e236f72fb1b3e3b647c24a8dfbfe94b49 (patch) | |
| tree | 6a930b8e5ba60db72b07b2e897bf17c58ce61991 /examples | |
| parent | aabd4ce171f697de36dd7c6acd09a29bdb9f23f7 (diff) | |
feat: add query, query_all, find_by_id
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/site/build.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/site/build.lua b/examples/site/build.lua index 7a9dfd4..1d7368b 100644 --- a/examples/site/build.lua +++ b/examples/site/build.lua @@ -9,7 +9,7 @@ local features = { "mixed content" } -local feature_list = assert(html.find_by_class(page, "feature-list")) +local feature_list = assert(html.query(page, ".feature-list")) for _, feature in ipairs(features) do feature_list:append(html.element("li", nil, feature)) end @@ -20,20 +20,20 @@ for entry in fs.walk(".") do end table.sort(entries, function(left, right) return left.path < right.path end) -local summary = assert(html.find_by_class(page, "file-summary")) +local summary = assert(html.query(page, ".file-summary")) summary.text = tostring(#entries) .. " entries" -local file_list = assert(html.find_by_class(page, "file-list")) +local file_list = assert(html.query(page, ".file-list")) for _, entry in ipairs(entries) do html.append(file_list, html.element("li", nil, html.element("code", nil, entry.path), " (", entry.type, ")")) end -local build_summary = assert(html.find_by_class(page, "build-summary")) +local build_summary = assert(html.query(page, ".build-summary")) build_summary.text = "Built with " .. site.name .. " " .. site.version -local mixed = assert(html.find_by_class(page, "mixed-content")) +local mixed = assert(html.query(page, ".mixed-content")) mixed.children = { { kind = "comment", text = "generated by Lua" }, "Text with ", |
