Generate thumbnails for creations

This commit is contained in:
Tanner Collin 2025-06-22 17:55:05 -06:00
parent 25c848abfa
commit d3d8bbf84c
4 changed files with 20 additions and 14 deletions

View File

@ -55,12 +55,12 @@
"state": {
"type": "markdown",
"state": {
"file": "Garage Door Opener.md",
"file": "QotNews.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "Garage Door Opener"
"title": "QotNews"
}
},
{
@ -165,7 +165,7 @@
"state": {
"type": "backlink",
"state": {
"file": "Garage Door Opener.md",
"file": "QotNews.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
@ -175,7 +175,7 @@
"unlinkedCollapsed": true
},
"icon": "links-coming-in",
"title": "Backlinks for Garage Door Opener"
"title": "Backlinks for QotNews"
}
},
{
@ -184,13 +184,13 @@
"state": {
"type": "outline",
"state": {
"file": "Garage Door Opener.md",
"file": "QotNews.md",
"followCursor": false,
"showSearch": false,
"searchQuery": ""
},
"icon": "lucide-list",
"title": "Outline of Garage Door Opener"
"title": "Outline of QotNews"
}
}
],
@ -213,8 +213,12 @@
},
"active": "24a62ccdfd18a884",
"lastOpenFiles": [
"Protovac Retro Terminal.md",
"Notica.md",
"Spaceport.md",
"media/spaceport1.png",
"Garage Door Opener.md",
"media/protovac1.jpg",
"Protovac Retro Terminal.md",
"QotNews.md",
"Fake Dog.md",
"Bypassing Ports.md",
@ -242,12 +246,8 @@
"pages/creations.md",
"Makerspace Tours.md",
"Secret Garden.md",
"Hydroponics.md",
"Linux Flavour.md",
"media/nft2.jpg",
"media/nft1.png",
"media/ports1.svg",
"media/backup1.svg",
"media/japan12hi.jpg"
"media/ports1.svg"
]
}

View File

@ -67,7 +67,7 @@ def generator_finalized(generator):
if original_format:
save_kwargs['format'] = original_format
if original_format == 'JPEG':
save_kwargs['quality'] = 85 # Adjust quality for JPEGs
save_kwargs['quality'] = 95 # Adjust quality for JPEGs
save_kwargs['optimize'] = True
elif original_format == 'PNG':
save_kwargs['optimize'] = True

View File

@ -2,6 +2,11 @@
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
import sys
sys.path.append('.')
import generate_thumbnails
PATH = 'content'
TIMEZONE = 'Canada/Mountain'
@ -33,6 +38,7 @@ MARKDOWN = {
PLUGINS = [
'obsidian',
'linkclass',
'generate_thumbnails',
]
STATIC_PATHS = ['media', 'extra']

View File

@ -53,7 +53,7 @@
{% for article in articles_page.object_list if article.category.name == 'Creations' %}
<div class="creation">
<a href="{{ article.url }}">
<img src="media/{{ article.image }}" alt="{{ article.summary }}" />
<img src="media/thumbnails/{{ article.image }}" alt="{{ article.summary|striptags }}" />
{{ article.title }}
</a>
</div>