-
Notifications
You must be signed in to change notification settings - Fork 342
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
Request: asset folder helper #293
Comments
Hey there, There’s a discussion on that here #149, so I am going to close this issue in favour of that, but here’s how you should be able to take care of it. The easiest solution is to leave the |
I'm sorry you totally missed my point. Maybe I explained it very badly though :( My issue is with assets like css and images. Imagine a So if I'm using Do you copy? |
@JSteunou I am on board with this feature request. What I think we should do is put together a list of possible solutions and go from there. |
Sorry @JSteunou, my mistake. @sintaxi I have a pull request open on Terraform that includes one possible solution, but we discussed it and suggested a broader URL helper would be better. I documented that there, but the gist of it is that I added this: link(href="#{ current.base }css/main.css" rel="stylesheet") But in the end we leaned towards this being more versatile: link(href=url("css/main.css") rel="stylesheet") |
+1 for an |
+100, Just yesterday, I had to manually resolve every img, js, and css tag when compiling as I develop using harp yet deploy to S3. |
This is one of the first things I ran into with Harp, so, +1000. |
Instead of having an helper, can relative urls be resolved automatically at compilation? For example, if a .md file is rendered using a layout 2 folders up, scan this layout to transform urls adding |
My temporary solution to the problem is to assign path variables in harp.json. i.e ("articles_path": "../../", "archived_articles": "../../../", etc) |
+1000 to this also. One possible solution that almost works is to use wget to fetch the whole site and
If you have Obviously, having |
Hi I was wondering if there is any progress on this issue as we're facing the same issue? |
Hi. Has there been any update on this? Just started with Harp, and ran into this issue right away. Thanks |
Hello! +1 for url helper or a layout rule inside the compile for building it's relative paths. I'm also trying to use harp to build my static page on Github Pages & stuck with this issue. Kex |
What's the status on this? It would be really helpful with a {{root}} helper like in Zurb's Panini |
Hi, is there any way to avoid this construct? Thank you! |
@allergeek IIRC you can use and absolute path so |
@sintaxi Thanx! I'm not sure why, but unfortunately it doesn't work for me. Do you think it's on the EJS part? I've seen a workaround with current.path, that renders a url for the proper environment. Checking just in case there's a simpler fix. |
Oh crap, my bad. |
Harpjs have an option to compile a project but does not transform assets path into correct relative path, which mean we have to have a webserver in order to view our compiled project.
It happens when you have articles, or posts within subfolders but with the main layout which is in root folder.
It could be nice to have a config option to set a public path in global var, but also tell harp to handle it as absolute or relative so it works flawless as server and as static.
The main idea behind that came when I start to write some documentation with Harpjs, but could not send a static copy by mail that could be read as it is.
The text was updated successfully, but these errors were encountered: