-
Notifications
You must be signed in to change notification settings - Fork 343
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
Expose current page source file extension to layout #148
Comments
I don't think this is a documentation issue. It's a feature request for exposing the source filename via The motivation for this feature request is to enable referencing the source file in the page output. I used this on my previous blog to provide generic "edit" and "view source" links, but this is not possible with Harp currently. This would be a simple change to make, but I would want to get support from the core team for a particular change in the interface before submitting a pull request. Suggestions:
|
Thanks for following up on this. We had talked about link(href="#{current.base}css/application.css" type="text/css" rel="stylesheet") which wouldn’t render as anything in the root, and would render as For the extension, we had been suggesting you hard code these in if you need them since it’s related to your directory structure and to using I do think it could be worthwhile, but not as part of What do you think, @sintaxi? |
I think the discussion in #47 is about providing the site's base URL path as a global, so that eg you could deploy to Are you suggesting that I should hard code the source file extension in the metadata for each document? That seems error prone given that the information is available at compile time. |
Yeah, sorry, my whole comment is pretty much a write off. I was thinking about the output rather than the input. I do think |
Following up on this too. I'd like to see the I'm after the source filename for the exact same reason, so that I can dynamically link up my rendered pages to a github repo to allow viewers to edit (or at least point them that way). (I also suspect, though through checking - can't quite be sure - that this might be in terraform rather than this project). |
@remy yeah, the change would be around https://github.com/sintaxi/terraform/blob/master/lib/helpers/raw.js#L286 |
@sintaxi would you be open to a PR against terraform to change this? Though I suspect it'll also require a change to a lot of the tests I've run across too. Equally, I'm not sure of the wider impact of this change - which might suggest a new property would make more sense? |
I know @silentrob and I both came across more cases where we’d like to see this. I don’t think adding this would necessarily break anything in use now, getting the API right probably be the most difficult part.
|
I'm porting a Jekyll blog to Harp, and one feature of the current site which I don't think is possible to do with Harp currently is the
edit this page
link, which goes to the source file in a web based editing interface (eg github or prose.io).current.path
gives me everything but the source extension.Any chance the source extension could be included in
current
somewhere? I recognize this breaks the abstraction somewhat, but I think that edit link is pretty useful.The text was updated successfully, but these errors were encountered: