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

Static file default paths #35

Closed
davidhunterxyz opened this issue Dec 12, 2015 · 5 comments
Closed

Static file default paths #35

davidhunterxyz opened this issue Dec 12, 2015 · 5 comments

Comments

@davidhunterxyz
Copy link
Member

The default path for static files are at example.com/static/styles/app.css. Maybe it should be at root directory example.com/styles/app.css.

If someone adds a robots.txt file in the static folder it would be at example.com/static/robots.txt. I read that the robots.txt file should be at root example.com/robots.txt

I also think it would be nice to follow twitter bootstrap and html5 boilerplate naming of javascript and css folders. They use /css/main.css and /js/main.js

@ghost ghost added this to the v0.0.2 milestone Dec 12, 2015
@ghost
Copy link

ghost commented Dec 12, 2015

The default path for static files are at example.com/static/styles/app.css. Maybe it should be at root directory example.com/styles/app.css.

The static prefix is there to avoid collisions of action paths and static file paths. Though, I agree with your argument about robots.txt. How is this implemented in other frameworks?

I also think it would be nice to follow twitter bootstrap and html5 boilerplate naming of javascript and css folders. They use /css/main.css and /js/main.js

It's just a matter of taste isn't it? E.g. semantic-ui uses /javascript and /stylesheets for their site. My own preference is styles, fonts, images, and scripts over css, ???, img, and js because of other directory names that are used for the project. E.g.

  • controllers but not ctrl
  • models but not mdl
  • config but not cfg or ini

In my opinion it would be not consistent to use full names for controllers, models, etc. but shortenings and abbreviations for img, js and so forth.

@davidhunterxyz
Copy link
Member Author

I agree with the naming. I just thought it will be easier for new developers to be able to just copy and paste the files from bootstrap and html5 boilerplate.

With rails they have a folder called public where they put their static files and the route is at root which will work the correct way with a robots.txt file

They use dedicated folders for stylesheets, javascript, and images. Rails automatically creates the links to files in stylesheets and javascript folder. They also have a feature called asset pipeline which merges the stylesheets and javascript files into one file. The route for javascript, stylesheets, and images are at example.com/assets

A feature like Asset Pipeline would be nice for Goal

@davidhunterxyz
Copy link
Member Author

Maybe we can have the static path route to root and add a folder called assets to the static folder and have paths like www.example.com/assets/styles, www.example.com/assets/fonts, www.example.com/assets/images, and www.example.com/assets/scripts. The rest of files in root static folder like a robots.txt will have a path like www.example.com/robots.txt

@ghost
Copy link

ghost commented Feb 13, 2016

@Davidhunter Support of a tool for merging static assets is not the highest priority right now (third party ones from JS or Ruby world still can be used).
As for the static/assets directory, 👍. I like this idea.

@ghost ghost closed this as completed in 5c76758 Feb 14, 2016
@ghost
Copy link

ghost commented Feb 14, 2016

@Davidhunter Thanks, done.

ghost pushed a commit that referenced this issue Dec 17, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant