From 36421119b7b97337902225279fd6b508c82094ca Mon Sep 17 00:00:00 2001 From: ajspig Date: Fri, 12 Dec 2025 10:54:56 -0500 Subject: [PATCH 1/3] fix: Improving copy. Tries the current clipboardAPI & then does textarea/execCommand method for mobile. --- quartz/components/scripts/copypage.inline.ts | 32 ++++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/quartz/components/scripts/copypage.inline.ts b/quartz/components/scripts/copypage.inline.ts index 7e57b8650..0003c6afb 100644 --- a/quartz/components/scripts/copypage.inline.ts +++ b/quartz/components/scripts/copypage.inline.ts @@ -3,20 +3,31 @@ const svgCopy = const svgCheck = '' +async function copyToClipboard(text: string): Promise { + try { + await navigator.clipboard.writeText(text) + return true + } catch { + // Fallback for mobile browsers + const textarea = Object.assign(document.createElement("textarea"), { + value: text, + style: "position:fixed;left:-9999px", + }) + document.body.appendChild(textarea) + textarea.select() + const ok = document.execCommand("copy") + document.body.removeChild(textarea) + return ok + } +} + async function copyPageMarkdown(slug: string): Promise { try { - // Use full blog content for home page, individual page content otherwise const llmsUrl = slug === "index" ? `/llms-full.txt` : `/${slug}/llms.txt` const response = await fetch(llmsUrl) - if (!response.ok) { - console.error("Failed to fetch markdown:", response.statusText) - return false - } - const markdown = await response.text() - await navigator.clipboard.writeText(markdown) - return true - } catch (error) { - console.error("Failed to copy page markdown:", error) + if (!response.ok) return false + return copyToClipboard(await response.text()) + } catch { return false } } @@ -112,3 +123,4 @@ document.addEventListener("nav", () => { }) + From 3d85965b46b0e4b89eb8ed5b4a2b971a2af07ace Mon Sep 17 00:00:00 2001 From: ajspig Date: Fri, 12 Dec 2025 12:46:04 -0500 Subject: [PATCH 2/3] fix: copy markdown to work for mobile, use update honcho link, and fix appropriate width. --- quartz/components/CopyPageMarkdown.tsx | 2 +- quartz/components/scripts/copypage.inline.ts | 9 ++++----- quartz/components/styles/copypage.scss | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/quartz/components/CopyPageMarkdown.tsx b/quartz/components/CopyPageMarkdown.tsx index 30fa73516..61b89e819 100644 --- a/quartz/components/CopyPageMarkdown.tsx +++ b/quartz/components/CopyPageMarkdown.tsx @@ -116,7 +116,7 @@ const CopyPageMarkdown: QuartzComponent = ({ fileData, displayClass }: QuartzCom { return true } catch { // Fallback for mobile browsers - const textarea = Object.assign(document.createElement("textarea"), { - value: text, - style: "position:fixed;left:-9999px", - }) + const textarea = document.createElement("textarea") + textarea.value = text + textarea.style.cssText = "position:fixed;left:-9999px;top:0" document.body.appendChild(textarea) textarea.select() const ok = document.execCommand("copy") @@ -59,7 +58,7 @@ document.addEventListener("nav", () => { // Set the correct hrefs for Honcho, ChatGPT and Claude links if (honchoLink) { const prompt = `Read this page and answer questions about it: ${llmsUrl}` - honchoLink.href = `https://honcho.chat/?q=${encodeURIComponent(prompt)}` + honchoLink.href = `https://honcho.chat/?hints=search&q=${encodeURIComponent(prompt)}` } if (chatgptLink) { const prompt = `Read this page and answer questions about it: ${llmsUrl}` diff --git a/quartz/components/styles/copypage.scss b/quartz/components/styles/copypage.scss index 145cd7e43..03e007fde 100644 --- a/quartz/components/styles/copypage.scss +++ b/quartz/components/styles/copypage.scss @@ -40,7 +40,7 @@ position: absolute; top: calc(100% + 4px); right: 0; - width: 280px; + width: max-content; background: var(--light); border: 1px solid var(--lightgray); border-radius: 8px; From 1ad4714105d7da7ad0cce143f35908d61c1cf23b Mon Sep 17 00:00:00 2001 From: ajspig Date: Fri, 12 Dec 2025 12:54:08 -0500 Subject: [PATCH 3/3] fix: mobile hamburger menu. Stacks vertically and no overlap --- quartz/styles/custom.scss | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/quartz/styles/custom.scss b/quartz/styles/custom.scss index 05efd1929..cdab63dae 100644 --- a/quartz/styles/custom.scss +++ b/quartz/styles/custom.scss @@ -94,6 +94,16 @@ body { font-size: 0.86rem; } +@media (max-width: 800px) { + .sidebar.left { + flex-direction: column; + } + + .explorer .explorer-content { + padding-top: 5rem; + } +} + input[type="search"] { background-color: var(--searchBackground); }