diff --git a/_includes/layouts/post.njk b/_includes/layouts/post.njk index f030e6c..6a17608 100644 --- a/_includes/layouts/post.njk +++ b/_includes/layouts/post.njk @@ -10,7 +10,7 @@ layout: layouts/base.njk #{{ tag }}  {%- endfor %}

-

{{ title | markdownify | safe}}

+

{% if draft %}DRAFT: {% endif %}{{ title | markdownify | safe}}

{% if synopsis %}

{{ synopsis | markdownify | safe}} diff --git a/_includes/postslist.njk b/_includes/postslist.njk index ea49fee..b4f70c6 100644 --- a/_includes/postslist.njk +++ b/_includes/postslist.njk @@ -8,7 +8,7 @@ {% endif %}

- {% if post.data.title %}{{ post.data.title | markdownify | safe }}{% else %}?{% endif %} + {% if post.data.draft %}DRAFT: {% endif %}{% if post.data.title %}{{ post.data.title | markdownify | safe }}{% else %}?{% endif %}

{% if not postListTypeMicroblog %} diff --git a/eleventy.config.js b/eleventy.config.js index 7826c3e..3f8b3d7 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -100,6 +100,14 @@ export default async function (eleventyConfig) { return arr.slice(1, arr.length); }); + // Preprocessors + // Exclude drafts from full build + eleventyConfig.addPreprocessor("drafts", "*", (data, content) => { + if (data.draft && process.env.ELEVENTY_RUN_MODE === "build") { + return false; + } + }); + // Transforms eleventyConfig.addTransform("prettier", function (content, outputPath) { if (outputPath && outputPath.endsWith(".html")) { diff --git a/public/css/index.css b/public/css/index.css index 0f96b80..8baa9db 100644 --- a/public/css/index.css +++ b/public/css/index.css @@ -448,6 +448,17 @@ main > p > a > img { width: 100%; padding-top: var(--space-l); } + +mark { + color: var(--background-color); + &.draftMarker { + font-family: var(--font-family-metadata); + font-style: normal; + letter-spacing: var(--letter-spacing-metadata); + text-transform: var(--text-transform-metadata); + } +} + pre { grid-column: var(--span-grid); }