vuejs / vuepress

đź“ť Minimalistic Vue-powered static site generator
https://vuepress.vuejs.org
MIT License
22.43k stars 4.79k forks source link

read from folders starting with dot (.) #1152

Open Sparkenstein opened 5 years ago

Sparkenstein commented 5 years ago

Feature request

What problem does this feature solve?

It will Include the folders starting with a dot to support verification process for 'letsencrypt' or 'certbot'.

detailed: letsencrypt gives free SSL certificates but it needs to verify the ownership of the domain by generating a code. we need to add that code inside a file on specific path on our site like:

code: abcdef
path: example.com/.well-known/acme-challenge/longfilename/

When certbot visits the above path it should get the code abcdef back.

What does the proposed API look like?

folders with following structures will be read

package.json
.vuepress (ignored)
   |__ config.js
.well-known (certbot folder, will be included)
   |__ acme-challenge
                |__ y8s88whhsiush
                            |__ README.md
blogs
   |__ other stuff

How should this be implemented in your opinion?

Current implementation does not read any folder starting with a dot at all. Infact only .vuepress should be ignored implicitly.

Are you willing to work on this yourself?**

If dev team thinks this is the valid use case (it IS in my case), and it should be fixed then I will.

meteorlxy commented 5 years ago

Put .well-known into .vuepress/public could be a better choice.

Btw, I think certbot verification is better to be done via http server.

Sparkenstein commented 5 years ago

@meteorlxy That's what I did as a temporary solution. Just an FYI, it requires the file named index.html and not README.md. Which is why I opened this issue/feature request.

Btw, I think certbot verification is better to be done via http server.

I don't understand. after building the static site with vuepress, we push it to server anyway, where certbot verifies it. are you suggesting something else? I am using gitlab pages with custom domain for my current site right now.

meteorlxy commented 5 years ago

@Sparkenstein Sorry for confusing you.

I just think that they should not be included in the source files of website. I'm not familiar with custom domain in gitlab pages (github pages will do it for you and do not have to worry about that), but taking it as a step of CI could be better.

Ignore me and just do anything you like :smile:

rwxrob commented 5 years ago

I don't suppose it is worth mentioning to this particular audience that any folder beginning with dot is invisible to the Mac Finder and Windows File Explorer (without additional configuration). I hit this recently just trying to upload an image from my site for a GitLab Group icon and had to move a copy of the file out just to see it.

screen shot 2019-01-20 at 12 56 12 pm

(no .vuepress visible)

I realize there are not-so-obvious solutions to this by changing workstation options to see hidden files, but if the target user base of VuePress includes mostly non-technical writers (such as the educators and students I work with) then I suggest using the well-thought out initial underscore popularized by Jekyll.

I completely understand the design decision just to start with a working directory of markdown and eliminate the ls noise, but in this case putting everything in doc is a much better design decision—especially since GitHub supports that out of the box.

By the way, having a nice clean root content directory with .vuepress hidden, is great until you realize the entire premise of that design decision is thwarted by having to put static content in .vuepress/public. Users are led to believe all the content is nice and visible until it isn't. This thread is a great example of this disconnect. In fact, it is substantial enough for me to abandon VuePress personally and move to a pandoc based build system (that and the enormous waste of having redundant JS versions of all pages as well as their static version).

Sparkenstein commented 5 years ago

I agree with @robmuh , I have faced this problem especially on mac. @meteorlxy The better solution here would be letting user define the configuration folder, and everything else is static site content. Ex:

$ vuepress build --root config/

Where config/ is just renamed .vuepress/ directory.