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

Move static assets into their own package #1311

Closed
tilgovi opened this issue Jul 15, 2014 · 0 comments · Fixed by #1325
Closed

Move static assets into their own package #1311

tilgovi opened this issue Jul 15, 2014 · 0 comments · Fixed by #1325
Milestone

Comments

@tilgovi
Copy link
Contributor

tilgovi commented Jul 15, 2014

Right now we serve static assets out of the root of our h package.

webassets.base_dir = h:

This causes us to hit an edge case in Pyramid: Pylons/pyramid#1377

That breaks static route generation for assets beginning with h:.

The workaround is to make a separate static directory, h/static, where all our assets live. This is a good idea anyway, as it means we can point nginx or any other proxy at that directory and have no fear that we might accidentally serve code or something else that we may not wish to.

@tilgovi tilgovi added this to the 2014-08-08 milestone Jul 15, 2014
tilgovi added a commit that referenced this issue Jul 18, 2014
There are a number of reasons to isolate the static assets into their
own directory.

- An edge case in Pyramid: Pylons/pyramid#1377
- Make serving them with a reverse proxy safer by ensuring that no code
  or configuration lives beneath the static directory
- Cleanliness

To avoid a big move happening shortly after this, also rename some of
the asset subdirectories to close #1317.

- js -> scripts
- css -> stylesheets
- lib -> scripts/vendor
- lib/images -> images
- browser/chrome/js/background.js -> browser/chrome/background.js
- browser/chrome/public/js/destroy.js -> browser/chrome/public/destroy.js

Finally, the locale directory was totally busted. The annotator.po file
included is the defualt locale, and it should have been .pot. Since it
includes only the default strings, there's no reason to serve it. I've
stripped it and we'll reinstate it correctly later.

Close #1311
tilgovi added a commit that referenced this issue Jul 18, 2014
There are a number of reasons to isolate the static assets into their
own directory.

- An edge case in Pyramid: Pylons/pyramid#1377
- Make serving them with a reverse proxy safer by ensuring that no code
  or configuration lives beneath the static directory
- Cleanliness

To avoid a big move happening shortly after this, also rename some of
the asset subdirectories to close #1317.

- js -> scripts
- css -> stylesheets
- lib -> scripts/vendor
- lib/images -> images
- browser/chrome/js/background.js -> browser/chrome/background.js
- browser/chrome/public/js/destroy.js -> browser/chrome/public/destroy.js

Finally, the locale directory was totally busted. The annotator.po file
included is the defualt locale, and it should have been .pot. Since it
includes only the default strings, there's no reason to serve it. I've
stripped it and we'll reinstate it correctly later.

Close #1311
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants