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

FLUID-5590: fixed style and script links in non root folder #41

Merged
merged 3 commits into from Mar 12, 2020

Conversation

sachin10101998
Copy link
Contributor

fixes FLUID-5590

@jobara
Copy link
Member

jobara commented Mar 11, 2020

@sachin10101998 thanks for looking into this. So I'm thinking that instead of duplicating the scripts and styles documents that we turn them back into eco files. Then in the partials we can take in a second parameter to pass in the base of the URL for the news pages. see: https://github.com/docpad/docpad-plugin-partials

Scripts template

<script src="<% @baseURL>lib/infusion/infusion-all.js"></script>
<script src="<% @baseURL>js/uio.js"></script>

In the post layout:

        <%- @partial('scripts', {baseURL: "..\"}) %>
        <%- @partial('styles', {baseURL: "..\"}) %>

There might be some refinement needed tot he above for performance, to avoid having to specify it on the baseURL on the default layouts, and etc. But this would avoid duplication.

@jobara
Copy link
Member

jobara commented Mar 11, 2020

And we should also make sure that this still works https://github.com/fluid-project/fluidproject.org/blob/master/src/files/js/uio.js

@sachin10101998
Copy link
Contributor Author

@jobara, updated the PR using the partials plugin. It's working perfectly and without duplication of scripts. Great fix.

@jobara jobara merged commit 96771c3 into fluid-project:master Mar 12, 2020
@jobara
Copy link
Member

jobara commented Mar 12, 2020

merged at 96771c3

@sachin10101998 sachin10101998 deleted the FLUID-5590 branch March 12, 2020 13:21
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 this pull request may close these issues.

None yet

2 participants