-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Allow inserting file, bypassing rendering #1551
Comments
Thanks for the info. I see you closed this. .RawContent isn't in v0.14, so I can't use it. |
Well, any new suggested features wouldn't be in 0.14 either. Raw content include is, kind of, already covered by the Exec issue and pull request. But I'll reopen this to keep track of it. Someone may make a cross platform "cat file" feature. |
|
I think that enhancing the partial functionality is the way to go. Allow pulling in different content types from a range of locations. Could open the way to future innovation |
Is this resolved now with the release of 0.15? |
I'd also like to know if this is resolved with 0.15 |
No. |
With your kind permission, I'd like to expand on why this is a valuable addition IMHO:
|
This also includes a refactor of the hugofs package and its usage. The motivation for that is: The Afero filesystems are brilliant. Hugo's way of adding a dozen of global variables for the different filesystems was a mistake. In readFile (and also in some other places in Hugo today) we need a way to restrict the access inside the working dir. We could use ioutil.ReadFile and implement the path checking, checking the base path and the dots ("..") etc. But it is obviously better to use an Afero BasePathFs combined witha ReadOnlyFs. We could create a use-once-filesystem and handle the initialization ourselves, but since this is also useful to others and the initialization depends on some other global state (which would mean to create a new file system on every invocation), we might as well do it properly and encapsulate the predefined set of filesystems. This change also leads the way, if needed, to encapsulate the file systems in a struct, making it possible to have several file system sets in action at once (parallel multilanguage site building? With Moore's law and all...) Fixes gohugoio#1551
I'm having trouble understanding this. Could you kindly provide some non-technical documentation with an example of how to use this? |
Use https://discuss.gohugo.io/ for questions. |
This also includes a refactor of the hugofs package and its usage. The motivation for that is: The Afero filesystems are brilliant. Hugo's way of adding a dozen of global variables for the different filesystems was a mistake. In readFile (and also in some other places in Hugo today) we need a way to restrict the access inside the working dir. We could use ioutil.ReadFile and implement the path checking, checking the base path and the dots ("..") etc. But it is obviously better to use an Afero BasePathFs combined witha ReadOnlyFs. We could create a use-once-filesystem and handle the initialization ourselves, but since this is also useful to others and the initialization depends on some other global state (which would mean to create a new file system on every invocation), we might as well do it properly and encapsulate the predefined set of filesystems. This change also leads the way, if needed, to encapsulate the file systems in a struct, making it possible to have several file system sets in action at once (parallel multilanguage site building? With Moore's law and all...) Fixes gohugoio#1551
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
See my post on incorporating remark.js.
It required pulling in a markdown file without hugo rendering it (remark does the rendering). I had to trick hugo by placing the md file in the partials directory and pulling it in from there as a partial. But why sneak in the back door? The capability of pulling other files in could be useful in many situations.
The text was updated successfully, but these errors were encountered: