adding key image support

This commit is contained in:
evilchili
2022-08-04 21:34:47 -07:00
parent 468d9dedf0
commit 49971ae270
12 changed files with 111 additions and 46 deletions
@@ -131,7 +131,6 @@ h6 { font-size: 1.25em; }
float: left;
margin: 0px;
margin-top: -0.25em;
margin-bottom: -0.5em;
padding: 0px;
padding-right: 5px;
color: #692F28;
@@ -146,6 +145,24 @@ h6 { font-size: 1.25em; }
color: inherit;
}
img {
width:100%;
}
.key_image {
display: block;
margin: 0px auto;
max-width: calc(100% - 1em);
height: auto;
box-shadow: inset 0px 0px 40px 0px rgba(0,0,0,1);
border: 10px solid black;
}
.key_image img {
background-color:#FFF;
position: relative;
z-index: -1;
}
article.recent {
font-style: italic;
margin-bottom: 1em;
@@ -813,6 +830,10 @@ table.auto, table.auto tr, table.auto th, table.auto td {
text-align: left;
}
.container .box p:first-of-type::first-letter {
margin-bottom: -0.5em;
}
/* enable fancy star decorations */
ul.nav li:first-child:before,ul.nav li:after {
display: inherit;
@@ -841,7 +862,7 @@ table.auto, table.auto tr, table.auto th, table.auto td {
-moz-border-radius: 0 0 120px 120px / 0 0 6px 6px;
border-radius: 0 0 120px 120px / 0 0 6px 6px;
padding: 1em;
margin: 2em 10px 4em;
margin: 2em 0px;
background: #fff;
-webkit-box-shadow: 0 1px 4px rgb(0 0 0 / 60%), 0 0 40px rgb(0 0 0 / 30%) inset;
-moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 0, 0, 0.3) inset;
@@ -1,12 +1,11 @@
{% extends "base.html" %}
{% import "macros.html" as macros %}
{% block title %}{{ article.title|capitalize }} - {{SITENAME}}{% endblock title %}
{% block key_image %}{{ macros.key_image(article) }}{% endblock key_image %}
{% block content %}
<section id="content">
<div class='box curled'>
<h2 class="entry-title"><a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></h2>
{% import 'translations.html' as translations with context %}
{{ translations.translations_for(article) }}
<hr>
<div class='byline'>
<span class='date'>{{ article.locale_date }}</span>&nbsp;{% if article.tags %}{% for tag in article.tags %}<a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a> {% endfor %}{% endif %}
@@ -18,5 +17,5 @@
<hr>
{% include "bottom-nav.html" %}
</div>
</section>
{% endblock %}
</section>
{% endblock content %}
@@ -6,9 +6,9 @@
<meta charset="utf-8" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">
<link href="{{ SITEURL }}/theme/deadsands/css/style.css" rel="stylesheet" />
{% if FAVICON %}
<link rel="shortcut icon" href="{{ SITEURL }}/{{ FAVICON }}" type="image/x-icon" />
{% endif %}
{% if FAVICON %}
<link rel="shortcut icon" href="{{ SITEURL }}/{{ FAVICON }}" type="image/x-icon" />
{% endif %}
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
{% endblock head %}
</head>
@@ -18,7 +18,6 @@
<div class="header">
<div class='sun'></div>
<div class='title'><h1><a href="/">{{ SITENAME }}</a></h1></div>
<ul class="nav">
{% for category, articles in categories %}
<li><a href="{{ SITEURL }}/{{ category.name }}">{{ category }}</a></li>
@@ -31,7 +30,10 @@
</div>
</div>
<div id='background'>
<div class="container">{% block content %}{% endblock %}</div>
<div class="container">
{% block key_image %}{% endblock %}
{% block content %}{% endblock %}
</div>
<footer id="contentinfo" class="footer">
<nav class="pull-right bottom-nav">
<a href="{{ FEED_DOMAIN }}/{{ FEED_ALL_ATOM }}">RSS</a>
@@ -0,0 +1,7 @@
{% macro key_image(ref) %}
{% if ref.key_image %}
<a class='key_image' href="{{ ref.key_image.src }}">
<img src="{{ ref.key_image.src|replace('.','_thumb.') }}" alt="{{ ref.key_image.alt}}">
</a>
{% endif %}
{% endmacro %}
+24 -21
View File
@@ -1,26 +1,29 @@
{% extends "base.html" %}
{% block title %}{{ page.title }} - {{SITENAME}}{%endblock%}
{% import "macros.html" as macros %}
{% block title %}{{ page.title }} - {{SITENAME}}{% endblock title %}
{% block key_image %}{{ macros.key_image(page) }}{% endblock key_image %}
{% block content %}
<div class='box curled'>
<h2>{{ page.title }}</h2>
<hr>
{% import 'translations.html' as translations with context %}
{{ translations.translations_for(page) }}
{{ page.content }}
<hr>
{% if page.metadata['show_recent'] %}
<div class='column'>
<div class='signs'>
<h3>Recent Sessions</h3>
{% with count=10, key='category', values=['sessions', 'test'] %}{% include "signs.html" %}{% endwith %}
<section id="content">
<div class='box curled'>
<h2>{{ page.title }}</h2>
<hr>
{{ page.content }}
<hr>
</div>
</div>
<div class='column'>
<h3>Recent Lore</h3>
<div class='signs'>
{% with count=10, key='category', values=['lore', 'dm'] %}{% include "signs.html" %}{% endwith %}
{% if page.show_recent %}
<div class='column'>
<div class='signs'>
<h3>Recent Sessions</h3>
{% with count=10, key='category', values=['sessions', 'test'] %}{% include "signs.html" %}{% endwith %}
</div>
</div>
<div class='column'>
<h3>Recent Lore</h3>
<div class='signs'>
{% with count=10, key='category', values=['lore', 'dm'] %}{% include "signs.html" %}{% endwith %}
</div>
</div>
</div>
{% endif %}
</div>
{% endblock %}
</section>
{% endblock content %}
@@ -0,0 +1,14 @@
<div class='box curled'>
<h2 class="entry-title"><a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></h2>
<hr>
<div class='byline'>
<span class='date'>{{ article.locale_date }}</span>&nbsp;{% if article.tags %}{% for tag in article.tags %}<a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a> {% endfor %}{% endif %}
</div>
{% if article.description %}
<div class='scrap'><div class='note'>{{ article.description }}</div></div>
{% endif %}
{{ article.content }}
<hr>
{% include "bottom-nav.html" %}
</div>