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

feat: Specify the different entry file rather than index.md #1429

Closed
wants to merge 9 commits into from

Conversation

g4rry420
Copy link
Contributor

@g4rry420 g4rry420 commented Oct 2, 2022

Signed-off-by: GurkiranSingh [email protected]

User can specify different entry rather index.md by using the entry config option. Please, let me know if you see any issues :)
Resolves: #280

res.statusCode = 404
if (notAnAsset(req.path)) res.write(notFound.toString())
res.end()
if (site.site.entry !== 'index' && req.path === '/') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah but this logic won't work when someone is deploying their site. It only works with our custom server which is only suitable for previewing the website locally after build. The servers specifically need index.html to be present. That being said, we need to build entry as if it was index.md (and emit index.html).

VuePress has probably done this using their permalink feature, which is still missing in VitePress.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I was worried by this too. I will look into VuePress implementation for this.

@g4rry420 g4rry420 marked this pull request as draft October 4, 2022 00:18
src/node/plugin.ts Outdated Show resolved Hide resolved
@g4rry420
Copy link
Contributor Author

g4rry420 commented Oct 5, 2022

@brc-dd If user specifies the different entry file other than index, then I am emitting index.html file, however, the entry file js chunk remained the same name, which shouldn't be a problem as we are only importing it in the index file.
Also, if user wants to add link to the entry page, then they will have to point to index file only, otherwise it will result in deadlinks.
Please, let me know if you see any issues :)

@g4rry420 g4rry420 marked this pull request as ready for review October 5, 2022 00:41
@g4rry420 g4rry420 requested a review from brc-dd October 5, 2022 00:41
@brc-dd brc-dd mentioned this pull request Jan 15, 2023
7 tasks
@brc-dd brc-dd closed this in #1798 Jan 27, 2023
@g4rry420 g4rry420 deleted the issue_280 branch January 29, 2023 21:14
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: changeable entry file
2 participants