summaryrefslogtreecommitdiffstats
path: root/partials
diff options
context:
space:
mode:
authormaike <maike@synzr.tw>2026-09-02 21:41:31 +0500
committermaike <maike@synzr.tw>2026-09-02 22:20:44 +0500
commite176c0f0709bd17a46d943b96e631a3f2b1320fb (patch)
tree422c5fec7cb4b1f90ec4d895b7f86329bcddb87e /partials
parente7c15e2602e49355444f5d90819dfd0ea66e47bf (diff)
downloadhamster-e176c0f0709bd17a46d943b96e631a3f2b1320fb.tar.gz
hamster-e176c0f0709bd17a46d943b96e631a3f2b1320fb.tar.bz2
hamster-e176c0f0709bd17a46d943b96e631a3f2b1320fb.zip
Clickable IRL photo
Diffstat (limited to 'partials')
-rw-r--r--partials/_article.p1
-rw-r--r--partials/_figure.p29
-rw-r--r--partials/_header.p9
-rw-r--r--partials/_picture.p10
-rw-r--r--partials/_section.p7
5 files changed, 47 insertions, 9 deletions
diff --git a/partials/_article.p b/partials/_article.p
index b397998..3e2ddfb 100644
--- a/partials/_article.p
+++ b/partials/_article.p
@@ -1,7 +1,6 @@
@article[id;title;content]
<div class="article" id="$id">
<h1 class="title">$title</h1>
-
$content
</div>
#end @article[]
diff --git a/partials/_figure.p b/partials/_figure.p
new file mode 100644
index 0000000..df7c653
--- /dev/null
+++ b/partials/_figure.p
@@ -0,0 +1,29 @@
+@USE
+/partials/_picture.p
+
+@figure[images;default_type;.caption;.alt;.height;.href]
+^if(def $alt){
+ $resolved_alt[$alt]
+}(def $caption){
+ $resolved_alt[$caption]
+}
+
+<figure class="figure">
+# HACK боже какое оно вонючее
+ ^if(def $href){
+ <a href="$href">
+ }
+ ^picture[$images;$default_type;
+ $.alt[$resolved_alt]
+ $.height[$height]
+ $.class[image]
+ ]
+ ^if(def $href){
+ </a>
+ }
+
+ ^if(def $caption){
+ <figcaption class="caption">$caption</figcaption>
+ }
+</figure>
+#end @figure[]
diff --git a/partials/_header.p b/partials/_header.p
index 2525cf3..5f57f7c 100644
--- a/partials/_header.p
+++ b/partials/_header.p
@@ -3,12 +3,15 @@
@header[brand]
$pokepi[
- $.[image/png][/img/pokepi.png]
$.[image/webp][/img/pokepi.webp]
+ $.[image/png][/img/pokepi.png]
]
-<header class="header clearfix">
- ^picture[$pokepi;Мой покепи;pokepi;image/png]
+<header class="header clearfix" role="presentation">
+ ^picture[$pokepi;image/png;
+ $.alt[Мой покепи]
+ $.class[pokepi]
+ ]
<h1 class="brand">
^for[i](0;^brand.length[] - 1){
<span class="letter">^brand.mid($i;1)</span>
diff --git a/partials/_picture.p b/partials/_picture.p
index 9128f1f..cdd1baf 100644
--- a/partials/_picture.p
+++ b/partials/_picture.p
@@ -1,8 +1,14 @@
-@picture[images;alt;class;default]
+@picture[images;default_type;.alt;.class;.role;.height]
<picture>
^images.foreach[type;srcset]{
<source srcset="$srcset" type="$type">
}
- <img src="$images.[$default]" alt="$alt" class="$class">
+ <img
+ src="$images.[$default_type]"
+ ^if(def $alt){alt="$alt"}
+ ^if(def $class){class="$class"}
+ ^if(def $role){role="$role"}
+ ^if(def $height){height="$height"}
+ >
</picture>
#end @picture[]
diff --git a/partials/_section.p b/partials/_section.p
index d6e0b66..44135e1 100644
--- a/partials/_section.p
+++ b/partials/_section.p
@@ -1,7 +1,8 @@
-@section[id;title;content]
+@section[id;content;.title]
<section id="$id" class="section">
- <h2 class="title">$title</h2>
-
+ ^if(def $title){
+ <h2 class="title">$title</h2>
+ }
$content
</section>
#end @section[]