From 9a4b4f04fbc5ed6f00944d42620ebb452da31886 Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Wed, 18 Oct 2023 15:39:26 +0200 Subject: [PATCH 1/5] Support slider_server_url in pluto_export.json --- frontend/components/welcome/Featured.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/components/welcome/Featured.js b/frontend/components/welcome/Featured.js index 6937d13241..1616e903e1 100644 --- a/frontend/components/welcome/Featured.js +++ b/frontend/components/welcome/Featured.js @@ -35,6 +35,8 @@ import { FeaturedCard } from "./FeaturedCard.js" * source_url?: String, * title?: String, * description?: String, + * binder_url?: String, + * slider_server_url?: String, * }} */ From 1c6c96339fb48bbb54365e30d37ac92f25cb2a04 Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Wed, 18 Oct 2023 15:50:58 +0200 Subject: [PATCH 2/5] Update FeaturedCard.js --- frontend/components/welcome/FeaturedCard.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/components/welcome/FeaturedCard.js b/frontend/components/welcome/FeaturedCard.js index 98424a5626..9f13aa788b 100644 --- a/frontend/components/welcome/FeaturedCard.js +++ b/frontend/components/welcome/FeaturedCard.js @@ -9,14 +9,17 @@ const str_to_degree = (s) => ([...s].reduce((a, b) => a + b.charCodeAt(0), 0) * /** * @param {{ + * source_manifest: import("./Featured.js").SourceManifest, * entry: import("./Featured.js").SourceManifestNotebookEntry, * source_url?: string, * direct_html_links: boolean, * }} props */ -export const FeaturedCard = ({ entry, source_url, direct_html_links }) => { +export const FeaturedCard = ({ entry, source_manifest, direct_html_links }) => { const title = entry.frontmatter?.title + const { source_url } = source_manifest + const u = (/** @type {string | null | undefined} */ x) => source_url == null ? x @@ -37,8 +40,9 @@ export const FeaturedCard = ({ entry, source_url, direct_html_links }) => { notebookfile: u(entry.notebookfile_path), notebookfile_integrity: `sha256-${base64url_to_base64(entry.hash)}`, disable_ui: `true`, - pluto_server_url: `.`, name: title == null ? null : `sample ${title}`, + pluto_server_url: `.`, + slider_server_url: u(source_manifest.slider_server_url), }) const author = author_info(entry.frontmatter) From 92b5c1fe6908e33033578d4a2d71df2abbcf7b13 Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Wed, 18 Oct 2023 15:51:24 +0200 Subject: [PATCH 3/5] Update Featured.js --- frontend/components/welcome/Featured.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/frontend/components/welcome/Featured.js b/frontend/components/welcome/Featured.js index 1616e903e1..9b63476d49 100644 --- a/frontend/components/welcome/Featured.js +++ b/frontend/components/welcome/Featured.js @@ -125,9 +125,6 @@ export const Featured = ({ sources, direct_html_links }) => { const ids = Array.from(new Set(sources.map(get_id))) - console.log(ids) - console.log("123123123213123") - const promises = ids.map((id) => { const sources_for_id = sources.filter((source) => get_id(source) === id) @@ -204,8 +201,7 @@ export const Featured = ({ sources, direct_html_links }) => {

${coll.description}

${collection(Object.values(data.notebooks), coll.tags ?? []).map( - (entry) => - html`<${FeaturedCard} entry=${entry} source_url=${data.source_url} direct_html_links=${direct_html_links} />` + (entry) => html`<${FeaturedCard} entry=${entry} source_data=${data} direct_html_links=${direct_html_links} />` )}
From 99d2e9bbe8cb7e693f915be3833bac849ea202c4 Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Mon, 30 Oct 2023 12:05:24 +0100 Subject: [PATCH 4/5] Update FeaturedCard.js --- frontend/components/welcome/FeaturedCard.js | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/components/welcome/FeaturedCard.js b/frontend/components/welcome/FeaturedCard.js index 9f13aa788b..9846bcadff 100644 --- a/frontend/components/welcome/FeaturedCard.js +++ b/frontend/components/welcome/FeaturedCard.js @@ -11,7 +11,6 @@ const str_to_degree = (s) => ([...s].reduce((a, b) => a + b.charCodeAt(0), 0) * * @param {{ * source_manifest: import("./Featured.js").SourceManifest, * entry: import("./Featured.js").SourceManifestNotebookEntry, - * source_url?: string, * direct_html_links: boolean, * }} props */ From 677c5e66d58150944ee521fbbeda08e016b40329 Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Mon, 30 Oct 2023 12:06:37 +0100 Subject: [PATCH 5/5] Update Featured.js --- frontend/components/welcome/Featured.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/components/welcome/Featured.js b/frontend/components/welcome/Featured.js index e3286bdc7d..e9970001c3 100644 --- a/frontend/components/welcome/Featured.js +++ b/frontend/components/welcome/Featured.js @@ -199,7 +199,7 @@ export const Featured = ({ sources, direct_html_links }) => {

${coll.description}

${collection(Object.values(data.notebooks), coll.tags ?? []).map( - (entry) => html`<${FeaturedCard} entry=${entry} source_data=${data} direct_html_links=${direct_html_links} />` + (entry) => html`<${FeaturedCard} entry=${entry} source_manifest=${data} direct_html_links=${direct_html_links} />` )}