Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Implement .org file rendering in Wiki#36018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
LinlyBoi wants to merge19 commits intogo-gitea:main
base:main
Choose a base branch
Loading
fromLinlyBoi:main
Draft
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
19 commits
Select commitHold shift + click to select a range
30254b9
Detect markup rendering from filename
Nov 24, 2025
cb93344
Detect .org files if .md isn't found in wiki
Nov 24, 2025
cb38c04
Handle .org files in Sidebar and footer of wiki
Nov 24, 2025
51b7680
Detect markup type instead of defaulting to .md
Nov 24, 2025
3931b8f
Add .org file detection to WikiRaw function
Nov 24, 2025
36c23b8
Add .org condition to escapeSegToWeb
Nov 24, 2025
3ae4823
Add org file path resolution for Web and Git paths
Nov 24, 2025
676a785
add .org to WebPathToUserTitle
Nov 24, 2025
83353a8
Add .org to Git path preparation
Nov 24, 2025
e2812ca
Resolve linting issues
Nov 24, 2025
3268f6f
Merge branch 'go-gitea:main' into main
LinlyBoiNov 25, 2025
997ce9f
Add default wiki format setting value to struct
Nov 26, 2025
f0c005b
Add DefaultWikiFormat var and its checks
Nov 26, 2025
a4ccf65
use config option for default wiki format paths
Nov 26, 2025
884a1ed
Integrate DefaultWikiFormat to wiki settings
Nov 27, 2025
535a377
check wiki entry names based on DefaultWikiFormat
Nov 27, 2025
914926f
Add wiki format setting to option tmpl and locales
Nov 27, 2025
4778511
Include defaultWikiFormat in WebPathToGitPath
Nov 27, 2025
1707118
Merge container registry fix to fork
Nov 27, 2025
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
PrevPrevious commit
NextNext commit
Resolve linting issues
Modernise string suffix check with CutSuffixAdded nilcheck for entry after the org version check attempt
  • Loading branch information
Aly Sewelam committedNov 24, 2025
commite2812ca2595f187e68b542f1008aee7db18b7de7
22 changes: 12 additions & 10 deletionsrouters/web/repo/wiki.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -154,8 +154,8 @@ func wikiEntryByName(ctx *context.Context, commit *git.Commit, wikiName wiki_ser
}
if entry == nil {
// If .md file not found, try .org file
if strings.HasSuffix(gitFilename, ".md") {
orgFilename :=strings.TrimSuffix(gitFilename, ".md") + ".org"
ifbase, ok :=strings.CutSuffix(gitFilename, ".md"); ok {
orgFilename :=base + ".org"
entry, err = findEntryForFile(commit, orgFilename)
if err != nil && !git.IsErrNotExist(err) {
ctx.ServerError("findEntryForFile", err)
Expand All@@ -168,10 +168,10 @@ func wikiEntryByName(ctx *context.Context, commit *git.Commit, wikiName wiki_ser
// If still not found, check if the file without extension exists (for raw files)
if entry == nil {
baseFilename := gitFilename
if strings.HasSuffix(baseFilename, ".md") {
baseFilename =strings.TrimSuffix(baseFilename, ".md")
} else if strings.HasSuffix(baseFilename, ".org") {
baseFilename =strings.TrimSuffix(baseFilename, ".org")
ifbase, ok :=strings.CutSuffix(baseFilename, ".md"); ok {
baseFilename =base
} else ifbase, ok :=strings.CutSuffix(baseFilename, ".org"); ok {
baseFilename =base
}
entry, err = findEntryForFile(commit, baseFilename)
if err != nil && !git.IsErrNotExist(err) {
Expand DownExpand Up@@ -678,10 +678,12 @@ func WikiRaw(ctx *context.Context) {
ctx.ServerError("findFile", err)
return
}
entry, err = findEntryForFile(commit, providedGitPath)
if err != nil && !git.IsErrNotExist(err) {
ctx.ServerError("findFile", err)
return
if entry == nil {
entry, err = findEntryForFile(commit, providedGitPath)
if err != nil && !git.IsErrNotExist(err) {
ctx.ServerError("findFile", err)
return
}
}
}
}
Expand Down
12 changes: 6 additions & 6 deletionsservices/wiki/wiki_path.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -114,10 +114,10 @@ func WebPathToGitPath(s WebPath) string {

func GitPathToWebPath(s string) (wp WebPath, err error) {
// Trim .md or .org suffix if present
if strings.HasSuffix(s, ".md") {
s =strings.TrimSuffix(s, ".md")
} else if strings.HasSuffix(s, ".org") {
s =strings.TrimSuffix(s, ".org")
ifbefore, ok :=strings.CutSuffix(s, ".md"); ok {
s =before
} else ifbefore, ok :=strings.CutSuffix(s, ".org"); ok {
s =before
} else {
// If it doesn't end with .md or .org, it's not a valid wiki file
return "", repo_model.ErrWikiInvalidFileName{FileName: s}
Expand All@@ -139,8 +139,8 @@ func WebPathToUserTitle(s WebPath) (dir, display string) {
if before, ok := strings.CutSuffix(display, ".md"); ok {
display = before
display, _ = url.PathUnescape(display)
} else if strings.HasSuffix(display, ".org") {
display =strings.TrimSuffix(display, ".org")
} else ifbefore, ok :=strings.CutSuffix(display, ".org"); ok {
display =before
display, _ = url.PathUnescape(display)
}
display, _ = unescapeSegment(display)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp