mirror of
https://github.com/jackyzha0/quartz.git
synced 2026-02-04 06:25:41 -06:00
fix: copy markdown to work for mobile, use update honcho link, and fix appropriate width.
This commit is contained in:
parent
36421119b7
commit
3d85965b46
@ -116,7 +116,7 @@ const CopyPageMarkdown: QuartzComponent = ({ fileData, displayClass }: QuartzCom
|
|||||||
<path d="M59.16 50.47H31.98V56.31H59.16V50.47Z"></path>
|
<path d="M59.16 50.47H31.98V56.31H59.16V50.47Z"></path>
|
||||||
</svg>
|
</svg>
|
||||||
<div class="dropdown-item-content">
|
<div class="dropdown-item-content">
|
||||||
<span class="dropdown-item-title">{isHomePage ? "Ask Honcho about this blog" : "Ask Honcho about this page"} <span class="external-arrow">↗</span></span>
|
<span class="dropdown-item-title">{isHomePage ? "Ask Honcho Chat about this blog" : "Ask Honcho Chat about this page"} <span class="external-arrow">↗</span></span>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
|
|||||||
@ -9,10 +9,9 @@ async function copyToClipboard(text: string): Promise<boolean> {
|
|||||||
return true
|
return true
|
||||||
} catch {
|
} catch {
|
||||||
// Fallback for mobile browsers
|
// Fallback for mobile browsers
|
||||||
const textarea = Object.assign(document.createElement("textarea"), {
|
const textarea = document.createElement("textarea")
|
||||||
value: text,
|
textarea.value = text
|
||||||
style: "position:fixed;left:-9999px",
|
textarea.style.cssText = "position:fixed;left:-9999px;top:0"
|
||||||
})
|
|
||||||
document.body.appendChild(textarea)
|
document.body.appendChild(textarea)
|
||||||
textarea.select()
|
textarea.select()
|
||||||
const ok = document.execCommand("copy")
|
const ok = document.execCommand("copy")
|
||||||
@ -59,7 +58,7 @@ document.addEventListener("nav", () => {
|
|||||||
// Set the correct hrefs for Honcho, ChatGPT and Claude links
|
// Set the correct hrefs for Honcho, ChatGPT and Claude links
|
||||||
if (honchoLink) {
|
if (honchoLink) {
|
||||||
const prompt = `Read this page and answer questions about it: ${llmsUrl}`
|
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) {
|
if (chatgptLink) {
|
||||||
const prompt = `Read this page and answer questions about it: ${llmsUrl}`
|
const prompt = `Read this page and answer questions about it: ${llmsUrl}`
|
||||||
|
|||||||
@ -40,7 +40,7 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: calc(100% + 4px);
|
top: calc(100% + 4px);
|
||||||
right: 0;
|
right: 0;
|
||||||
width: 280px;
|
width: max-content;
|
||||||
background: var(--light);
|
background: var(--light);
|
||||||
border: 1px solid var(--lightgray);
|
border: 1px solid var(--lightgray);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user