Skip to content

Commit

Permalink
Fixes GitHub URL for creating new pages
Browse files Browse the repository at this point in the history
Fixes #38
  • Loading branch information
lukbukkit committed Nov 26, 2023

Verified

This commit was signed with the committer’s verified signature.
maehr Moritz Mähr
1 parent 6bbf7bd commit 4750907
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions resources/src/tldrPageUrl.tsx
Original file line number Diff line number Diff line change
@@ -7,14 +7,14 @@ function tldrPageUrl(action: FileAction, os: string, page: string, language: str
const languageSuffix = language === 'en' ? '' : '.' + language

const baseUrl = 'https://github.com/tldr-pages/tldr'
const filePath = `/main/pages${languageSuffix}/${os}/${page}.md`
const folderPath = `/main/pages${languageSuffix}/${os}`

if (action === FileAction.Create) {
return baseUrl + '/new' + filePath + `?filename=${page}.md`
return `${baseUrl}/new${folderPath}?filename=${page}.md`
}

if (action === FileAction.View) {
return baseUrl + '/blob' + filePath
return `${baseUrl}/blob${folderPath}/${page}.md`
}

throw new Error('Unknown FileAction: ' + action)

0 comments on commit 4750907

Please sign in to comment.