feat: utilisation d'un config.json pour configurer les sites

Fixes #1
This commit is contained in:
Kazhnuz 2024-05-24 17:24:10 +02:00
parent 277d2e003e
commit 334a60024f
2 changed files with 61 additions and 46 deletions

48
_data/config.json Normal file
View file

@ -0,0 +1,48 @@
{
"featuredSites":[
{"nom":"Kobold Cafe", "url":"https://kobold.cafe/"},
{"nom":"Site 2", "url":"#"},
{"nom":"Site 3", "url":"#"}
],
"siteBlocks":[
{
"nom":"Social",
"sites":[
{"nom":"Mastodon", "url":"https://mastodon.social/"},
{"nom":"Pixelfed", "url":"https://pixelfed.fr/"},
{"nom":"Tumblr", "url":"https://tumblr.com/"}
]
},
{
"nom":"Sites hébergés",
"sites":[
{"nom":"Kazhnuz Space", "url":"https://kazhnuz.space/"},
{"nom":"Quarante Douze", "url":"https://quarante-douze.net/"},
{"nom":"Withelias", "url":"https://withelias.kobold.cafe/"},
{"nom":"Distant Flare", "url":"https://distantflare.kobold.cafe/"},
{"nom":"Fanstuff Garden", "url":"https://fanstuff.garden/"}
]
},
{
"nom":"Favoris",
"sites":[
{"nom":"Neocities", "url":"https://neocities.org/"},
{"nom":"Webidev", "url":"https://webidev.com/"}
]
},
{
"nom":"Arts créatifs",
"sites":[
{"nom":"Bandcamp", "url":"https://bandcamp.com/"},
{"nom":"Webtoon", "url":"https://webtoon.com/"}
]
},
{
"nom":"Tutoriels",
"sites":[
{"nom":"Docs accessibilités", "url":"https://quarante-douze.net/liens-et-guides-sur-laccessibilite/"},
{"nom":"Docs web", "url":"https://quarante-douze.net/liens-et-guides-pour-le-dev-web/"}
]
}
]
}

View file

@ -22,55 +22,22 @@
</form>
<div class="featured">
<a href="#" rel="noopener"> <i class="fa fa-fw fa-globe"></i> Site favori 1 </a>
<a href="#" rel="noopener"> <i class="fa fa-fw fa-globe"></i> Site favori 2 </a>
<a href="#" rel="noopener"> <i class="fa fa-fw fa-globe"></i> Site favori 3 </a>
{%- for site in config.featuredSites -%}
<a href="{{ site.url }}" rel="noopener">{{ site.nom }}</a>
{%- endfor -%}
</div>
<div class="cols">
<div class="linklist">
<h2><i class="fa fa-comments-o"></i> Social</h2>
<ul>
<li><a href="https://mastodon.social" rel="noopener"><i class="fa fa-fw fa-mastodon"></i> Mastodon</a></li>
<li><a href="https://pixelfed.fr" rel="noopener"><i class="fa fa-fw fa-pixelfed"></i> Pixelfed</a></li>
<li><a href="https://tumblr.com" rel="noopener"><i class="fa fa-fw fa-tumblr"></i> Tumblr</a></li>
</ul>
</div>
<div class="linklist">
<h2><i class="fa fa-file-text"></i> Sites</h2>
<ul>
<li><a href="https://kazhnuz.space" rel="noopener"><i class="fa fa-fw fa-star"></i> kazhnuz.space</a></li>
<li><a href="https://quarante-douze.net" rel="noopener"><i class="fa fa-fw fa-gear"></i> Quarante-Douze</a></li>
</ul>
</div>
<div class="linklist">
<h2><i class="fa fa-heart"></i> Favs</h2>
<ul>
<li><a href="https://neocities.org" rel="noopener"><i class="fa fa-fw fa-heart"></i> Neocities</a></li>
<li><a href="https://webidev.com" rel="noopener"><i class="fa fa-fw fa-heart"></i> Webidev</a></li>
</ul>
</div>
<div class="linklist">
<h2><i class="fa fa-paint-brush"></i> Arts/Créa</h2>
<ul>
<li><a href="https://bandcamp.com" rel="noopener"><i class="fa fa-fw fa-music"></i> Bandcamp</a></li>
<li><a href="https://webtoon.com" rel="noopener"><i class="fa fa-fw fa-image"></i> Webtoon</a></li>
<li><a href="https://www.patreon.com/home" rel="noopener"><i class="fa fa-fw fa-patreon"></i> Patreon</a></li>
</ul>
</div>
<div class="linklist">
<h2><i class="fa fa-question"></i> Tutos</h2>
<ul>
<li><a href="https://quarante-douze.net/liens-et-guides-sur-laccessibilite/" rel="noopener"><i class="fa fa-fw fa-universal-access"></i> Docs a11y</a></li>
<li><a href="https://quarante-douze.net/liens-et-guides-pour-le-dev-web/" rel="noopener"><i class="fa fa-fw fa-html5"></i> Docs web</a></li>
<li><a href="https://love2d.org/wiki/Main_Page" rel="noopener"><i class="fa fa-fw fa-gamepad"></i> Docs love2D</a></li>
<li><a href="https://cheatography.com/bouchnouk/cheat-sheets/commandes-de-base-linux/" rel="noopener"><i class="fa fa-fw fa-linux"></i> Commands linux</a></li>
</ul>
</div>
{%- for siteBlock in config.siteBlocks -%}
<div class="linklist">
<h2><i class="fa fa-comments-o"></i> {{ siteBlock.nom }}</h2>
<ul>
{%- for site in siteBlock.sites -%}
<li><a href="{{ site.url }}" rel="noopener">{{ site.nom }}</a></li>
{%- endfor -%}
</ul>
</div>
{%- endfor -%}
</div>
</main>
</body>