From a35a51cc05f9a348d3da08314db16a82db42a522 Mon Sep 17 00:00:00 2001 From: Hatem Hosny Date: Sun, 5 Jan 2025 02:15:58 +0200 Subject: [PATCH] feat: add support for running jquery --- source/_posts/jquery.md | 5 +++-- themes/coo/layout/_partial/scripts.ejs | 13 +++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/source/_posts/jquery.md b/source/_posts/jquery.md index f334b0c..0b6b957 100644 --- a/source/_posts/jquery.md +++ b/source/_posts/jquery.md @@ -14,19 +14,20 @@ intro: | plugins: - tooltip - copyCode + - runCode --- ## Getting Started ### Including jQuery -```javascript {.wrap} +```html {.wrap} ``` #### Official CDN -```javascript {.wrap} +```html {.wrap} ``` diff --git a/themes/coo/layout/_partial/scripts.ejs b/themes/coo/layout/_partial/scripts.ejs index 2342322..9fa81dc 100644 --- a/themes/coo/layout/_partial/scripts.ejs +++ b/themes/coo/layout/_partial/scripts.ejs @@ -155,6 +155,19 @@ } } + if (document.querySelector('h1').textContent.includes('jQuery')) { + config = { + ...baseConfig, + markup: { + language: 'html', + content: `