Add tech blog theme

- Add code colorizer Markdig plugin
This commit is contained in:
2022-05-05 02:15:36 -04:00
parent 22ed55c820
commit f106f2b10e
12 changed files with 582 additions and 4 deletions

View File

@@ -23,11 +23,14 @@
<footer>
<p>
{%- if category_count > 0 -%}
Categorized under: {{ cat_names | reverse | join: ", " }}
{%- for cat in post.category_ids -%}
{%- assign cat_names = model.categories | value: cat | split: "," | concat: cat_names -%}
{%- assign this_cat = categories | where: "id", cat | first -%}
{{ this_cat.name }},
{%- assign cat_names = this_cat.name | concat: cat_names -%}
{%- endfor -%}
Categorized under: {{ cat_names | reverse | join: ", " }}<br>
{%- assign cat_names = "" -%}
<br>
{% endif -%}
{%- if tag_count > 0 %}
Tagged: {{ post.tags | join: ", " }}

View File

@@ -0,0 +1,44 @@
{% if is_category or is_tag %}
<h1>{{ page_title }}</h1>
{%- if subtitle %}
<p>{{ subtitle }}</p>
{%- endif %}
{% endif %}
{%- for post in model.posts %}
<article class="auto">
<div>
<h1 class="home-title">
<small class="home-lead">{{ post.published_on | date: "dddd, MMMM d, yyyy" }}</small><br>
&nbsp;
<a href="/{{ post.permalink }}" title="Permanent Link to &quot;{{ post.title | strip_html | escape }}&quot;">
{{ post.title }}
</a>
</h1>
</div>
<div class="entry-content">{{ post.text }}</div>
{%- assign cat_count = post.category_ids | size -%}
{%- if cat_count > 0 %}
<small class="category-list">
Categorized under
{%- for cat_id in post.category_ids %}
{%- assign cat = categories | where: "id", cat_id | first -%}
<span>
<a href="/category/{{ cat.slug }}/"
title="Categorized under {{ cat.name | strip_html | escape }}" rel="tag">{{ cat.name }}</a></span>
{%- endfor %}
</small><br>
{%- endif %}
{%- assign tag_count = post.tags | size -%}
{%- if tag_count > 0 %}
<small class="category-list">
Tagged
{%- for tag in post.tags %}
<span>
<a href="/tag/{{ tag | replace: " ", "+" }}/"
title="Tagged &ldquo;{{ tag | escape }}&rdquo;" rel="tag">{{ tag }}</a></span>
{%- endfor %}
</small><br>
{%- endif %}
{%- if logged_on %}<small><a href="/post/{{ post.id }}/edit">Edit Post</a></small>{% endif %}
</article>
{%- endfor %}

View File

@@ -0,0 +1,86 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="{{ generator }}">
<title>
{%- if is_home %}
{{ web_log.name }}{% if web_log.subtitle %} | {{ web_log.subtitle.value }}{% endif %}
{%- else %}
{{ page_title | strip_html }}{% if page_title and page_title != "" %} &raquo; {% endif %}{{ web_log.name }}
{%- endif %}
</title>
<link rel="stylesheet" href="/themes/tech-blog/style.css">
{% comment %}link(rel='canonical' href=config.url + url_for(page.path.replace('index.html', ''))) {% endcomment %}
{%- if is_home %}
<link rel="alternate" type="application/rss+xml"
title="{{ web_log.name }}" href="https://{{ web_log.urlBase }}/feed.xml">
{%- endif %}
</head>
<body>
<header class="site-header">
<div class="header-logo">
<a href="/">
<img src="/themes/tech-blog/img/bitbadger.png"
alt="A cartoon badger looking at a computer screen, with his paw on a mouse"
title="Bit Badger Solutions">
</a>
</div>
<div class="header-title"><a href="/">The Bit Badger Blog</a></div>
<div class="header-spacer">&nbsp;</div>
<div class="header-social">
<a href="/feed.xml" title="Subscribe to The Bit Badger Blog via RSS">
<img src="/themes/tech-blog/img/rss.png" alt="RSS">
</a> &nbsp; &nbsp;
<a href="https://twitter.com/Bit_Badger" title="Bit_Badger on Twitter">
<img src="/themes/tech-blog/img/twitter.png" alt="Twitter">
</a> &nbsp; &nbsp;
<a href="https://www.facebook.com/bitbadger.solutions" title="Bit Badger Solutions on Facebook">
<img src="/themes/tech-blog/img/facebook.png" alt="Facebook">
</a>
</div>
</header>
<div class="content-wrapper">
<div id="content" role="main">
{{ content }}
</div>
<aside class="blog-sidebar">
<div>
<div class="sidebar-head">Linux Resources</div>
<ul><li><a href="/linux/">Browse Resources</a></li></ul>
</div>
<div>
<div class="sidebar-head">Categories</div>
<ul class="cat-list">
{% for cat in categories -%}
{%- assign indent = cat.parent_names | size -%}
<li class="cat-list-item"{% if indent > 0 %} style="padding-left:{{ indent }}rem;"{% endif %}>
<a href="/category/{{ cat.slug }}/" class="cat-list-link">{{ cat.name }}</a>
<span class="cat-list-count">{{ cat.post_count }}</span>
</li>
{%- endfor %}
</ul>
</div>
</aside>
</div>
<footer>
<span>
A production of
<a href="https://bitbadger.solutions" title="Bit Badger Solutions" target="_blank" rel="noopener">
Bit Badger Solutions
</a>
</span>
<span>
Powered by <a href="https://github.com/bit-badger/myWebLog/tree/v2" target="_blank" rel="noopener">myWebLog</a>
&bull;
{% if logged_on %}
<a href="/admin">Dashboard</a>
{% else %}
<a href="/user/log-on">Log On</a>
{%- endif %}
</span>
</footer>
</body>
</html>

View File

@@ -0,0 +1,5 @@
<article class="auto">
<h1 class="entry-title">{{ page.title }}</h1>
<div class="entry-content">{{ page.text }}</div>
{%- if logged_on %}<p><small><a href="/page/{{ page.id }}/edit">Edit Page</a></small></p>{% endif %}
</article>

View File

@@ -0,0 +1,41 @@
{%- assign post = model.posts | first -%}
<article class="auto">
<h1 class="entry-title">
{{ post.title }}<br>
<span class="entry-meta">
Posted by {{ model.authors | value: post.author_id }} on {{ post.published_on | date: "dddd, MMMM d, yyyy" }}
at {{ post.published_on | date: "h:mm tt" | downcase }}
{%- assign cat_count = post.category_ids | size -%}
{%- if cat_count > 0 %}
<br>
<small class="category-list">
Categorized under
{%- for cat_id in post.category_ids %}
{%- assign cat = categories | where: "id", cat_id | first -%}
<span>
<a href="/category/{{ cat.slug }}/"
title="Categorized under {{ cat.name | strip_html | escape }}" rel="tag">{{ cat.name }}</a></span>
{%- endfor %}
</small>
{%- endif %}
</span>
</h1>
<div class="entry-content">{{ post.text }}</div>
<div class="entry-footer">
{%- assign tag_count = post.tags | size -%}
{%- if tag_count > 0 %}
<span class="category-list">
Tagged
{%- for tag in post.tags %}
<span>
<a href="/tag/{{ tag | replace: " ", "+" }}/"
title="Tagged &ldquo;{{ tag | escape }}&rdquo;" rel="tag">{{ tag }}</a></span>
{%- endfor %}
</span> &bull;
{%- endif %}
Bookmark the
<a href="/{{ post.permalink }}" rel="bookmark"
title="Permanent link to &ldquo;{{ post.title | strip_html | escape }}&rdquo;">permalink</a>
{%- if logged_on %} &bull; <a href="/post/{{ post.id }}/edit">Edit Post</a>{% endif %}
</div>
</article>