Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions hugo_stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"classes": [
"--mount",
"--tmpfs",
"-mr-20",
"-mt-0.5",
"-mt-8",
"-top-10",
Expand Down Expand Up @@ -193,7 +192,6 @@
"border-blue",
"border-divider-light",
"border-gray-200",
"border-gray-300",
"border-gray-400",
"border-green-400",
"border-l-2",
Expand Down Expand Up @@ -239,9 +237,7 @@
"dark:block",
"dark:border-b-blue-600",
"dark:border-divider-dark",
"dark:border-gray-100",
"dark:border-gray-400",
"dark:border-gray-50",
"dark:border-gray-700",
"dark:border-green-400",
"dark:border-l-magenta-dark",
Expand All @@ -266,7 +262,6 @@
"dark:text-blue-700",
"dark:text-divider-dark",
"dark:text-gray",
"dark:text-gray-100",
"dark:text-gray-200",
"dark:text-gray-300",
"dark:text-gray-400",
Expand Down Expand Up @@ -554,7 +549,6 @@
"text-gray-300",
"text-gray-400",
"text-gray-500",
"text-gray-600",
"text-gray-800",
"text-left",
"text-lg",
Expand All @@ -579,7 +573,6 @@
"underline-offset-2",
"w-2",
"w-5",
"w-56",
"w-65",
"w-8",
"w-[1200px]",
Expand Down
57 changes: 8 additions & 49 deletions layouts/partials/md-dropdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,7 @@
<div class="text-base">Ask questions with Docs AI</div>
</div>
</button>
<button
onclick="openInChatGPT()"
data-heap-id="search-docs-ai-button"
class="sub-button"
>
<span class="icon-svg mt-[2px] text-base leading-none">
{{ partial "icon" "/icons/openai.svg" }}
</span>
<div class="leading-tight">
<div class="text-base">Open in ChatGPT</div>
</div>
</button>

{{ if eq hugo.Environment "production" }}
<button
onclick="openInClaude()"
data-heap-id="search-docs-ai-button"
Expand All @@ -82,11 +70,12 @@
<div class="text-base">Open in Claude</div>
</div>
</button>
{{ end }}

</div>
</details>

<script>
<script>
function getCurrentPlaintextUrl() {
const url = window.location.href.split("#")[0].replace(/\/$/, "");
return `${url}/index.md`;
Expand Down Expand Up @@ -131,41 +120,11 @@
}
}

function openInChatGPT() {
fetch(getCurrentPlaintextUrl())
.then((response) => response.text())
.then((text) => {
const encodedText = encodeURIComponent(text);
const chatGPTUrl = `https://chat.openai.com/?q=${encodedText}`;
window.open(chatGPTUrl, "_blank");
})
.catch((err) => {
console.error("Error opening in ChatGPT:", err);
});
}

function openInClaude() {
fetch(getCurrentPlaintextUrl())
.then((response) => response.text())
.then((text) => {
const encodedText = encodeURIComponent(text);
const claudeUrl = `https://claude.ai/new?q=${encodedText}`;https://claude.ai/new?q=%22hey%22
window.open(claudeUrl, '_blank');
})
.catch((err) => {
console.error("Error opening in Claude:", err);
});
const markdownUrl = getCurrentPlaintextUrl();
const prompt = `Read ${markdownUrl} so I can ask questions about it.`;
const encodedText = encodeURIComponent(prompt);
const claudeUrl = `https://claude.ai/new?q=${encodedText}`;
window.open(claudeUrl, '_blank');
}

document.addEventListener("click", function (event) {
const dropdown = document.getElementById("markdownDropdown");

if (!dropdown) return;

const isClickInside = dropdown.contains(event.target);

if (!isClickInside && dropdown.hasAttribute("open")) {
dropdown.removeAttribute("open");
}
});
</script>