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(cli): support custom srcDir #4270

Merged
merged 1 commit into from
Feb 15, 2025

Conversation

Barbapapazes
Copy link
Contributor

Description

Hello 👋,

This PR introduces a new scaffolding parameter to ask the developer where Markdown files should be stored. This is related to the srcDir parameter in the vitepress.config.js file.

For blogs, portfolios, and marketing sites, or any sites that use VitePress as the main project (without a docs folder), having a src folder is more intuitive and I think a better architecture than having every Markdown files at the root of the project. The file .vitepress/config.{js,ts} can stay at the root of the project.

The architecture of the project will look like this:

.
├── src
|   ├── file.md
|   └── file2.md
└── .vitepress
    └── config.{js,ts}

Linked Issues

Additional Context

I'm building a tutorial on how to create a blog with VitePress and Vue.js from scratch. I used a lot VitePress for documentation, and it was fine. But for blogs, portfolios, and marketing sites, as mentioned in the VitePress documentation, I think the CLI needs some adjustments to make it easier to use and less documentation's oriented.


Tip

The author of this PR can publish a preview release by commenting /publish below.

@github-actions github-actions bot added the stale label Dec 3, 2024
@brc-dd brc-dd merged commit 518c094 into vuejs:main Feb 15, 2025
4 checks passed
brc-dd added a commit that referenced this pull request Feb 15, 2025
srcDir: async () => {
return text({
message: 'Where should VitePress look for your markdown files?',
initialValue: './'
Copy link
Member

Choose a reason for hiding this comment

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

I think this should default to root, and should be resolved relative to cwd. srcDir is resolved relative to root, but I think this is a question and should be answered relative to current context.

this looks weird:

image

@alvinometric
Copy link

@Barbapapazes @brc-dd should there be another issue to document it?

@brc-dd
Copy link
Member

brc-dd commented Feb 18, 2025

document what exactly?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants