Implement draft system
This commit is contained in:
@@ -10,7 +10,7 @@ layout: layouts/base.njk
|
|||||||
<a href="{{ tagUrl }}">#{{ tag }} </a>
|
<a href="{{ tagUrl }}">#{{ tag }} </a>
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
</p>
|
</p>
|
||||||
<h1>{{ title | markdownify | safe}}</h1>
|
<h1>{% if draft %}<mark class="draftMarker">DRAFT:</mark> {% endif %}{{ title | markdownify | safe}}</h1>
|
||||||
{% if synopsis %}
|
{% if synopsis %}
|
||||||
<p class="post-synopsis">
|
<p class="post-synopsis">
|
||||||
{{ synopsis | markdownify | safe}}
|
{{ synopsis | markdownify | safe}}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<a href="{{ post.url }}" class="postlist-link">
|
<a href="{{ post.url }}" class="postlist-link">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<h3>
|
<h3>
|
||||||
{% if post.data.title %}{{ post.data.title | markdownify | safe }}{% else %}?{% endif %}
|
{% if post.data.draft %}<mark class="draftMarker">DRAFT:</mark> {% endif %}{% if post.data.title %}{{ post.data.title | markdownify | safe }}{% else %}?{% endif %}
|
||||||
</h3>
|
</h3>
|
||||||
{% if not postListTypeMicroblog %}
|
{% if not postListTypeMicroblog %}
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -100,6 +100,14 @@ export default async function (eleventyConfig) {
|
|||||||
return arr.slice(1, arr.length);
|
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
|
// Transforms
|
||||||
eleventyConfig.addTransform("prettier", function (content, outputPath) {
|
eleventyConfig.addTransform("prettier", function (content, outputPath) {
|
||||||
if (outputPath && outputPath.endsWith(".html")) {
|
if (outputPath && outputPath.endsWith(".html")) {
|
||||||
|
|||||||
@@ -448,6 +448,17 @@ main > p > a > img {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
padding-top: var(--space-l);
|
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 {
|
pre {
|
||||||
grid-column: var(--span-grid);
|
grid-column: var(--span-grid);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user