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

Bootstrap repo copied to out directory #34

Open
jmjf opened this issue Jul 4, 2015 · 0 comments
Open

Bootstrap repo copied to out directory #34

jmjf opened this issue Jul 4, 2015 · 0 comments

Comments

@jmjf
Copy link

jmjf commented Jul 4, 2015

If the Bootstrap repo is in static or files, the entire repo gets copied to the out directory. This wastes space and time (about 90 seconds per generate for me) and is generally not a good idea.

Workaround 1

mkdir src/norender
mv src/files/vendor src/norender
cp src/norender/vendor/twitter-bootstrap/dist/fonts/* src/files/fonts
cp src/norender/vendor/twitter-bootstrap/dist/js/bootstrap.min.js src/files/scripts

Edit src/documents/styles/twitter-bootstrap.css.less to import from ../../norender/vendor instead of ../../files/vendor

Workaround 2

mkdir src/norender
mv src/files/vendor src/norender

Use docpad-plugin-copy (npm) to copy font and js files. (untested)

Based on the README, add something like this to docpad.coffee

plugins:
    copy:
        boostrap-fonts:
            src: 'norender/vendor/twitter-bootstrap/dist/fonts'
            out: 'fonts'
        bootstrap-js:
            src: 'norender/vendor/twitter-bootstrap/dist/js'
            out: 'scripts'

I looked at docpad-plugin-raw but it does not seem to support the customized output folder required--unless you want to use the command option.

I haven't tested the last part of Workaround 2 yet. It does offer the advantage of keeping the Bootstrap fonts and js current if you update Bootstrap.

Some sites don't need all the Bootstrap js features. A better workaround would be on that can customize bootstrap.min.js to include only the necessary js files.

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

No branches or pull requests

1 participant