Skip to content

Commit

Permalink
teaser to database
Browse files Browse the repository at this point in the history
  • Loading branch information
naltatis committed Jun 4, 2024
1 parent d59f72b commit 04988b8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
12 changes: 12 additions & 0 deletions src/explore/database/database.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
{
"teaser": [
{
"title": "Classic Tractors",
"image": "/cdn/img/scene/[size]/classics.webp",
"url": "/products/classic"
},
{
"title": "Autonomous Tractors",
"image": "/cdn/img/scene/[size]/autonomous.webp",
"url": "/products/autonomous"
}
],
"categories": [
{
"key": "classic",
Expand Down
12 changes: 12 additions & 0 deletions src/explore/database/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ function toRecoItem(product, variant) {
* @type {Database}
*/
const database = {
teaser: [
{
title: "Classic Tractors",
image: "/cdn/img/scene/[size]/classics.webp",
url: "/products/classic",
},
{
title: "Autonomous Tractors",
image: "/cdn/img/scene/[size]/autonomous.webp",
url: "/products/autonomous",
},
],
categories: [
{
key: "classic",
Expand Down
16 changes: 2 additions & 14 deletions src/explore/pages/HomePage.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import data from "../database/index.js";
import Header from "../components/Header.js";
import Footer from "../components/Footer.js";
import Recommendations from "../components/Recommendations.js";
Expand All @@ -11,19 +12,6 @@ import Meta from "../components/Meta.js";
* @returns {string} The HomePage component markup.
*/
export default ({ c }) => {
const teaser = [
{
title: "Classic Tractors",
image: "/cdn/img/scene/[size]/classics.webp",
url: "/products/classic",
},
{
title: "Autonomous Tractors",
image: "/cdn/img/scene/[size]/autonomous.webp",
url: "/products/autonomous",
},
];

return html`<!doctype html>
<html>
<head>
Expand All @@ -36,7 +24,7 @@ export default ({ c }) => {
<body data-boundary="explore-page">
${Header({ c })}
<main class="e_HomePage">
${teaser
${data.teaser
.map(
({ title, image, url }) =>
html`<a class="e_HomePage__categoryLink" href="${url}">
Expand Down

0 comments on commit 04988b8

Please sign in to comment.