From 2ae3833284d7653f172429f992aee7049142dd08 Mon Sep 17 00:00:00 2001 From: James Goldie Date: Fri, 1 Nov 2024 11:06:24 +1100 Subject: [PATCH 1/7] Revert "Only apply layout to direct .cr-section parents" This reverts commit c9c6a9b673d6e3144c5ca6b4244e45b6144fb197. --- _extensions/closeread/closeread.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/_extensions/closeread/closeread.js b/_extensions/closeread/closeread.js index 5bfa88e..3e58d1a 100644 --- a/_extensions/closeread/closeread.js +++ b/_extensions/closeread/closeread.js @@ -32,10 +32,18 @@ document.addEventListener("DOMContentLoaded", () => { /* this replicates quarto <= 1.6 functionality: https://github.com/quarto-dev/quarto-cli/blob/ d85467627aae71c96e3d1e9718a3b47289329cde/src/format/html/ - format-html-bootstrap.ts#L1163C1-L1186C7 */ + format-html-bootstrap.ts#L1163C1-L1186C7 */ + const ensureInGrid = el => { + const parent = el.parentElement + parent.classList.add("page-columns", "page-full") + if (isDocumentMain(parent)) { + return + } else { + ensureInGrid(parent) + } + } const crSections = Array.from(document.querySelectorAll(".cr-section")) - crSections.map( - el => el.parentElement.classList.add("page-columns", "page-full")) + crSections.map(ensureInGrid) const ojsModule = window._ojs?.ojsConnector?.mainModule const ojsStickyName = ojsModule?.variable() From d206492e2a3473ab88d526fc2b2b9bc6b3b1a182 Mon Sep 17 00:00:00 2001 From: James Goldie Date: Fri, 1 Nov 2024 11:16:34 +1100 Subject: [PATCH 2/7] Revert "Remove extraneous JS function" This reverts commit 9eb3b7c3021ed1a3636ad5e2b9b10dc00ca67bee. --- _extensions/closeread/closeread.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/_extensions/closeread/closeread.js b/_extensions/closeread/closeread.js index 3e58d1a..f0efde6 100644 --- a/_extensions/closeread/closeread.js +++ b/_extensions/closeread/closeread.js @@ -417,3 +417,8 @@ function getBooleanConfig(metaFlag) { .querySelector("meta[" + metaFlag + "]")?.getAttribute(metaFlag) return option === "true" } + +function isDocumentMain(el) { + return el === null || + (el.tagName == "MAIN" && el.classList.contains("content")) +} From e67409fbb51fe6099cddccc638769a7e99a05c16 Mon Sep 17 00:00:00 2001 From: James Goldie Date: Fri, 1 Nov 2024 11:16:46 +1100 Subject: [PATCH 3/7] Revert "Adjust comment on JS code" This reverts commit 58564c564311dbd20db4a67111010445b08e4b1c. --- _extensions/closeread/closeread.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_extensions/closeread/closeread.js b/_extensions/closeread/closeread.js index f0efde6..97a6ee5 100644 --- a/_extensions/closeread/closeread.js +++ b/_extensions/closeread/closeread.js @@ -28,7 +28,7 @@ document.addEventListener("DOMContentLoaded", () => { document.body.classList.add("cr-removeheaderspace") } - // attach layout classes to direct parents of `.cr-section`s + // attach layout classes to parents of `.cr-section`s up to main.content /* this replicates quarto <= 1.6 functionality: https://github.com/quarto-dev/quarto-cli/blob/ d85467627aae71c96e3d1e9718a3b47289329cde/src/format/html/ From cd4e890e64912c2da3d5a9923a39ad92bdcd1ad9 Mon Sep 17 00:00:00 2001 From: James Goldie Date: Fri, 1 Nov 2024 11:18:45 +1100 Subject: [PATCH 4/7] Bump version to 1.0.1 Fixes #121 --- _extensions/closeread/_extension.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_extensions/closeread/_extension.yml b/_extensions/closeread/_extension.yml index b04bc56..802a9b2 100644 --- a/_extensions/closeread/_extension.yml +++ b/_extensions/closeread/_extension.yml @@ -1,6 +1,6 @@ title: closeread author: Andrew Bray and James Goldie -version: 1.0.0 +version: 1.0.1 quarto-required: ">=1.3.0" contributes: formats: From 8649ae04db07a1457d739e4a27e373b0e713b8a9 Mon Sep 17 00:00:00 2001 From: James Goldie Date: Fri, 1 Nov 2024 11:26:56 +1100 Subject: [PATCH 5/7] Fix issue with sidebar-right (fix suggested by @lattaai1) --- _extensions/closeread/closeread.css | 2 +- _extensions/closeread/closeread.scss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_extensions/closeread/closeread.css b/_extensions/closeread/closeread.css index fd7a76f..5092d2d 100644 --- a/_extensions/closeread/closeread.css +++ b/_extensions/closeread/closeread.css @@ -181,7 +181,7 @@ } .sidebar-right { - grid-template-columns: 2fr var(cr-narrative-sidebar-width); + grid-template-columns: 2fr var(--cr-narrative-sidebar-width); } .sidebar-right .narrative-col { grid-column: 2; diff --git a/_extensions/closeread/closeread.scss b/_extensions/closeread/closeread.scss index d64f8c5..7f3f138 100644 --- a/_extensions/closeread/closeread.scss +++ b/_extensions/closeread/closeread.scss @@ -241,7 +241,7 @@ } } .sidebar-right { - grid-template-columns: 2fr var(cr-narrative-sidebar-width); + grid-template-columns: 2fr var(--cr-narrative-sidebar-width); .narrative-col { grid-column: 2; From 5a4567da063fe3842d50bdb77e8d7b4eed49b551 Mon Sep 17 00:00:00 2001 From: James Goldie Date: Sun, 3 Nov 2024 14:12:04 +1100 Subject: [PATCH 6/7] Add Closeread Prize announcement bar --- docs/_quarto.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/_quarto.yml b/docs/_quarto.yml index 04546f1..1ab11d9 100644 --- a/docs/_quarto.yml +++ b/docs/_quarto.yml @@ -5,6 +5,12 @@ project: website: title: "Closeread" + announcement: + icon: award + dismissable: false + content: "**[The Closeread Prize](https://posit.co/blog/closeread-prize-announcement/){style=\"color: var(--bs-warning-text-emphasis)\"}:** prizes for the best scrollytelling! Entries close Dec 15. [**Learn more and enter!**](https://posit.co/blog/closeread-prize-announcement/){style=\"color: var(--bs-warning-text-emphasis)\"}" + type: warning + position: below-navbar page-navigation: true navbar: left: From 88d6c88450ce97180a8f20841a5518659c7c023a Mon Sep 17 00:00:00 2001 From: James Goldie Date: Sat, 9 Nov 2024 15:37:38 +1100 Subject: [PATCH 7/7] Remove and ignore CSS map Fixes #136 --- .gitignore | 3 +++ _extensions/closeread/closeread.css.map | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) delete mode 100644 _extensions/closeread/closeread.css.map diff --git a/.gitignore b/.gitignore index ee93b92..20490bc 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,6 @@ package-lock.json # temporarily ignoring the _extensions folder within demos/ and tests/ until we organise them into a website demos/*/_extensions tests/*/_extensions + +# .css.map (can be generated manually from .scss file) +_extensions/closeread/closeread.css.map diff --git a/_extensions/closeread/closeread.css.map b/_extensions/closeread/closeread.css.map deleted file mode 100644 index 5ab4002..0000000 --- a/_extensions/closeread/closeread.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sourceRoot":"","sources":["closeread.scss"],"names":[],"mappings":"AACA;AAGA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAMA;EACE;EACA;EACA;;AAKA;EACE;EACA;EACA;;AAGF;EACE;EAEA;EACA;;AAEA;EACE;EACA;;AAEA;EAEE;;AAIA;EACE;;AAIJ;EACE;EACA;;AAKN;EACE;;AAIA;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EAGA;EAEA,YACE;;AAMJ;EACE;EACA,YACE;;AAGJ;EACE;EACA,YACE;;AAIJ;EACE;;AAIF;EACE;;AAIA;EACE;EAEA,YACE;;AAGF;EACE;EAEA,YACA;;AAMJ;EACE;EAEA;;AAGA;EACE;EAEA;;AAIF;EACE;EAEA;;;AASZ;AACA;EACE;AAAA;AAAA;AAAA;AAAA;IAKE;;EAEA;AAAA;AAAA;AAAA;AAAA;IACE;IACA;IACA;IACA;;EAEA;AAAA;AAAA;AAAA;AAAA;IACE;IACA;IACA;IACA;;EAIJ;AAAA;AAAA;AAAA;AAAA;IACE;;;AAQN;AAAA;AAAA;EAGE;;AAEA;AAAA;AAAA;EACE;EACA;EACA;EACA;EACA;;AAEA;AAAA;AAAA;EACE;EACA;EACA;;AAIJ;AAAA;AAAA;EACE;;;AAMF;EACE;EACA;;;AAIF;EACE;;;AAIF;EACE;EACA;;;AAMJ;EACE;;AAEA;EACE;EACA;EACA;;AAEA;EACE;EACA;;AAIJ;EACE;;;AAGJ;EACE;;AAEA;EACE;EACA;EACA;;AAEA;EACE;EACA;;AAIJ;EACE;;;AAKJ;AAAA;AAAA;AAAA;AAAA;EAKE;;AAEA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;EACA;EACA;;AAGF;AAAA;AAAA;AAAA;AAAA;EACE;;;AAIJ;AAKE;EACE;EACA;;AAIF;EACE;;AAKA;EACE;EACA;EACA;;AAEA;EACE;;;AAOR;AAII;EACE;EACA;;AAEA;EACE;;;AAOR;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA","file":"closeread.css"} \ No newline at end of file