add wordle

This commit is contained in:
Jake 2022-01-25 11:48:34 +00:00
parent 1aa8e512b9
commit a29ef917c1
2 changed files with 36 additions and 0 deletions

5
_data/wordle.js Normal file
View File

@ -0,0 +1,5 @@
const fs = require('fs').promises;
module.exports = async (data) => {
return JSON.parse((await fs.readFile("/home/jakew/.wordle.json")).toString());
}

31
wordle.njk Normal file
View File

@ -0,0 +1,31 @@
---
title: wordle
layout: main
eleventyNavigation:
key: Wordle
---
<h1>Wordle</h1>
<p>Run <code>~jakew/wordle</code> on south london to play!</p>
{% for game in wordle.games | reverse %}
<div>
<h4>Day #{{ game.day }} ({{ game.score }}/6)</h4>
<p>
{% for line in game.lines %}
{% for i in range(0, 5) %}
{%- if i in line.correct -%}
🟩
{%- elif i in line.present -%}
🟨
{%- else -%}
{%- endif -%}
{% endfor %}
<br/>
{% endfor %}
</p>
</div>
{% endfor %}