update cms previews to new layouts. close #234
This commit is contained in:
@ -3,8 +3,6 @@ import {
|
||||
PageHeader,
|
||||
Section,
|
||||
Container,
|
||||
Col12,
|
||||
Row,
|
||||
} from "./components/index.js";
|
||||
|
||||
const BlogPreview = ({ widgetFor, entry, fields, collection }) => {
|
||||
@ -21,67 +19,52 @@ const BlogPreview = ({ widgetFor, entry, fields, collection }) => {
|
||||
return [
|
||||
PageHeader(entry),
|
||||
Section(
|
||||
Container(
|
||||
Row([
|
||||
Container([
|
||||
h("img", { className: "img-fluid w-100 mb-4", src: imageUrl }),
|
||||
h(
|
||||
"div",
|
||||
{ className: "d-flex flex-wrap gap-2 justify-content-between" },
|
||||
h(
|
||||
"div",
|
||||
{ key: "cover-image", className: "col-12 mb-4" },
|
||||
h("img", { className: "img-fluid w-100", src: imageUrl })
|
||||
),
|
||||
Col12(
|
||||
h(
|
||||
"div",
|
||||
{ className: "row mb-3" },
|
||||
h(
|
||||
"div",
|
||||
{ className: "col-6 mb-md-0 text-body-tertiary" },
|
||||
h("span", { className: "fw-bold me-1" }, "Geschrieben von:"),
|
||||
widgetFor("author")
|
||||
),
|
||||
h(
|
||||
"div",
|
||||
{ className: "col-6 mb-3 mb-md-0 text-body-tertiary" },
|
||||
h("span", { className: "fw-bold me-1" }, "Datum:"),
|
||||
entry.data.date
|
||||
? DateFormat({
|
||||
date: entry.data.date,
|
||||
format: {
|
||||
day: "numeric",
|
||||
month: "short",
|
||||
year: "numeric",
|
||||
},
|
||||
})
|
||||
: ""
|
||||
)
|
||||
)
|
||||
),
|
||||
Row(
|
||||
h(
|
||||
"div",
|
||||
{ className: "col-12 mb-md-0 text-body-tertiary" },
|
||||
h("span", { className: "fw-bold me-1" }, "Kategorie:"),
|
||||
entry.data.categories
|
||||
? entry.data.categories.map(
|
||||
(category, index) => (index != 0 ? ", " : "") + category
|
||||
)
|
||||
: ""
|
||||
)
|
||||
{ className: "text-body-secondary" },
|
||||
h("span", { className: "fw-bold me-1" }, "Geschrieben von:"),
|
||||
widgetFor("author")
|
||||
),
|
||||
h(
|
||||
"div",
|
||||
{ key: "border-bottom", className: "col-12 my-4" },
|
||||
h("div", { className: "border-bottom" })
|
||||
{ className: "text-body-secondary" },
|
||||
h("span", { className: "fw-bold me-1" }, "Datum:"),
|
||||
entry.data.date
|
||||
? DateFormat({
|
||||
date: entry.data.date,
|
||||
format: {
|
||||
day: "numeric",
|
||||
month: "short",
|
||||
year: "numeric",
|
||||
},
|
||||
})
|
||||
: ""
|
||||
),
|
||||
h(
|
||||
"div",
|
||||
{
|
||||
key: "body-content",
|
||||
className: "col-12 mb-5 content text-justify",
|
||||
},
|
||||
widgetFor("body")
|
||||
),
|
||||
])
|
||||
)
|
||||
{ className: "text-body-secondary" },
|
||||
h("span", { className: "fw-bold me-1" }, "Kategorien:"),
|
||||
entry.data.categories
|
||||
? entry.data.categories.map(
|
||||
(category, index) => (index != 0 ? ", " : "") + category
|
||||
)
|
||||
: ""
|
||||
)
|
||||
),
|
||||
h("div", { className: "border-bottom my-4" }),
|
||||
h(
|
||||
"div",
|
||||
{
|
||||
className: "content text-justify mb-4",
|
||||
},
|
||||
widgetFor("body")
|
||||
),
|
||||
])
|
||||
),
|
||||
];
|
||||
};
|
||||
|
Reference in New Issue
Block a user