diff --git a/src/components/AdBanner.astro b/src/components/AdBanner.astro new file mode 100644 index 0000000..e38cf6d --- /dev/null +++ b/src/components/AdBanner.astro @@ -0,0 +1,86 @@ +--- +interface Props { + size: "leaderboard" | "rectangle" | "tile"; +} + +const { size } = Astro.props; + +const ads = [ + { + href: "https://kjuzv.com/g/q6gfnfvsq067a6d0fce8a804937a48/?erid=MvGzQC98w3Z1gMq1kx5ACoy5", + label: "Читай-город — книги со скидкой", + sublabel: "Более 3 млн книг с доставкой по всей России", + cta: "Купить", + ctaMobile: "Купить", + }, +]; + +const ad = ads[Math.floor(Math.random() * ads.length)]; + +const specs = { + leaderboard: { class: "w-full h-[90px]", horizontal: true }, + rectangle: { class: "w-full max-w-[300px] h-[250px]", horizontal: false }, + tile: { class: "w-full h-[250px]", horizontal: false }, +}; + +const { class: sizeClass, horizontal } = specs[size]; +--- + + diff --git a/src/layouts/GeneratorLayout.astro b/src/layouts/GeneratorLayout.astro index 4172f61..9010e43 100644 --- a/src/layouts/GeneratorLayout.astro +++ b/src/layouts/GeneratorLayout.astro @@ -1,5 +1,6 @@ --- import BaseLayout from "./BaseLayout.astro"; +import AdBanner from "../components/AdBanner.astro"; import SeoBlock from "../components/SeoBlock.astro"; import FaqBlock from "../components/FaqBlock.astro"; import RelatedGenerators from "../components/RelatedGenerators.astro"; @@ -136,6 +137,10 @@ const breadcrumbSchema = { +