diff --git a/config/_default/menus.en.toml b/config/_default/menus.en.toml index 7811c2e..416becc 100644 --- a/config/_default/menus.en.toml +++ b/config/_default/menus.en.toml @@ -8,20 +8,17 @@ weight = 1 [[main]] name = "About me" pageRef = "about" -identifier = "3mwQIHQJHy" weight = 2 [[main]] name = "Blog" pre = "pencil" -pageRef = "blog" -identifier = "Wlbt6D8Nvp" +pageRef = "posts" weight = 9_999 [[main]] name = "Bio" pageRef = "bio" -identifier = "7c1RZHAEl4" weight = 3 @@ -31,19 +28,16 @@ none = "none" [[footer]] name = "Impressum" pageRef = "impressum" -identifier = "3C57lKh0ZG" weight = 1 [[footer]] name = "Contact" pageRef = "contact" -identifier = "ssriowfp" weight = 3 [[footer]] name = "Privacy Policy" pageRef = "privacy" -identifier = "siowfp" weight = 2 diff --git a/config/_default/params.toml b/config/_default/params.toml index 20d6cee..f272e92 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -13,7 +13,7 @@ disableImageOptimization = false disableImageOptimizationMD = false disableTextInHeader = false -mainSections = ["blog"] +mainSections = ["posts"] giteaDefaultServer = "https://gitea.benno-lorenz.com" firebase = { } @@ -44,14 +44,14 @@ showScrollToTop = true layout = "background" homepageImage = "background.svg" -showRecent = true +showRecent = false showRecentItems = 5 cardView = true cardViewScreenWidth = true layoutBackgroundBlur = false showMoreLink = true -showMoreLinkDest = "/blog" +showMoreLinkDest = "/posts" disableHeroImagefilter = true [article] diff --git a/content/_index.md b/content/_index.md index be3f737..6d7025d 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,6 +1,6 @@ --- -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. diff --git a/content/blog/_index.md b/content/posts/_index.md similarity index 100% rename from content/blog/_index.md rename to content/posts/_index.md diff --git a/content/blog/posts/post1/index.md b/content/posts/posts/post1/index.md similarity index 97% rename from content/blog/posts/post1/index.md rename to content/posts/posts/post1/index.md index d2e42e1..ad9181a 100644 --- a/content/blog/posts/post1/index.md +++ b/content/posts/posts/post1/index.md @@ -11,6 +11,7 @@ tags: - space image: pexels-optical-chemist-340351297-31986005.jpg type: blogpost +categories: ["blog", "posts"] --- ## A sub-title diff --git a/content/blog/posts/post1/pexels-optical-chemist-340351297-31986005.jpg b/content/posts/posts/post1/pexels-optical-chemist-340351297-31986005.jpg similarity index 100% rename from content/blog/posts/post1/pexels-optical-chemist-340351297-31986005.jpg rename to content/posts/posts/post1/pexels-optical-chemist-340351297-31986005.jpg diff --git a/content/blog/posts/post2/featuredcat.jpg b/content/posts/posts/post2/featuredcat.jpg similarity index 100% rename from content/blog/posts/post2/featuredcat.jpg rename to content/posts/posts/post2/featuredcat.jpg diff --git a/content/blog/posts/post2/index.md b/content/posts/posts/post2/index.md similarity index 96% rename from content/blog/posts/post2/index.md rename to content/posts/posts/post2/index.md index 496d211..010ff96 100644 --- a/content/blog/posts/post2/index.md +++ b/content/posts/posts/post2/index.md @@ -8,8 +8,7 @@ date: 2025-06-01T23:15:00.000Z draft: false type: blogpost image: featuredcat.jpg -categories: - - Test +categories: ["blog", "posts"] --- # Lorem Ipsum Dolor diff --git a/static/admin/config.yml b/static/admin/config.yml index fd28db5..e49ccf9 100644 --- a/static/admin/config.yml +++ b/static/admin/config.yml @@ -28,11 +28,13 @@ collections: label: "Authors", name: "authors", widget: "select", - multiple: true, - options: ["bob", "jane", "peter", "kate"], + multiple: False, + options: ["Benno Lorenz"], } - { label: "Date", name: "date", widget: "datetime" } - { 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" } diff --git a/static/admin/index.html b/static/admin/index.html index 240a950..632083e 100644 --- a/static/admin/index.html +++ b/static/admin/index.html @@ -11,5 +11,6 @@ + \ No newline at end of file diff --git a/static/admin/prefixed-image-widget.js b/static/admin/prefixed-image-widget.js new file mode 100644 index 0000000..9e630e9 --- /dev/null +++ b/static/admin/prefixed-image-widget.js @@ -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 ( +
+ + {value && } +
+ ); + } +} + +const PrefixedImageWidget = { + name: "prefixed-image", + controlComponent: PrefixedImageControl, + previewComponent: ({ value }) => + value ? : null, +}; + +window.CMS.registerWidget(PrefixedImageWidget.name, PrefixedImageWidget.controlComponent, PrefixedImageWidget.previewComponent); \ No newline at end of file