diff --git a/assets/css/utilities.css b/assets/css/utilities.css index cc7f6b3ba1b9..9b2ec25df0fd 100644 --- a/assets/css/utilities.css +++ b/assets/css/utilities.css @@ -234,7 +234,11 @@ } @utility sub-button { - @apply flex w-full items-start gap-2 rounded-sm px-2 py-2 text-left text-gray-700 transition-colors hover:bg-gray-50 dark:text-gray-100 dark:hover:bg-gray-800; + @apply flex w-full items-center gap-2 rounded-sm px-2 py-2 text-left text-gray-600 transition-colors hover:bg-gray-50 dark:text-gray-100 dark:hover:bg-gray-800; +} + +@utility dropdown-base { + @apply rounded-sm border border-gray-300 bg-white text-gray-600 dark:border-gray-300 dark:bg-gray-900 dark:text-gray-100; } @utility toc { diff --git a/assets/icons/claude.svg b/assets/icons/claude.svg new file mode 100644 index 000000000000..e29f32825727 --- /dev/null +++ b/assets/icons/claude.svg @@ -0,0 +1 @@ +Claude \ No newline at end of file diff --git a/assets/icons/openai.svg b/assets/icons/openai.svg new file mode 100644 index 000000000000..50d94d6c1085 --- /dev/null +++ b/assets/icons/openai.svg @@ -0,0 +1 @@ +OpenAI \ No newline at end of file diff --git a/hugo_stats.json b/hugo_stats.json index 2a45252271b8..861a159230b6 100644 --- a/hugo_stats.json +++ b/hugo_stats.json @@ -97,6 +97,8 @@ "Okta", "Okta-SAML", "Old-Dockerfile", + "On-Unix-environments", + "On-Windows", "Other-providers", "PHP", "PowerShell", @@ -193,7 +195,6 @@ "border-gray-200", "border-gray-300", "border-gray-400", - "border-gray-600", "border-green-400", "border-l-2", "border-l-magenta-light", @@ -279,6 +280,7 @@ "download-links", "download-links-subcontainer", "drop-shadow", + "dropdown-base", "duration-300", "fill-blue", "fixed", @@ -578,6 +580,7 @@ "w-2", "w-5", "w-56", + "w-65", "w-8", "w-[1200px]", "w-fit", diff --git a/layouts/partials/md-dropdown.html b/layouts/partials/md-dropdown.html index 86d954ce0e07..3ab319d97ae7 100644 --- a/layouts/partials/md-dropdown.html +++ b/layouts/partials/md-dropdown.html @@ -1,7 +1,6 @@ Page options @@ -14,7 +13,7 @@ Ask questions with Docs AI + + + {{ partial "icon" "/icons/openai.svg" }} + + + Open in ChatGPT + + + + + + {{ partial "icon" "/icons/claude.svg" }} + + + Open in Claude + + + @@ -106,6 +131,32 @@ } } + 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); + }); + } + document.addEventListener("click", function (event) { const dropdown = document.getElementById("markdownDropdown");