From d12f5c21184b0ebba8d16362c7030576950774c4 Mon Sep 17 00:00:00 2001 From: Loris Cro Date: Fri, 26 Jul 2024 18:04:02 +0200 Subject: [PATCH] update --- build.zig.zon | 4 ++-- content/documentation/index.md | 4 ++-- content/documentation/scripty/index.md | 22 ++++++++++++++++--- content/log.md | 30 ++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 7 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index d079431..ae3c074 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -3,8 +3,8 @@ .version = "0.0.0", .dependencies = .{ .zine = .{ - .url = "git+https://github.com/kristoff-it/zine?ref=v0.1.1#4e9a598fa2cb50b886597c636f5788a1333ad695", - .hash = "12207fb7cb27d47e4b2749e72f03d8a941c3dbbcaeb27e3224f8e5ef13341458e898", + .url = "git+https://github.com/kristoff-it/zine?ref=v0.1.3#6d52e6a3d0c578481af6181dd41b1a0163dfc953", + .hash = "1220c7a5284269c9aca520c601438155d81dc4e27cb79696b6648aef24686d4c942d", }, }, .paths = .{"."}, diff --git a/content/documentation/index.md b/content/documentation/index.md index d9b19a7..c5d483c 100644 --- a/content/documentation/index.md +++ b/content/documentation/index.md @@ -35,8 +35,8 @@ Your website only needs the following two files to get started: .name = "sample website", .version = "0.0.0", .dependencies = .{ - .url = "git+https://github.com/kristoff-it/zine#v0.1.0", - .hash = "1220e9f603ff14b5ec69442f0287588ad20072d836b05b3a7e4100dd30e95fef1cd3", + .url = "git+https://github.com/kristoff-it/zine#v0.1.3", + .hash = "1220c7a5284269c9aca520c601438155d81dc4e27cb79696b6648aef24686d4c942d", }, .paths = .{"."}, } diff --git a/content/documentation/scripty/index.md b/content/documentation/scripty/index.md index 11f2e97..fe2c664 100644 --- a/content/documentation/scripty/index.md +++ b/content/documentation/scripty/index.md @@ -21,7 +21,7 @@ The current page. The iteration element in a loop, only available inside of elements with a `loop` attribute. ## $if : ?V -The payload of an optional value, only available inside of elements with an `if` attribute. +The payload of an optional value, only available inside of elemens with an `if` attribute. # Types ## Site ### host_url : str, @@ -65,7 +65,7 @@ the current page is an 'index.md' page). Examples: ``` -
+$page.isSection() ``` ### subpages() -> [Page] Only available on 'index.md' pages, as those are the pages @@ -130,6 +130,22 @@ Examples: ``` $page.title.len() ``` +### endsWith(str) -> bool +Returns true if the receiver ends with the provided string. + + +Examples: +``` +$page.permalink().endsWith("/blog/") +``` +### eql(str) -> bool +Returns true if the receiver equals the provided string. + + +Examples: +``` +$page.author.eql("Loris Cro") +``` ### suffix(str, [...str]) -> str Concatenates strings together (left-to-right). @@ -276,7 +292,7 @@ $page.draft.or($site.tags.len().eq(0)) ``` ## dyn ### get?(str) -> ?dyn -Tries to get a dynamic value, to be used in conjunction with an `if` attribute. +Tries to get a dynamic value, to be used in conjuction with an `if` attribute. Examples: diff --git a/content/log.md b/content/log.md index 6879306..4f292a1 100644 --- a/content/log.md +++ b/content/log.md @@ -19,6 +19,11 @@ pre { overflow: hidden; text-overflow: ellipsis; } +pre:has(.superhtml) { + overflow: hidden; + text-overflow: unset; + overflow-x: auto; +} pre:has(.sh) { color: #111; background-color: #ccc; @@ -35,6 +40,31 @@ window.onload = function() { } +### 2024-7-26 + + +```sh +zig fetch --save "git+https://github.com/kristoff-it/zine#v0.1.3" +``` +- Scripty strings now have `eql`, `contains` and `endsWith`. With a pinch of creativity you can create menus that style differently the current active page: + ```superhtml +
+ Blog +
+ ``` + Similarly, when printing out the list of pages in a section, you can filter-out occasional "miscellaneous" (as in belonging to the same section but unwanted in the current list): + ```superhtml +
+
+ +
+
+ ``` +- The [SuperHTML CLI tool](https://github.com/kristoff-it/superhtml) was updated with two new commands: + - `check`: checks HTML and SuperHTML template files for syntax errors, useful if you don't have / want LSP integration (see also `fmt` in such case). + - `interface`: prints out the interface of a given SuperHTML template file, + useful to bootstrap a new SuperHTML template that extends another. + ### 2024-7-25