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
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
Add .org to Git path preparation
markdown files still take priority over org files if both are present
  • Loading branch information
Aly Sewelam committedNov 24, 2025
commit83353a88bcf40870baaa7f790b2d29eaef4b7bc1
15 changes: 9 additions & 6 deletionsservices/wiki/wiki.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -55,11 +55,12 @@ func InitWiki(ctx context.Context, repo *repo_model.Repository) error {
// prepareGitPath try to find a suitable file path with file name by the given raw wiki name.
// return: existence, prepared file path with name, error
func prepareGitPath(gitRepo *git.Repository, defaultWikiBranch string, wikiPath WebPath) (bool, string, error) {
unescaped := string(wikiPath) + ".md"
unescapedMd := string(wikiPath) + ".md"
unescapedOrg := string(wikiPath) + ".org"
gitPath := WebPathToGitPath(wikiPath)

// Look forboth files
filesInIndex, err := gitRepo.LsTree(defaultWikiBranch,unescaped, gitPath)
// Look for.md, .org, and escaped file
filesInIndex, err := gitRepo.LsTree(defaultWikiBranch,unescapedMd, unescapedOrg, gitPath)
if err != nil {
if strings.Contains(err.Error(), "Not a valid object name") {
return false, gitPath, nil // branch doesn't exist
Expand All@@ -71,9 +72,11 @@ func prepareGitPath(gitRepo *git.Repository, defaultWikiBranch string, wikiPath
foundEscaped := false
for _, filename := range filesInIndex {
switch filename {
case unescaped:
// if we find the unescaped file return it
return true, unescaped, nil
// if we find unescaped file (.md or .org) return it
case unescapedMd:
return true, unescapedMd, nil
case unescapedOrg:
return true, unescapedOrg, nil
case gitPath:
foundEscaped = true
}
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp