From 4f964c7d2b27a9df401033b58b2a01aeb85b7cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B0=D1=80=D0=BF=D0=B8=D1=87=20=D0=94=D0=BC=D0=B8?= =?UTF-8?q?=D1=82=D1=80=D0=B8=D0=B9=20=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0?= =?UTF-8?q?=D0=BD=D0=B4=D1=80=D0=BE=D0=B2=D0=B8=D1=87?= Date: Wed, 28 May 2025 15:19:12 +0300 Subject: [PATCH] chore(*): try example --- src/layouts/SlideLayout.astro | 17 +++++++++++++++++ src/slides/signals/index.astro | 6 +++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/layouts/SlideLayout.astro b/src/layouts/SlideLayout.astro index 77e7aed..2472634 100644 --- a/src/layouts/SlideLayout.astro +++ b/src/layouts/SlideLayout.astro @@ -36,5 +36,22 @@ const { title, authors, description } = Astro.props; plugins: [Highlight, Zoom, Notes], }); deck.initialize(); + +document.addEventListener('DOMContentLoaded', async function() { + const codeBlocks = document.querySelectorAll('code[data-external]'); + + for (const block of codeBlocks) { + try { + const response = await fetch(block.dataset.external); + const code = await response.text(); + block.textContent = code; + + } catch (error) { + block.textContent = '⚠️ Error loading code: ' + error.message; + } + } +}); + + diff --git a/src/slides/signals/index.astro b/src/slides/signals/index.astro index 8f208ae..815f27d 100644 --- a/src/slides/signals/index.astro +++ b/src/slides/signals/index.astro @@ -240,8 +240,12 @@ export const description =
+

Демонстрация тестового кода с перехватом основных сигналов

-

Переходим к коду.

+
+
+
+