Skip to content

Commit

Permalink
add handling of gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
zekth committed Jul 7, 2019
1 parent 2278335 commit 9221c8a
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 7 deletions.
6 changes: 5 additions & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ module.exports = function(eleventyConfig) {
eleventyConfig.addFilter("htmlDateString", dateObj => {
return DateTime.fromJSDate(dateObj, { zone: "utc" }).toFormat("yyyy-LL-dd");
});

eleventyConfig.addNunjucksFilter("basefilename", function(value) {
const arr = value.split('.');
arr.pop();
return arr.join('.');
});
eleventyConfig.addFilter("postCSS", function(code) {
return postcss([autoprefixer]).process(code).css;
});
Expand Down
11 changes: 11 additions & 0 deletions src/data/keebs.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,16 @@
"photos": [
"zekth-60-1.jpg"
]
},
{
"owner": "Zekth",
"name": "Stealth Split",
"pcb": "Keeb.io Quefrency 60%",
"switches": "Kailh Box Black",
"keyset": "Gentleman Black PBT",
"description": "Clavier split tout pété",
"photos": [
"zekth-quefrency-1.jpg"
]
}
]
Binary file modified src/img-keebs/zekth-60-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img-keebs/zekth-quefrency-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/includes/layouts/page.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
layout: layouts/base.njk
templateClass: tmpl-page
---
{{ content | safe }}
<section>
{{ content | safe }}
</section>
26 changes: 21 additions & 5 deletions src/keebs/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,24 @@ tags:
navtitle: Keebs
title: Keebs
---

{%- for k in keebs %}
{{ k.pcb }}
<img style="max-height:200px;max-width:300px;" src="{{ '/img/keebs/' | url }}{{ k.photos[0] }}"/>
{%- endfor %}
<table style="color:white">
<tr>
<th>img</th>
<th>Content</th>
</tr>
{%- for k in keebs %}
<tr>
<td><img src="{{ '/img-keebs/' | url }}{{ k.photos[0] | basefilename }}-320.jpg"/></td>
<td>
<ul>
<li>owner: {{ k.owner }}</li>
<li>name: {{ k.name }}</li>
<li>pcb: {{ k.pcb }}</li>
<li>switches: {{ k.switches }}</li>
<li>keyset: {{ k.keyset }}</li>
</ul>
<p>{{ k.description }}</p>
</td>
</tr>
{%- endfor %}
</table>

0 comments on commit 9221c8a

Please sign in to comment.