Ask coding questions

← Back to all posts
[Poll] Is it better to use /views, /pages, or /docs for HTML files?
h
Vandesm14 (754)

If you have the following file structure:

/public
    /js
        script.js
    /css
        style.css
    /(views, pages, docs?)
        index.html

What is the best name for the HTML folder? (no, don't make it "html")

Answered by TheDrone7 (565) [earned 5 cycles]
View Answer
Commentshotnewtop
TheDrone7 (565)

It depends in my case. If I am using a templating engine, I put them under 2 folders namely templates and views. When I'm not using templating engines, I put them directly under my static folder.
Also, when using nuxtjs, I have to use .vue files which I put under the pages directory as nuxt asks me to.

In my opinion just choose what seems most appropriate to you.
(Although docs won't be a meaningful name for this purpose in my personal opinion).