Codehilite disclaimer
This commit is contained in:
parent
ae4d30ade9
commit
85e59a6e29
@ -58,5 +58,6 @@ sites:
|
|||||||
- '*.md'
|
- '*.md'
|
||||||
- 'essentials/*.md'
|
- 'essentials/*.md'
|
||||||
- '**/*.md'
|
- '**/*.md'
|
||||||
# TODO: add newsletter
|
template_selections:
|
||||||
|
article: templates.components.jimoire_article
|
||||||
|
|
||||||
@ -142,6 +142,8 @@ def build_articles(
|
|||||||
# Sort the articles in order of ascending date.
|
# Sort the articles in order of ascending date.
|
||||||
sorted_articles = sorted([*index.values()], key = lambda a: a.metadata.date)
|
sorted_articles = sorted([*index.values()], key = lambda a: a.metadata.date)
|
||||||
|
|
||||||
|
# TODO: add support for a metadata-based serial number or next/previous article link, instead of assuming date-based series ordering.
|
||||||
|
|
||||||
# Include the previous and next articles (if available) in the iteration
|
# Include the previous and next articles (if available) in the iteration
|
||||||
# in case the article template wants to link to them.
|
# in case the article template wants to link to them.
|
||||||
for previous_article, article, next_article in zip(
|
for previous_article, article, next_article in zip(
|
||||||
|
|||||||
@ -305,3 +305,12 @@ pre:has(> code), mark{
|
|||||||
font-display: swap;
|
font-display: swap;
|
||||||
background-color: #d8d8d8;
|
background-color: #d8d8d8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.codehilite-disclaimer{
|
||||||
|
font-size: 0.85em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hide codehilite disclaimer when there are no fenced code blocks. */
|
||||||
|
article:not(:has(.codehilite)) .codehilite-disclaimer{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
@ -1,20 +0,0 @@
|
|||||||
<article>
|
|
||||||
<span class="first-published-label">First published: </span>
|
|
||||||
<time class="first-published-date" pubdate data="{article.metadata.date}" datetime="{article.metadata.date}">{article.metadata.date}</time>
|
|
||||||
<span class="last-modified-label"> · Last modified: </span>
|
|
||||||
<time class="last-modified-date" data="{article.metadata.lastmod}" datetime="{article.metadata.lastmod}">{article.metadata.lastmod}</time>
|
|
||||||
<hr />
|
|
||||||
<h1 class="headline">{article.metadata.title}</h1>
|
|
||||||
<p class="byline">
|
|
||||||
<address class="author">By <a rel="author" href="mailto:admin@jimlab.io">Jim Shepich III</a></address>
|
|
||||||
</p>
|
|
||||||
{article.content}
|
|
||||||
<br /><hr /><br />
|
|
||||||
<p>
|
|
||||||
<!-- TODO: highlightjs.org -->
|
|
||||||
<a href="{site.base_url}/{previous_article.path}" title="{previous_article.metadata.title}" data="{previous_article.path}" class="previous-article-link">< Previous</a>
|
|
||||||
<!-- This non-breaking space prevents the RSS icon from getting weird when previous-article-link is hidden. -->
|
|
||||||
<a href="{site.base_url}/{next_article.path}" title="{next_article.metadata.title}" data="{next_article.path}" class="next-article-link">Next ></a>
|
|
||||||
</p>
|
|
||||||
<p>Tags: {blog_tags}{templates.components.rss_icon}</p>
|
|
||||||
</article>
|
|
||||||
11
site/templates/components/jimoire_article.html
Normal file
11
site/templates/components/jimoire_article.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<article>
|
||||||
|
<span class="first-published-label">First published: </span>
|
||||||
|
<time class="first-published-date" pubdate data="{article.metadata.date}" datetime="{article.metadata.date}">{article.metadata.date}</time>
|
||||||
|
<span class="last-modified-label"> · Last modified: </span>
|
||||||
|
<time class="last-modified-date" data="{article.metadata.lastmod}" datetime="{article.metadata.lastmod}">{article.metadata.lastmod}</time>
|
||||||
|
<hr />
|
||||||
|
<h1 class="headline">{article.metadata.title}</h1>
|
||||||
|
{article.content}
|
||||||
|
<hr />
|
||||||
|
<p class="codehilite-disclaimer">Syntax highlighting <a href="/assets/css/codehilite.css" target="_blank">stylesheet</a> generated using <a href="https://pygments.org/" target="_blank">Pygments</a></p>
|
||||||
|
</article>
|
||||||
Loading…
x
Reference in New Issue
Block a user