-
Notifications
You must be signed in to change notification settings - Fork 705
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
useref and Github Pages relative links #671
Comments
Hi, just use relative urls like these: <!-- build:js scripts/main.js -->
<script src="/node_modules/jquery/dist/jquery.js"></script>
<script src="/node_modules/tether/dist/js/tether.js"></script>
<script src="scripts/main.js"></script>
<!-- endbuild --> |
That only works if I have a flat hierarchy of pages rooted at If I have this in |
Use absolute urls which include project name. E.g. <!-- build:js /project-x/scripts/main.js -->
<script src="/node_modules/jquery/dist/jquery.js"></script>
<script src="/node_modules/tether/dist/js/tether.js"></script>
<script src="scripts/main.js"></script>
<!-- endbuild --> |
That doesn't work either. That will drop the files under |
You should concatanate all files into single or maybe more files which will be in <!-- build:js /project-x/scripts/main.js -->
<script src="/node_modules/jquery/dist/jquery.js"></script>
<script src="/node_modules/tether/dist/js/tether.js"></script>
<script src="scripts/main.js"></script>
<!-- endbuild --> Github Pages root should be the |
How might I modify the webapp gulp script to do this? It's already doing the useref and minification in the HTML task. The GitHub Pages deploy recipe doesn't make a mention. |
I assume that this bug was fixed in #737. If not we can re-open it again 😃 |
I opened an issue with gulp-useref but looking at their issue queue, I don't expect they will be responding anytime soon. I am using the webapp generator and I ran into an issue when trying to deploy to a Github Page and linking my assets.
So I have been learning gulp and working to deploy to a Github Page, so I setup the build reference like this:
Github Pages need to be linked like "/project/scripts/foo.js" because "/" is
https://user.github.io
but I need the name of the project in the URL.The above useref comment will write the combined.js to the
dist/project/scripts/
folder. However, the dist folder typically represents the document root of the github page, so I actually need the file underdist/scripts/
and the link to be/project/scripts/combined.js
. In order to deploy the dist folder to the gh-pages branch, I have to move the files indist/project/
up to justdist
. This feels clunky.To complicate matters, I'm using Pug, so I have 1 layout template that has these links. Relative linking within the individual Pug file might be possible, but I'm not sure exactly what that would look like.
How would I accomplish this?
The text was updated successfully, but these errors were encountered: