Skip to content
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

Bewildering 404 #1317

Closed
kaihendry opened this issue Feb 19, 2019 · 16 comments · Fixed by #1333
Closed

Bewildering 404 #1317

kaihendry opened this issue Feb 19, 2019 · 16 comments · Fixed by #1333
Assignees
Labels
type: enhancement Request to enhance an existing feature type: question or discussion Question or discussion

Comments

@kaihendry
Copy link

  • [X ] I confirm that this is a issue rather than a question.

Bug report

yes, though I asked a question with video on discord already too

Version

^1.0.0-alpha.39

Steps to reproduce

git clone -b vuepress [email protected]:Webconverger/wiki.git
npm run dev
open http://localhost:8080/blog/2014/webconverger_24_release

What is expected?

https://beta.webconverger.org/iso redirects to https://beta.webconverger.org/iso.html and renders
https://beta.webconverger.org/blog/2014/webconverger_24_release should render by the same logic

What is actually happening?

https://beta.webconverger.org/blog/2014/webconverger_24_release is a 404 after seemingly rendering

Other relevant information

https://beta.webconverger.org is on netlify

@ulivz
Copy link
Member

ulivz commented Feb 19, 2019

That's a long story to talk about it, well, for the non-index markdown you shouldn't omit the .html

https://beta.webconverger.org/blog/2014/webconverger_24_release.html

@kaihendry
Copy link
Author

Since the ikiwiki system I'm migrating from had URLs like: https://webconverger.org/blog/2014/Webconverger_24_release/ (by default) I guess I need to add frontmatter to all my .md files, to keep my permalinks (aka URLs) consistent?

Tbh I don't like the superfluous .html default.

@shigma
Copy link
Collaborator

shigma commented Feb 19, 2019

@kaihendry

Have you tried Webconverger_24_release/index.md?

@shigma
Copy link
Collaborator

shigma commented Feb 20, 2019

That's a long story to talk about it, well, for the non-index markdown you shouldn't omit the .html

Do you actually care about the links with relative path? Well after #1298 we do not need to worry about these. Perhaps we can add a new option and redirect all the foo.html to foo/ if there is no ambiguity.

@kaihendry
Copy link
Author

I don't think I use relative links in my markdown. I always link [awesome content](/content/awesome) in an absolute way (I think, need a linter).

I am NOT especially fond of the Webconverger_24_release/index.md suggestion. I think the index.md creates at least to me, clutter. Furthermore now info that should be in the filename imo, is in the folder name. Perhaps I am missing some advantage? I don't keep any images (or other static content) alongside posts anymore, but if I did, I guess that is one advantage perhaps?

@shigma
Copy link
Collaborator

shigma commented Feb 20, 2019

// In VuePress, we have following convention about routing:
//
// - `/foo/` means source file is `/foo/{README|index}.md`
// - `/foo.html` means your source file is `/foo.md`
//
// The original design of VuePress relied on above two styles
// of routing, especially the calculation involved of routes at
// default theme. so we can't easily modify `/foo.html` directly
// to `/foo` (i.e. remove html suffix)
//
// This "temporary" utility handles redirect of clean urls, with
// this utility, you'll get:
//
// For unknown request `/foo`
// - redirect to `/foo.html` if it exists
// - redirect to `/foo/` if it exists
//
// For unknown request `/foo/`
// - redirect to `/foo.html` if it exists
//
// If all the above redirect rules don't exist, you'll get a 404

It seems that vuepress is able to hangle the redirect...... I don't know why it isn't. @ulivz Can you provide some explanation?

@shigma
Copy link
Collaborator

shigma commented Feb 23, 2019

@kaihendry

@shigma shigma self-assigned this Feb 23, 2019
@shigma shigma added the type: enhancement Request to enhance an existing feature label Feb 23, 2019
@kaihendry
Copy link
Author

So I need not rename files IIUC? Just update?

Thank you,

@shigma
Copy link
Collaborator

shigma commented Feb 25, 2019

@kaihendry

The PR has been merged but a version has not been released yet. You need to wait for vuepress v1.0.0-alpha.40. No need to rename any files. 😄

@shigma
Copy link
Collaborator

shigma commented Feb 27, 2019

@kaihendry

Now you can use plugin-clean-urls if you want your urls to be

https://webconverger.org/blog/2014/Webconverger_24_release/

or even

https://webconverger.org/blog/2014/Webconverger_24_release!

@kaihendry
Copy link
Author

I think I like trailing slash since that's the default on most systems iirc.

kaihendry added a commit to Webconverger/wiki that referenced this issue Feb 27, 2019
@kaihendry
Copy link
Author

Just deployed 40 on https://beta.webconverger.org/blog/2014/webconverger_24_release.html and now it's working. However the Edit this page link is not pointing to the branch "vuepress" that it originated from. New bug or am I missing something?

@shigma
Copy link
Collaborator

shigma commented Feb 27, 2019

@kaihendry That is because you use markdown with extension .mkdn instead of .md.

I think you can change your extensions or open a feature request of supporting more extensions.

@kaihendry
Copy link
Author

I've already renamed them in the vuepress branch https://github.com/webconverger/wiki/edit/vuepress/blog/2014/Webconverger_24_release.md

The problem is, it's Edit page is pointing to wrong branch.

@shigma
Copy link
Collaborator

shigma commented Feb 27, 2019

The problem is, it's Edit page is pointing to wrong branch.

We have a config.docsBranch option: https://v1.vuepress.vuejs.org/theme/default-theme-config.html#git-repo-and-edit-links.

@kaihendry
Copy link
Author

Thanks @shigma that works.. but not on pages like: https://beta.webconverger.org/maintenance/

Not where this README.md source comes from.

https://s.natalian.org/2019-02-28/READMEmd.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Request to enhance an existing feature type: question or discussion Question or discussion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants