Skip to content

raw wiki files return 404 #3523

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 7 tasks
TankTheFrank opened this issue Feb 17, 2018 · 13 comments
Closed
1 of 7 tasks

raw wiki files return 404 #3523

TankTheFrank opened this issue Feb 17, 2018 · 13 comments
Labels

Comments

@TankTheFrank
Copy link

Description

Raw files need to have '.md' added as extension to be served.

They are served by repo.WikiRaw() which does this:

...
wikiPath := models.WikiNameToFilename(providedPath)
...

models.WikiNameToFilename is a short function:

// WikiNameToFilename converts a wiki name to its corresponding filename.
func WikiNameToFilename(name string) string {
	name = strings.Replace(name, " ", "-", -1)
	return url.QueryEscape(name) + ".md"
}

Shortly put ".md" is appended to the path, in order to get a raw file from the repo, say "file.txt" it has to be saved as "file.txt.md" and it will be available as "wiki/raw/file.txt".

@thehowl
Copy link
Contributor

thehowl commented Feb 20, 2018

@TankTheFrank
Copy link
Author

"raw files" means non-md files, files that are not markdown and not supposed to be parsed like images, text, etc.

@Nabile-Rahmani
Copy link

Nabile-Rahmani commented Apr 15, 2018

@thehowl Gitea pre-1.4.0 (1.3.2) used to be able to serve any file from a project's wiki, even in subdirectories.
I use wikis in conjunction with mkdocs, and linking to a md source file for editing, but also for storing other documentation file types.

Even though previous versions didn't show the website with the markdown editor, it did serve md files and any other kind of file type present in the wiki repository.
Optionally, it would also be nice if wiki/_pages would recursively search for markdown files, but I don't have a need for it.

I can link you an example if you need it.

@thehowl
Copy link
Contributor

thehowl commented May 3, 2018

@Nabile-Rahmani sorry about the delay. Hmm, if it did use to work, this seems like an issue then. @lafriks can you please add kind/bug?

@Pablo2048
Copy link

Does this bug have something in common with no images shown in wiki pages please? I'm unable to put any image into wiki pages - it always shows 404 error...

@thehowl
Copy link
Contributor

thehowl commented May 13, 2018

@Pablo2048 What do you mean? Even external images?

@Pablo2048
Copy link

@thehowl Thanks for reply - No - it seems like external images works. Internal images (contained inside wiki) return 404.

@thehowl
Copy link
Contributor

thehowl commented May 13, 2018

Then yes, it's the same issue. Thanks for pitching in!

@stale
Copy link

stale bot commented Jan 27, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Jan 27, 2019
@lunny
Copy link
Member

lunny commented Feb 7, 2019

Is this still a problem?

@Pablo2048
Copy link

Yes - in 1.7.1 the problem persist. It seems like it will be solved in 1.8 - see #4690

@stale stale bot removed the issue/stale label Feb 7, 2019
@zeripath zeripath closed this as completed Feb 7, 2019
@Nabile-Rahmani
Copy link

Could someone reopen this issue ? I'm still getting 404 errors on 1.9.4.

@guillep2k
Copy link
Member

Could someone reopen this issue ? I'm still getting 404 errors on 1.9.4.

@Nabile-Rahmani I'd suggest you open a new issue, as the cause for your problem is probably different than this'. Please try to give us some information about how it's failing exactly.

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants