()
| 185 | const permalink = normalizeUrl([versionMetadata.path, docSlug]); |
| 186 | |
| 187 | function getDocEditUrl() { |
| 188 | const relativeFilePath = path.relative(contentPath, filePath); |
| 189 | |
| 190 | if (typeof options.editUrl === 'function') { |
| 191 | return options.editUrl({ |
| 192 | version: versionMetadata.versionName, |
| 193 | versionDocsDirPath: posixPath( |
| 194 | path.relative(siteDir, versionMetadata.contentPath), |
| 195 | ), |
| 196 | docPath: posixPath(relativeFilePath), |
| 197 | permalink, |
| 198 | locale: context.i18n.currentLocale, |
| 199 | }); |
| 200 | } else if (typeof options.editUrl === 'string') { |
| 201 | const isLocalized = |
| 202 | typeof versionMetadata.contentPathLocalized !== 'undefined' && |
| 203 | contentPath === versionMetadata.contentPathLocalized; |
| 204 | const baseVersionEditUrl = |
| 205 | isLocalized && options.editLocalizedFiles |
| 206 | ? versionMetadata.editUrlLocalized |
| 207 | : versionMetadata.editUrl; |
| 208 | return getEditUrl(relativeFilePath, baseVersionEditUrl); |
| 209 | } |
| 210 | return undefined; |
| 211 | } |
| 212 | |
| 213 | const draft = isDraft({env, frontMatter}); |
| 214 | const unlisted = isUnlisted({env, frontMatter}); |
no test coverage detected
searching dependent graphs…