1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2026-05-22 10:05:29 +02:00

Update Layout.js

This commit is contained in:
Anton Titovets
2024-10-10 10:14:23 +03:00
parent 46ccd73097
commit 568e0d231a
+19 -23
View File
@@ -4,14 +4,13 @@ import Head from '@docusaurus/Head';
export default function CustomLayout(props) { export default function CustomLayout(props) {
useEffect(() => { useEffect(() => {
if (!location.pathname.startsWith('/docs/')) { if (!location.pathname.startsWith('/docs/')) {
return; // Если нет, не добавляем блок return; // Если не на странице документации, не добавляем блок
} }
// Создаем контейнер для второго рекламного блока // Создаем контейнер для второго рекламного блока
const adContainer = document.createElement('div'); const adContainer = document.createElement('div');
adContainer.id = 'R-A-12294791-5'; adContainer.id = 'yandex_rtb_R-A-12294791-5';
adContainer.style.marginTop = '20px'; // Добавим отступ для красоты adContainer.style.marginTop = '20px'; // Добавим отступ для красоты
// Находим элемент кнопок "Previous" и "Next" и вставляем перед ним // Находим элемент кнопок "Previous" и "Next" и вставляем перед ним
@@ -23,30 +22,27 @@ export default function CustomLayout(props) {
document.body.appendChild(adContainer); document.body.appendChild(adContainer);
} }
// Создаем скрипт для рендеринга рекламы
const script = document.createElement('script'); const script = document.createElement('script');
script.innerHTML = ` script.innerHTML = `
window.yaContextCb.push(() => { window.yaContextCb.push(() => {
Ya.Context.AdvManager.render({ Ya.Context.AdvManager.render({
"blockId": "R-A-12294791-3", "blockId": "R-A-12294791-3",
"type": "floorAd", "type": "floorAd",
"platform": "touch" "platform": "touch"
}); });
Ya.Context.AdvManager.render({ Ya.Context.AdvManager.render({
"blockId": "R-A-12294791-4", "blockId": "R-A-12294791-4",
"type": "floorAd", "type": "floorAd",
"platform": "desktop" "platform": "desktop"
}); });
Ya.Context.AdvManager.render({ Ya.Context.AdvManager.render({
"blockId": "R-A-12294791-5", "blockId": "R-A-12294791-5",
"renderTo": "yandex_rtb_R-A-12294791-5" "renderTo": "yandex_rtb_R-A-12294791-5"
}) });
});
});
})
`; `;
document.body.appendChild(script); document.body.appendChild(script);