diff options
Diffstat (limited to 'lib/partials')
| -rw-r--r-- | lib/partials/article.p | 6 | ||||
| -rw-r--r-- | lib/partials/figure.p | 29 | ||||
| -rw-r--r-- | lib/partials/header.p | 21 | ||||
| -rw-r--r-- | lib/partials/picture.p | 14 | ||||
| -rw-r--r-- | lib/partials/section.p | 8 |
5 files changed, 78 insertions, 0 deletions
diff --git a/lib/partials/article.p b/lib/partials/article.p new file mode 100644 index 0000000..3e2ddfb --- /dev/null +++ b/lib/partials/article.p @@ -0,0 +1,6 @@ +@article[id;title;content] +<div class="article" id="$id"> + <h1 class="title">$title</h1> + $content +</div> +#end @article[] diff --git a/lib/partials/figure.p b/lib/partials/figure.p new file mode 100644 index 0000000..f853c96 --- /dev/null +++ b/lib/partials/figure.p @@ -0,0 +1,29 @@ +@USE +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/lib/partials/header.p b/lib/partials/header.p new file mode 100644 index 0000000..84e59d1 --- /dev/null +++ b/lib/partials/header.p @@ -0,0 +1,21 @@ +@USE +picture.p + +@header[brand] +$pokepi[ + $.[image/webp][/img/pokepi.webp] + $.[image/png][/img/pokepi.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> + } + </h1> +</header> +#end @header[] diff --git a/lib/partials/picture.p b/lib/partials/picture.p new file mode 100644 index 0000000..cdd1baf --- /dev/null +++ b/lib/partials/picture.p @@ -0,0 +1,14 @@ +@picture[images;default_type;.alt;.class;.role;.height] +<picture> + ^images.foreach[type;srcset]{ + <source srcset="$srcset" type="$type"> + } + <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/lib/partials/section.p b/lib/partials/section.p new file mode 100644 index 0000000..44135e1 --- /dev/null +++ b/lib/partials/section.p @@ -0,0 +1,8 @@ +@section[id;content;.title] +<section id="$id" class="section"> + ^if(def $title){ + <h2 class="title">$title</h2> + } + $content +</section> +#end @section[] |
