Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: trigger doc link (#31754)

Stephen Zhoub7e752078c58
diff --git a/web/app/components/explore/sidebar/no-apps/index.tsx b/web/app/components/explore/sidebar/no-apps/index.tsx
index 39b425ce355..f2f406008b2 100644
--- a/web/app/components/explore/sidebar/no-apps/index.tsx
+++ b/web/app/components/explore/sidebar/no-apps/index.tsx
@@ -2,6 +2,7 @@
import type { FC } from 'react'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
+import { useDocLink } from '@/context/i18n'
import useTheme from '@/hooks/use-theme'
import { Theme } from '@/types/app'
import { cn } from '@/utils/classnames'
@@ -12,12 +13,13 @@ const i18nPrefix = 'sidebar.noApps'
const NoApps: FC = () => {
const { t } = useTranslation()
const { theme } = useTheme()
+ const docLink = useDocLink()
return (
<div className="rounded-xl bg-background-default-subtle p-4">
<div className={cn('h-[35px] w-[86px] bg-contain bg-center bg-no-repeat', theme === Theme.dark ? s.dark : s.light)}></div>
<div className="system-sm-semibold mt-2 text-text-secondary">{t(`${i18nPrefix}.title`, { ns: 'explore' })}</div>
<div className="system-xs-regular my-1 text-text-tertiary">{t(`${i18nPrefix}.description`, { ns: 'explore' })}</div>
- <a className="system-xs-regular text-text-accent" target="_blank" rel="noopener noreferrer" href="https://docs.dify.ai/en/guides/application-publishing/launch-your-webapp-quickly/README">{t(`${i18nPrefix}.learnMore`, { ns: 'explore' })}</a>
+ <a className="system-xs-regular text-text-accent" target="_blank" rel="noopener noreferrer" href={docLink('/use-dify/publish/README')}>{t(`${i18nPrefix}.learnMore`, { ns: 'explore' })}</a>
</div>
)
}
diff --git a/web/app/components/workflow/nodes/trigger-plugin/default.ts b/web/app/components/workflow/nodes/trigger-plugin/default.ts
index 0cb2a72c917..605a1e3f1dd 100644
--- a/web/app/components/workflow/nodes/trigger-plugin/default.ts
+++ b/web/app/components/workflow/nodes/trigger-plugin/default.ts
@@ -221,7 +221,7 @@ const buildOutputVars = (schema: Record<string, any>, schemaTypeDefinitions?: Sc
const metaData = genNodeMetaData({
sort: 1,
type: BlockEnum.TriggerPlugin,
- helpLinkUri: 'plugin-trigger',
+ helpLinkUri: 'trigger/plugin-trigger',
isStart: true,
})
diff --git a/web/app/components/workflow/nodes/trigger-schedule/default.ts b/web/app/components/workflow/nodes/trigger-schedule/default.ts
index 4f166675e71..587a125c2da 100644
--- a/web/app/components/workflow/nodes/trigger-schedule/default.ts
+++ b/web/app/components/workflow/nodes/trigger-schedule/default.ts
@@ -110,7 +110,7 @@ const validateVisualConfig = (payload: ScheduleTriggerNodeType, t: any): string
const metaData = genNodeMetaData({
sort: 2,
type: BlockEnum.TriggerSchedule,
- helpLinkUri: 'schedule-trigger',
+ helpLinkUri: 'trigger/schedule-trigger',
isStart: true,
})
diff --git a/web/app/components/workflow/nodes/trigger-webhook/default.ts b/web/app/components/workflow/nodes/trigger-webhook/default.ts
index ec0369d7533..66fae30b0d4 100644
--- a/web/app/components/workflow/nodes/trigger-webhook/default.ts
+++ b/web/app/components/workflow/nodes/trigger-webhook/default.ts
@@ -8,7 +8,7 @@ import { createWebhookRawVariable } from './utils/raw-variable'
const metaData = genNodeMetaData({
sort: 3,
type: BlockEnum.TriggerWebhook,
- helpLinkUri: 'webhook-trigger',
+ helpLinkUri: 'trigger/webhook-trigger',
isStart: true,
})
diff --git a/web/app/components/workflow/utils/gen-node-meta-data.ts b/web/app/components/workflow/utils/gen-node-meta-data.ts
index f45bfcb0181..e625e3a8af3 100644
--- a/web/app/components/workflow/utils/gen-node-meta-data.ts
+++ b/web/app/components/workflow/utils/gen-node-meta-data.ts
@@ -1,4 +1,5 @@
import type { BlockEnum } from '@/app/components/workflow/types'
+import type { UseDifyNodesPath } from '@/types/doc-paths'
import { BlockClassificationEnum } from '@/app/components/workflow/block-selector/types'
export type GenNodeMetaDataParams = {
@@ -7,7 +8,7 @@ export type GenNodeMetaDataParams = {
type: BlockEnum
title?: string
author?: string
- helpLinkUri?: string
+ helpLinkUri?: UseDifyNodesPath
isRequired?: boolean
isUndeletable?: boolean
isStart?: boolean
diff --git a/web/context/i18n.ts b/web/context/i18n.ts
index 2766dfe5ea6..5f39d1afb3f 100644
--- a/web/context/i18n.ts
+++ b/web/context/i18n.ts
@@ -1,6 +1,7 @@
import type { Locale } from '@/i18n-config/language'
import type { DocPathWithoutLang } from '@/types/doc-paths'
import { useTranslation } from '#i18n'
+import { useCallback } from 'react'
import { getDocLanguage, getLanguage, getPricingPageLanguage } from '@/i18n-config/language'
import { apiReferencePathTranslations } from '@/types/doc-paths'
@@ -27,21 +28,24 @@ export const useDocLink = (baseUrl?: string): ((path?: DocPathWithoutLang, pathM
let baseDocUrl = baseUrl || defaultDocBaseUrl
baseDocUrl = (baseDocUrl.endsWith('/')) ? baseDocUrl.slice(0, -1) : baseDocUrl
const locale = useLocale()
- const docLanguage = getDocLanguage(locale)
- return (path?: DocPathWithoutLang, pathMap?: DocPathMap): string => {
- const pathUrl = path || ''
- let targetPath = (pathMap) ? pathMap[locale] || pathUrl : pathUrl
- let languagePrefix = `/${docLanguage}`
-
- // Translate API reference paths for non-English locales
- if (targetPath.startsWith('/api-reference/') && docLanguage !== 'en') {
- const translatedPath = apiReferencePathTranslations[targetPath]?.[docLanguage as 'zh' | 'ja']
- if (translatedPath) {
- targetPath = translatedPath
- languagePrefix = ''
+ return useCallback(
+ (path?: DocPathWithoutLang, pathMap?: DocPathMap): string => {
+ const docLanguage = getDocLanguage(locale)
+ const pathUrl = path || ''
+ let targetPath = (pathMap) ? pathMap[locale] || pathUrl : pathUrl
+ let languagePrefix = `/${docLanguage}`
+
+ // Translate API reference paths for non-English locales
+ if (targetPath.startsWith('/api-reference/') && docLanguage !== 'en') {
+ const translatedPath = apiReferencePathTranslations[targetPath]?.[docLanguage as 'zh' | 'ja']
+ if (translatedPath) {
+ targetPath = translatedPath
+ languagePrefix = ''
+ }
}
- }
- return `${baseDocUrl}${languagePrefix}${targetPath}`
- }
+ return `${baseDocUrl}${languagePrefix}${targetPath}`
+ },
+ [baseDocUrl, locale],
+ )
}
diff --git a/web/scripts/gen-doc-paths.ts b/web/scripts/gen-doc-paths.ts
index f0393937c25..03c3cdaddca 100644
--- a/web/scripts/gen-doc-paths.ts
+++ b/web/scripts/gen-doc-paths.ts
@@ -282,6 +282,15 @@ function generateTypeDefinitions(
}
lines.push('')
+
+ // Add UseDifyNodesPath helper type after UseDifyPath
+ if (section === 'use-dify') {
+ lines.push('// UseDify node paths (without prefix)')
+ // eslint-disable-next-line no-template-curly-in-string
+ lines.push('type ExtractNodesPath<T> = T extends `/use-dify/nodes/${infer Path}` ? Path : never')
+ lines.push('export type UseDifyNodesPath = ExtractNodesPath<UseDifyPath>')
+ lines.push('')
+ }
}
// Generate API reference type (English paths only)
diff --git a/web/types/doc-paths.ts b/web/types/doc-paths.ts
index 7a74f0905d6..8f95249354d 100644
--- a/web/types/doc-paths.ts
+++ b/web/types/doc-paths.ts
@@ -2,7 +2,7 @@
// DON NOT EDIT IT MANUALLY
//
// Generated from: https://raw.githubusercontent.com/langgenius/dify-docs/refs/heads/main/docs.json
-// Generated at: 2026-01-21T07:24:02.413Z
+// Generated at: 2026-01-30T09:14:29.304Z
// Language prefixes
export type DocLanguage = 'en' | 'zh' | 'ja'
@@ -104,6 +104,10 @@ export type UseDifyPath =
| '/use-dify/workspace/subscription-management'
| '/use-dify/workspace/team-members-management'
+// UseDify node paths (without prefix)
+type ExtractNodesPath<T> = T extends `/use-dify/nodes/${infer Path}` ? Path : never
+export type UseDifyNodesPath = ExtractNodesPath<UseDifyPath>
+
// SelfHost paths
export type SelfHostPath =
| '/self-host/advanced-deployments/local-source-code'