added plugin image-process
This commit is contained in:
parent
371e42ea0c
commit
c309b39345
@ -1,20 +1,45 @@
|
|||||||
## Site generation
|
# Site generation
|
||||||
|
|
||||||
### Website
|
## Static Site Generator
|
||||||
|
|
||||||
* python3
|
|
||||||
* pelican with Markdown support (`pip install pelican[markdown]`)
|
* pelican with Markdown support (`pip install pelican[markdown]`)
|
||||||
|
* python3
|
||||||
|
|
||||||
|
## Pelican Plugins
|
||||||
|
|
||||||
|
Pip packages
|
||||||
|
|
||||||
* pelican-yaml-metadata
|
* pelican-yaml-metadata
|
||||||
* Markdown
|
* pelican-image-process
|
||||||
|
|
||||||
### Event list
|
?* [Optimize Images](https://github.com/minchinweb/minchin.pelican.plugins.optimize_images)
|
||||||
|
|
||||||
Python:
|
## Site Display
|
||||||
|
|
||||||
|
* Pico CSS (Yohn's fork)
|
||||||
|
* Linux Biolinum (font)
|
||||||
|
|
||||||
|
# On Production Server
|
||||||
|
|
||||||
|
* php (aktuell 8.1)
|
||||||
|
* database driver, e.g. pdo_sqlite
|
||||||
|
* PHPMailer (included in source)
|
||||||
|
|
||||||
|
|
||||||
|
# Content generation
|
||||||
|
|
||||||
|
## List of books and texts
|
||||||
|
|
||||||
|
* ?
|
||||||
|
|
||||||
|
## Event list
|
||||||
|
|
||||||
|
Python packages
|
||||||
|
|
||||||
* caldav
|
* caldav
|
||||||
* vobject
|
* vobject
|
||||||
|
|
||||||
### Favicon
|
## Favicon
|
||||||
|
|
||||||
Linux packages:
|
Linux packages:
|
||||||
|
|
||||||
@ -22,12 +47,3 @@ Linux packages:
|
|||||||
* pngquant
|
* pngquant
|
||||||
* image-magick
|
* image-magick
|
||||||
|
|
||||||
## On Production Server
|
|
||||||
|
|
||||||
* php
|
|
||||||
* database driver, e.g. pdo_sqlite
|
|
||||||
* PHPMailer (included in source)
|
|
||||||
|
|
||||||
## Site Display
|
|
||||||
|
|
||||||
* Pico CSS (Yohn's fork)
|
|
||||||
@ -15,27 +15,30 @@ slug: rpg-spielhilfen
|
|||||||
save_as: sonstiges/rpg-spielhilfen.html
|
save_as: sonstiges/rpg-spielhilfen.html
|
||||||
url: sonstiges/rpg-spielhilfen.html
|
url: sonstiges/rpg-spielhilfen.html
|
||||||
featured_image:
|
featured_image:
|
||||||
- pic: ../images/sonstiges/cover-cthulhu-mittelalter.jpg
|
- pic: ../images/sonstiges/motif-dice.jpg
|
||||||
|
credit: Varun Gaba | unsplash.com
|
||||||
|
credit_link: https://unsplash.com/photos/blue-and-white-dice-on-white-surface-f5eKYTkxhHQ
|
||||||
order: 70
|
order: 70
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## DSA
|
## DSA
|
||||||
|
|
||||||

|
{: .image-process-featured}
|
||||||
|
|
||||||

|
{: .image-process-featured}
|
||||||
|
|
||||||

|
{: .image-process-featured}
|
||||||
|
|
||||||

|
{: .image-process-featured}
|
||||||
|
|
||||||

|
{: .image-process-featured}
|
||||||
|
|
||||||
## Myranor
|
## Myranor
|
||||||
|
|
||||||

|
{: .image-process-featured}
|
||||||
|
|
||||||
## Call of Cthulhu
|
## Call of Cthulhu
|
||||||
|
|
||||||

|
{: .image-process-featured}
|
||||||
@ -21,7 +21,7 @@ PATH = "content"
|
|||||||
ARTICLE_PATHS = ["posts"]
|
ARTICLE_PATHS = ["posts"]
|
||||||
PAGE_PATHS = ["pages"]
|
PAGE_PATHS = ["pages"]
|
||||||
STATIC_PATHS = ["images", "favicon", "php"]
|
STATIC_PATHS = ["images", "favicon", "php"]
|
||||||
# TEMPLATE_PAGES = { 'templates/cform.html': 'cform.html', }
|
#STATIC_EXCLUDES = ["unoptimized-images"]
|
||||||
|
|
||||||
DIRECT_TEMPLATES = ['index', 'tags']
|
DIRECT_TEMPLATES = ['index', 'tags']
|
||||||
IGNORE_FILES = ['**/.*', '__pycache__', 'favicon-from-svg.sh', '*.metadata']
|
IGNORE_FILES = ['**/.*', '__pycache__', 'favicon-from-svg.sh', '*.metadata']
|
||||||
@ -111,12 +111,24 @@ SOCIAL = (
|
|||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Technical Settings #
|
# Plugins and Extensions #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
PLUGINS = ["pelican.plugins.yaml_metadata"]
|
# jinja2 extensions
|
||||||
JINJA_ENVIRONMENT = { "extensions": ["jinja2.ext.debug", "jinja2.ext.do"] }
|
JINJA_ENVIRONMENT = { "extensions": ["jinja2.ext.debug", "jinja2.ext.do"] }
|
||||||
|
|
||||||
|
# pelican plugins
|
||||||
|
PLUGINS = ["pelican.plugins.yaml_metadata", "pelican.plugins.image_process", "minchin.pelican.plugins.optimize_images"]
|
||||||
|
|
||||||
|
# plugin settings for optimize-images
|
||||||
|
OPTIMIZE_IMAGES_DEV_MODE = True # disable optimization in dev mode
|
||||||
|
|
||||||
|
# plugin settings for image-process
|
||||||
|
IMAGE_PROCESS = {
|
||||||
|
"featured": ["scale_in 550 100% True"],
|
||||||
|
"card": ["scale_in 350 100% True"]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -14,47 +14,39 @@
|
|||||||
{% endblock content_header %}
|
{% endblock content_header %}
|
||||||
|
|
||||||
{% block content_body %}
|
{% block content_body %}
|
||||||
<div id="article-body">
|
<article id="article-body">
|
||||||
{% if article.featured_image is defined %}
|
<div class="body-column-text">
|
||||||
{% from 'includes/featured_image.html' import fi %}
|
{% if article.content | length is not eq(0) %}{{ article.content }}{% endif %}
|
||||||
{% set i = article.featured_image[0] %}
|
{% if article.klappentext %}
|
||||||
{{ fi(i.pic, i.link, i.text, i.credit) }}
|
<h2>Klappentext</h2>
|
||||||
|
<blockquote>{{ article.klappentext }}</blockquote>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</div>
|
||||||
{% if article.klappentext is defined %}
|
<div class="body-column-img">
|
||||||
<div class="klappentext">
|
{% if article.featured_image is defined %}
|
||||||
<blockquote>
|
{% from 'includes/macros.html' import fi %}
|
||||||
<h2>Klappentext</h2>
|
{% set i = article.featured_image[0] %}
|
||||||
<p>{{ article.klappentext }}</p>
|
{{ fi(i.pic, i.link, i.text, i.title, i.credit, i.credit_link) }}
|
||||||
</blockquote>
|
{% endif %}
|
||||||
</div>
|
<div>
|
||||||
{% endif %} {% if article.content | length is not eq(0) %}
|
<h2>Details</h2>
|
||||||
<div>{{ article.content }}</div>
|
<ul class="article-stats">
|
||||||
{% endif %}
|
|
||||||
<div>
|
|
||||||
<hr />
|
|
||||||
<h2>Details</h2>
|
|
||||||
<ul class="article-stats">
|
|
||||||
{% if article.reihe is defined %}
|
{% if article.reihe is defined %}
|
||||||
<li>aus der Reihe {{ article.reihe }}</li>
|
<li>aus der Reihe {{ article.reihe }}</li>
|
||||||
{% endif %} {% if article.tags is defined %}
|
{% endif %}
|
||||||
<li>
|
{% if article.tags is defined %}
|
||||||
Schlagworte: {% for tag in article.tags %}<a href="/tag/{{ tag }}"
|
<li>Schlagworte: {% for tag in article.tags %}{% if not loop.first %}, {% endif%}<a href="/tag/{{ tag }}">{{ tag }}</a>{% endfor %}</li>
|
||||||
>{{ tag }}</a
|
{% endif %}
|
||||||
>, {% endfor %}
|
{% if article.isbn is defined %}
|
||||||
</li>
|
<li>ISBN: {{ article.isbn }}</li>
|
||||||
{% endif %} {% if article.isbn is defined %}
|
{% endif %}
|
||||||
<li>ISBN: {{ article.isbn }}</li>
|
{% if article.verlag is defined %}
|
||||||
{% endif %} {% if article.verlag is defined %}
|
<li>erschienen bei: {{ article.verlag }}</li>
|
||||||
<li>erschienen bei: {{ article.verlag }}</li>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</article>
|
||||||
<hr />
|
|
||||||
<footer class="article-footer">
|
<footer class="article-footer">
|
||||||
<a href="/{{ article.save_as.split('/')[:-1] | join('/') }}/"
|
<a href="/{{ article.save_as.split('/')[:-1] | join('/') }}/">← {{ article.category }}</a>
|
||||||
>← {{ article.category }}</a
|
|
||||||
>
|
|
||||||
</footer>
|
</footer>
|
||||||
{% endblock content_body %}
|
{% endblock content_body %}
|
||||||
|
|||||||
@ -11,10 +11,10 @@
|
|||||||
<h3><a href="{{ SITEURL }}/{{ article.save_as }}" title="{{ article.title }}">{{ article.title }}</a></h3>
|
<h3><a href="{{ SITEURL }}/{{ article.save_as }}" title="{{ article.title }}">{{ article.title }}</a></h3>
|
||||||
</header>
|
</header>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{% from 'includes/featured_image.html' import fi %}
|
{% from 'includes/macros.html' import ci %}
|
||||||
{% if article.featured_image %}
|
{% if article.featured_image %}
|
||||||
{% set i = article.featured_image[0] %}
|
{% set i = article.featured_image[0] %}
|
||||||
{{ fi(i.pic, i.link | default("/" + article.save_as), i.alt | default("Titelbild von " + article.title), i.title | default(article.title), i.credit) }}
|
{{ ci(i.pic, i.link | default("/" + article.save_as), i.alt | default("Titelbild von " + article.title), i.title | default(article.title), i.credit, i.credit_link) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
|
|||||||
@ -1,8 +0,0 @@
|
|||||||
{% macro fi(pic, link='', alt='', title='', credit='') %}
|
|
||||||
<div class="featured-image">
|
|
||||||
<figure>
|
|
||||||
{% if link %}<a href="{{ link }}"{% if alt %} alt="{{ alt }}"{% endif %}>{% endif %}<img src="{{ pic }}" title="{{ title }}"/>{% if link %}</a>{% endif %}
|
|
||||||
{% if credit %}<figcaption>Bild: {{ credit }}</figcaption>{% endif %}
|
|
||||||
</figure>
|
|
||||||
</div>
|
|
||||||
{% endmacro %}
|
|
||||||
19
theme/templates/includes/macros.html
Normal file
19
theme/templates/includes/macros.html
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{# featured image macro #}
|
||||||
|
{% macro fi(pic, link='', alt='', title='', credit='', credit_link='') %}
|
||||||
|
<div class="featured-image">
|
||||||
|
<figure>
|
||||||
|
{% if link %}<a href="{{ link }}"{% if title %} title="{{ title }}"{% endif %}>{% endif %}<img class="image-process-featured" src="{{ pic }}"{% if alt %} alt="{{ alt }}"{% endif %}/>{% if link %}</a>{% endif %}
|
||||||
|
{% if credit %}<figcaption>{% if credit_link %}<a href="{{ credit_link }}" alt="Bildquelle: {{ credit }}" target="_blank">{% endif %}{{ credit }}{% if credit_link %}</a>{% endif %}</figcaption>{% endif %}
|
||||||
|
</figure>
|
||||||
|
</div>
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
{# card image macro #}
|
||||||
|
{% macro ci(pic, link='', alt='', title='', credit='', credit_link='') %}
|
||||||
|
<div class="card-image">
|
||||||
|
<figure>
|
||||||
|
{% if link %}<a href="{{ link }}"{% if title %} title="{{ title }}"{% endif %}>{% endif %}<img class="image-process-card" src="{{ pic }}"{% if alt %} alt="{{ alt }}"{% endif %}/>{% if link %}</a>{% endif %}
|
||||||
|
{% if credit %}<figcaption>{% if credit_link %}<a href="{{ credit_link }}" alt="Bildquelle: {{ credit }}" target="_blank">{% endif %}{{ credit }}{% if credit_link %}</a>{% endif %}</figcaption>{% endif %}
|
||||||
|
</figure>
|
||||||
|
</div>
|
||||||
|
{% endmacro %}
|
||||||
@ -1,22 +1,17 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% block content_body %}
|
{% block content_body %}
|
||||||
{% for p in pages if p.title == "Index" %}
|
{% for p in pages if p.title == "Index" %}
|
||||||
{% set lr = cycler("row", "row-reverse") %}
|
{% set lr = cycler("row", "row-reverse") %}
|
||||||
{% if p.featured is defined %}
|
{% if p.featured is defined %}
|
||||||
<div class="index-featured"></div>
|
<div class="index-featured"></div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% from 'includes/featured_image.html' import fi %}
|
{% from 'includes/macros.html' import fi %}
|
||||||
{% for c in p.index_cards %}
|
{% for i in p.index_cards %}
|
||||||
<div class="index" style="flex-direction: {{ lr.next() }};">
|
<div class="index" style="flex-direction: {{ lr.next() }};">
|
||||||
{{ fi( c.pic, c.link, c.text, c.credit) }}
|
{{ fi( i.pic, i.link, i.alt, i.title, i.credit, i.credit_link) }}
|
||||||
<p>
|
<p><a class="index-link" href="{{ i.link }}">{{ i.alt }}</a></p>
|
||||||
{{ c.text }}<br />
|
</div>
|
||||||
<span class="index-link">
|
{% endfor %}
|
||||||
<a href="{{ c.link }}">{{ c.more }}</a>
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% include "includes/subscribe.html" %}
|
{% include "includes/subscribe.html" %}
|
||||||
{% include "includes/unsubscribe.html" %}
|
{% include "includes/unsubscribe.html" %}
|
||||||
|
|||||||
@ -12,9 +12,9 @@
|
|||||||
{% block content_body %}
|
{% block content_body %}
|
||||||
<div id="page-body">
|
<div id="page-body">
|
||||||
{% if page.featured_image is defined %}
|
{% if page.featured_image is defined %}
|
||||||
{% from 'includes/featured_image.html' import fi %}
|
{% from 'includes/macros.html' import fi %}
|
||||||
{% set i = page.featured_image[0] %}
|
{% set i = page.featured_image[0] %}
|
||||||
{{ fi(i.pic, i.link, i.text, i.credit) }}
|
{{ fi(i.pic, i.link, i.text, i.alt, i.credit, i.credit_link) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{{ page.content }}
|
{{ page.content }}
|
||||||
|
|||||||
@ -20,8 +20,8 @@ wide_card) | list | first is defined %}
|
|||||||
<ul>
|
<ul>
|
||||||
{% for image in wcard.card_images %}
|
{% for image in wcard.card_images %}
|
||||||
<li class="wcard-image" style="animation-delay: {{ loop.index0 * 5 }}s;">
|
<li class="wcard-image" style="animation-delay: {{ loop.index0 * 5 }}s;">
|
||||||
<a href="{{ SITEURL }}/{{ image.post }}">
|
<a href="{{ SITEURL }}/{{ image.link }}">
|
||||||
<img src="{{ SITEURL }}/{{ image.pic }}" alt="{{ image.alt }}" {%- if image.y_offset is defined %} style="bottom: {{ image.y_offset }};" {% endif %} />
|
<img class="image-process-featured" src="{{ SITEURL }}/{{ image.pic }}" alt="{{ image.alt }}" {%- if image.y_offset is defined %} style="bottom: {{ image.y_offset }};" {% endif %} />
|
||||||
</a>
|
</a>
|
||||||
<div class="wcard-tooltip">
|
<div class="wcard-tooltip">
|
||||||
<p>{{ image.alt }}</p>
|
<p>{{ image.alt }}</p>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user