misc
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 39s

This commit is contained in:
2025-06-09 22:44:04 +02:00
parent 4567dc0038
commit c76dad43d8
11 changed files with 52 additions and 17 deletions

View File

@@ -8,20 +8,17 @@ weight = 1
[[main]] [[main]]
name = "About me" name = "About me"
pageRef = "about" pageRef = "about"
identifier = "3mwQIHQJHy"
weight = 2 weight = 2
[[main]] [[main]]
name = "Blog" name = "Blog"
pre = "pencil" pre = "pencil"
pageRef = "blog" pageRef = "posts"
identifier = "Wlbt6D8Nvp"
weight = 9_999 weight = 9_999
[[main]] [[main]]
name = "Bio" name = "Bio"
pageRef = "bio" pageRef = "bio"
identifier = "7c1RZHAEl4"
weight = 3 weight = 3
@@ -31,19 +28,16 @@ none = "none"
[[footer]] [[footer]]
name = "Impressum" name = "Impressum"
pageRef = "impressum" pageRef = "impressum"
identifier = "3C57lKh0ZG"
weight = 1 weight = 1
[[footer]] [[footer]]
name = "Contact" name = "Contact"
pageRef = "contact" pageRef = "contact"
identifier = "ssriowfp"
weight = 3 weight = 3
[[footer]] [[footer]]
name = "Privacy Policy" name = "Privacy Policy"
pageRef = "privacy" pageRef = "privacy"
identifier = "siowfp"
weight = 2 weight = 2

View File

@@ -13,7 +13,7 @@ disableImageOptimization = false
disableImageOptimizationMD = false disableImageOptimizationMD = false
disableTextInHeader = false disableTextInHeader = false
mainSections = ["blog"] mainSections = ["posts"]
giteaDefaultServer = "https://gitea.benno-lorenz.com" giteaDefaultServer = "https://gitea.benno-lorenz.com"
firebase = { } firebase = { }
@@ -44,14 +44,14 @@ showScrollToTop = true
layout = "background" layout = "background"
homepageImage = "background.svg" homepageImage = "background.svg"
showRecent = true showRecent = false
showRecentItems = 5 showRecentItems = 5
cardView = true cardView = true
cardViewScreenWidth = true cardViewScreenWidth = true
layoutBackgroundBlur = false layoutBackgroundBlur = false
showMoreLink = true showMoreLink = true
showMoreLinkDest = "/blog" showMoreLinkDest = "/posts"
disableHeroImagefilter = true disableHeroImagefilter = true
[article] [article]

View File

@@ -1,5 +1,5 @@
--- ---
description: description: "This is the main Homepage"
--- ---
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

View File

@@ -11,6 +11,7 @@ tags:
- space - space
image: pexels-optical-chemist-340351297-31986005.jpg image: pexels-optical-chemist-340351297-31986005.jpg
type: blogpost type: blogpost
categories: ["blog", "posts"]
--- ---
## A sub-title ## A sub-title

View File

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

@@ -8,8 +8,7 @@ date: 2025-06-01T23:15:00.000Z
draft: false draft: false
type: blogpost type: blogpost
image: featuredcat.jpg image: featuredcat.jpg
categories: categories: ["blog", "posts"]
- Test
--- ---
# Lorem Ipsum Dolor # Lorem Ipsum Dolor

View File

@@ -28,11 +28,13 @@ collections:
label: "Authors", label: "Authors",
name: "authors", name: "authors",
widget: "select", widget: "select",
multiple: true, multiple: False,
options: ["bob", "jane", "peter", "kate"], options: ["Benno Lorenz"],
} }
- { label: "Date", name: "date", widget: "datetime" } - { label: "Date", name: "date", widget: "datetime" }
- { label: "Draft", name: "draft", widget: "boolean", default: true } - { label: "Draft", name: "draft", widget: "boolean", default: true }
- { label: "Cover Image", name: "image", widget: "image" } - { label: "Cover Image", name: "image", widget: "prefixed-image" }
- { label: "Cover Style", name: "cover_style", widget: "select", options: ["basic", "big", "background", "thumbAndBackground"], default: "default" }
- { label: "images", name: "images", widget: "image", multiple: true }
- { label: "Body", name: "body", widget: "markdown" } - { label: "Body", name: "body", widget: "markdown" }

View File

@@ -11,5 +11,6 @@
<body> <body>
<!-- Include the script that builds the page and powers Decap CMS --> <!-- Include the script that builds the page and powers Decap CMS -->
<script src="https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js"></script> <script src="https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js"></script>
<script src="prefixed-image-widget.js"></script>
</body> </body>
</html> </html>

View File

@@ -0,0 +1,38 @@
import React from "react";
class PrefixedImageControl extends React.Component {
handleChange = async (event) => {
const file = event.target.files[0];
if (!file) return;
// Add your prefix here
const prefix = "feature-";
const newFile = new File([file], prefix + file.name, { type: file.type });
// Use Decap's media library to persist the file
const { onChange, mediaPaths, field } = this.props;
const uploaded = await this.props.mediaLibrary.persistMedia(newFile);
// Save the public path
onChange(uploaded.public_path || uploaded.url);
};
render() {
const value = this.props.value || "";
return (
<div>
<input type="file" accept="image/*" onChange={this.handleChange} />
{value && <img src={value} alt="" style={{ maxWidth: "200px" }} />}
</div>
);
}
}
const PrefixedImageWidget = {
name: "prefixed-image",
controlComponent: PrefixedImageControl,
previewComponent: ({ value }) =>
value ? <img src={value} alt="" style={{ maxWidth: "200px" }} /> : null,
};
window.CMS.registerWidget(PrefixedImageWidget.name, PrefixedImageWidget.controlComponent, PrefixedImageWidget.previewComponent);