Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>ComfyUI</title>
<link rel="icon" type="image/x-icon" href="/assets/favicon.ico" />
<meta
name="viewport"
Expand Down
4 changes: 3 additions & 1 deletion src/composables/useBrowserTabTitle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import { useWorkflowStore } from '@/platform/workflow/management/stores/workflow
import { useExecutionStore } from '@/stores/executionStore'
import { useWorkspaceStore } from '@/stores/workspaceStore'

const DEFAULT_TITLE = 'ComfyUI'
// Capture the initial title injected by Vite (e.g. for SEO on cloud.comfy.org)
const DEFAULT_TITLE =
typeof document !== 'undefined' && document.title ? document.title : 'ComfyUI'
const TITLE_SUFFIX = ' - ComfyUI'

export const useBrowserTabTitle = () => {
Expand Down
16 changes: 15 additions & 1 deletion src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,22 @@ router.beforeEach((to, _from, next) => {
next()
})

router.afterEach(() => {
router.afterEach((to) => {
trackPageView()

// Update canonical URL to resolve duplicate parameter SEO issues (P1-4)
// Ensures Googlebot indexes the clean path without query strings (e.g. ?template=)
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
let canonicalLink: HTMLLinkElement | null = document.querySelector(
'link[rel="canonical"]'
)
if (!canonicalLink) {
canonicalLink = document.createElement('link')
canonicalLink.rel = 'canonical'
document.head.appendChild(canonicalLink)
}
canonicalLink.href = window.location.origin + to.path
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
})

if (isCloud) {
Expand Down
7 changes: 6 additions & 1 deletion vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,12 @@ export default defineConfig({
{
name: 'inject-twitter-meta',
transformIndexHtml(html) {
if (DISTRIBUTION !== 'cloud') return html
if (DISTRIBUTION !== 'cloud') {
return {
html,
tags: [{ tag: 'title', children: 'ComfyUI', injectTo: 'head' }]
}
}

return {
html,
Expand Down
Loading