feat: add page to see article in draft
parent
0f554341e5
commit
81bcf5013a
|
@ -85,6 +85,10 @@ module.exports = function(eleventyConfig) {
|
|||
return articles.filter(article => !article.data.draft);
|
||||
});
|
||||
|
||||
eleventyConfig.addFilter("onlyDraft", articles => {
|
||||
return articles.filter(article => article.data.draft);
|
||||
});
|
||||
|
||||
// Return all the tags used in a collection
|
||||
eleventyConfig.addFilter("getAllTags", collection => {
|
||||
let tags = new Map();
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
layout: home.njk
|
||||
---
|
||||
<div class="main-content">
|
||||
<h1>Articles en construction</h1>
|
||||
|
||||
{% set articlesList = collections.articles | onlyDraft %}
|
||||
{% if articlesList.len > 0 %}
|
||||
{% include "articlesList.njk" %}
|
||||
{% else %}
|
||||
<p>Tous les articles sont en ligne ! Retournez à <a href="/blog/">l'accueil</a> pour les consulter.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<aside class="right-side">
|
||||
{% include "tagslist.njk" %}
|
||||
{% include "other_links.njk" %}
|
||||
</aside>
|
Loading…
Reference in New Issue