-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Add a way to remap/mount Hugo Components #6010
Comments
It would be single square brackets in But what does the first "scss" value imply. I understand that the second argument is probably where you want to clone the repo. |
May be this: [module]
[[imports]]
source_url = "github.com/twbs/bootstrap"
source_dir = "scss"
mount_point = "assets/bootstrap/scss" |
@kaushalmodi it's an array of tuples, so the syntax is correct. And this is not about "where to clone". There can be potentially many such mount points for a given import and this is just a way to set up Hugo's big virtual filesystem. In my example, you would be able to do:
|
@bep Do you mean ”no way to express that in” Hugo Modules ™ ;-) or in Hugos virtual FS or are you thinking of something else? Read the description once more and I guess you just mean what this issue is all about. |
I'm not sure about the question, but the above hasn't been specified/implemented and ergo not possible. But it's possible to implement, and it will be superuseful. So, what you get by default for a componet having a
The above is implicit and you don't have to define it. The value to the right must start with the predefined set of folders (assets, static ...) |
Yes, it will indeed be super usefull! But do you really mean this?
I would expect to be able to import what ever I want and mount it to one of the predefined destinations ”assets” etc... Given a repository with the directory
|
Yes, I meant that. Which is how you would create your Hugo Component from scratch, using that naming standard. This particular issue is about being able to use non-Hugo-components (aka Bootstrap). I will leave this discussion to others now; unless you find something obviously wrong with my syntax, I don't think we're going to take the whole module/imports/package discussion all over again. |
Hm, I wonder if you misunderstand me (and I you)? My example was only meant to explain what I was aiming at, not to suggest a different syntax. I understand that this is about Bootstrap and the like (which is something I really want as I think you remeber?). Bootstrap happens to have a subdirectory named scss, but that might not always be the case, thats why I suggested to be able to mount an arbitrary source to one of the predefined destinations handled by Hugo. To ”to take the whole module/imports/package discussion all over again.” is the last thing that I want. Yes, let’s leave the disussion to others. |
I don't have much to say. Looks lovely. And wouldn't it remove the use for #5973 now that we could
Ex:
Pardon the yaml above, I don't know what tuples are... |
@regisphilibert I suspect I don't think YAML supports arrays with more than one dimension, so we might as well do it like this:
With the above, we set aside room for additional metadata .... |
@bep This is what I tried to discuss yesterday when you seemed to disagree.
|
@larzza OK, I guess that pseudo syntax confused me ... Or maybe it was the cake :-) |
A note: I'm going to try to get [[module.imports.mounts]]
source="src/markdown/blog"
target="content/blog"
language="en" So, no language indicator in the paths (source, target), which means you can do pretty flexible remapping of any of your component type (content, static, layouts ...). The above example would put the content in the |
So if we add I presume without the key, all will be added? |
In all of this, I didn't get how you could point to particular release/tag of the given repo, when importing. |
No, all will be added, the
Hugo just wraps So most things in that document applies, including https://github.com/golang/go/wiki/Modules#version-selection When you import a module in From there there are several options: Update All
Update one
Etc. And from the example above it's a multi-module repo, updating only one of them. |
Sorry if my questions come bit late, I only recently found time to digest this. It seems the |
Wouldn't that fall into the responsability of the person building the module. If the remote content repo holds every languages seperated by directories, or by filename:
If the remote content repo holds only the english files without any lang info in the filename:
I understand we want to safegard users, but using a remote repo for content management means you're aware of how Hugo Mutlilingual work, or am I missing a use case here? |
Hugo Modules use Go modules under the hood so
|
@regisphilibert the content part here works (will work) exactly as content works today. So you can still do Go Modules is too big to discuss here. I can just say that I'm mostly very, very impressed by it. It is the dependency/management up until now that has impressed me the most.
No, at least not now, and I don't see it either.
You can import |
I guess it might not makes much sense to have support for different versions at once in the Hugo context anyway, or at least makes things a bit to complicated for the theme developer. |
This commit implements Hugo Modules. This is a broad subject, but some keywords include: * A new `module` configuration section where you can import almost anything. You can configure both your own file mounts nd the file mounts of the modules you import. This is the new recommended way of configuring what you earlier put in `configDir`, `staticDir` etc. And it also allows you to mount folders in non-Hugo-projects, e.g. the `SCSS` folder in the Bootstrap GitHub project. * A module consists of a set of mounts to the standard 7 component types in Hugo: `static`, `content`, `layouts`, `data`, `assets`, `i18n`, and `archetypes`. Yes, Theme Components can now include content, which should be very useful, especially in bigger multilingual projects. * Modules not in your local file cache will be downloaded automatically and even "hot replaced" while the server is running. * Hugo Modules supports and encourages semver versioned modules, and uses the minimal version selection algorithm to resolve versions. * A new set of CLI commands are provided to manage all of this: `hugo mod init`, `hugo mod get`, `hugo mod graph`, `hugo mod tidy`, and `hugo mod vendor`. All of the above is backed by Go Modules. Fixes #5973 Fixes #5996 Fixes #6010 Fixes #5911 Fixes #5940 Fixes #6074 Fixes #6082 Fixes #6092
This commit implements Hugo Modules. This is a broad subject, but some keywords include: * A new `module` configuration section where you can import almost anything. You can configure both your own file mounts nd the file mounts of the modules you import. This is the new recommended way of configuring what you earlier put in `configDir`, `staticDir` etc. And it also allows you to mount folders in non-Hugo-projects, e.g. the `SCSS` folder in the Bootstrap GitHub project. * A module consists of a set of mounts to the standard 7 component types in Hugo: `static`, `content`, `layouts`, `data`, `assets`, `i18n`, and `archetypes`. Yes, Theme Components can now include content, which should be very useful, especially in bigger multilingual projects. * Modules not in your local file cache will be downloaded automatically and even "hot replaced" while the server is running. * Hugo Modules supports and encourages semver versioned modules, and uses the minimal version selection algorithm to resolve versions. * A new set of CLI commands are provided to manage all of this: `hugo mod init`, `hugo mod get`, `hugo mod graph`, `hugo mod tidy`, and `hugo mod vendor`. All of the above is backed by Go Modules. Fixes #5973 Fixes #5996 Fixes #6010 Fixes #5911 Fixes #5940 Fixes #6074 Fixes #6082 Fixes #6092
This commit implements Hugo Modules. This is a broad subject, but some keywords include: * A new `module` configuration section where you can import almost anything. You can configure both your own file mounts nd the file mounts of the modules you import. This is the new recommended way of configuring what you earlier put in `configDir`, `staticDir` etc. And it also allows you to mount folders in non-Hugo-projects, e.g. the `SCSS` folder in the Bootstrap GitHub project. * A module consists of a set of mounts to the standard 7 component types in Hugo: `static`, `content`, `layouts`, `data`, `assets`, `i18n`, and `archetypes`. Yes, Theme Components can now include content, which should be very useful, especially in bigger multilingual projects. * Modules not in your local file cache will be downloaded automatically and even "hot replaced" while the server is running. * Hugo Modules supports and encourages semver versioned modules, and uses the minimal version selection algorithm to resolve versions. * A new set of CLI commands are provided to manage all of this: `hugo mod init`, `hugo mod get`, `hugo mod graph`, `hugo mod tidy`, and `hugo mod vendor`. All of the above is backed by Go Modules. Fixes #5973 Fixes #5996 Fixes #6010 Fixes #5911 Fixes #5940 Fixes #6074 Fixes #6082 Fixes #6092
This commit implements Hugo Modules. This is a broad subject, but some keywords include: * A new `module` configuration section where you can import almost anything. You can configure both your own file mounts nd the file mounts of the modules you import. This is the new recommended way of configuring what you earlier put in `configDir`, `staticDir` etc. And it also allows you to mount folders in non-Hugo-projects, e.g. the `SCSS` folder in the Bootstrap GitHub project. * A module consists of a set of mounts to the standard 7 component types in Hugo: `static`, `content`, `layouts`, `data`, `assets`, `i18n`, and `archetypes`. Yes, Theme Components can now include content, which should be very useful, especially in bigger multilingual projects. * Modules not in your local file cache will be downloaded automatically and even "hot replaced" while the server is running. * Hugo Modules supports and encourages semver versioned modules, and uses the minimal version selection algorithm to resolve versions. * A new set of CLI commands are provided to manage all of this: `hugo mod init`, `hugo mod get`, `hugo mod graph`, `hugo mod tidy`, and `hugo mod vendor`. All of the above is backed by Go Modules. Fixes #5973 Fixes #5996 Fixes #6010 Fixes #5911 Fixes #5940 Fixes #6074 Fixes #6082 Fixes #6092
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. |
Related to #5996 etc.
A Hugo Component has a fixed set of folders where the folder tells Hugo how to deal with it (layouts, static, assets)...
With the upcoming Hugo Modules ™ it becomes very easy to import components stored in GitHub repos etc. by simply importing them.
We require very little for a repo to become importable:
config.toml
.So, if I wanted to import
Bootstrap
as aSCSS
module, I would want https://github.com/twbs/bootstrap/tree/master/scss mounted below/assets
.There is currently no way to express that, but it would be really useful if we could.
Something ala:
I can add to this that there will be a default mount list if not set above (static, assets ...), and for vendoring purposes we will stick to that list, which is a great way to just filter what you need from a dependency..
/cc @regisphilibert @kaushalmodi @moorereason @onedrawingperday @digitalcraftsman and gang.
The text was updated successfully, but these errors were encountered: