summaryrefslogtreecommitdiffstats
path: root/partials
diff options
context:
space:
mode:
authormaike <maike@synzr.tw>2026-09-02 00:23:42 +0500
committermaike <maike@synzr.tw>2026-09-02 00:23:42 +0500
commite7c15e2602e49355444f5d90819dfd0ea66e47bf (patch)
treee6e028ee4fd86523015d7bc36f7dca7dff7fb69f /partials
parentd5f4539e7ab6cb00513cd428b6ab08c67ddd6bc9 (diff)
downloadhamster-e7c15e2602e49355444f5d90819dfd0ea66e47bf.tar.gz
hamster-e7c15e2602e49355444f5d90819dfd0ea66e47bf.tar.bz2
hamster-e7c15e2602e49355444f5d90819dfd0ea66e47bf.zip
Basic article layout
Diffstat (limited to 'partials')
-rw-r--r--partials/_article.p7
-rw-r--r--partials/_header.p18
-rw-r--r--partials/_picture.p8
-rw-r--r--partials/_section.p7
4 files changed, 32 insertions, 8 deletions
diff --git a/partials/_article.p b/partials/_article.p
new file mode 100644
index 0000000..b397998
--- /dev/null
+++ b/partials/_article.p
@@ -0,0 +1,7 @@
+@article[id;title;content]
+<div class="article" id="$id">
+ <h1 class="title">$title</h1>
+
+ $content
+</div>
+#end @article[]
diff --git a/partials/_header.p b/partials/_header.p
index ca070ea..2525cf3 100644
--- a/partials/_header.p
+++ b/partials/_header.p
@@ -1,16 +1,18 @@
-@header[]
-$brand[synzr]
+@USE
+/partials/_picture.p
-<header class="header clearfix">
- <picture>
- <source srcset="/img/pokepi.webp" type="image/webp">
- <source srcset="/img/pokepi.png" type="image/png">
- <img src="/img/pokepi.png" alt="Моя покеписона" class="pokepi">
- </picture>
+@header[brand]
+$pokepi[
+ $.[image/png][/img/pokepi.png]
+ $.[image/webp][/img/pokepi.webp]
+]
+<header class="header clearfix">
+ ^picture[$pokepi;Мой покепи;pokepi;image/png]
<h1 class="brand">
^for[i](0;^brand.length[] - 1){
<span class="letter">^brand.mid($i;1)</span>
}
</h1>
</header>
+#end @header[]
diff --git a/partials/_picture.p b/partials/_picture.p
new file mode 100644
index 0000000..9128f1f
--- /dev/null
+++ b/partials/_picture.p
@@ -0,0 +1,8 @@
+@picture[images;alt;class;default]
+<picture>
+ ^images.foreach[type;srcset]{
+ <source srcset="$srcset" type="$type">
+ }
+ <img src="$images.[$default]" alt="$alt" class="$class">
+</picture>
+#end @picture[]
diff --git a/partials/_section.p b/partials/_section.p
new file mode 100644
index 0000000..d6e0b66
--- /dev/null
+++ b/partials/_section.p
@@ -0,0 +1,7 @@
+@section[id;title;content]
+<section id="$id" class="section">
+ <h2 class="title">$title</h2>
+
+ $content
+</section>
+#end @section[]