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

Add support for content as modules #5973

Closed
bep opened this issue May 18, 2019 · 6 comments

Comments

@bep
Copy link
Member

commented May 18, 2019

This ties into #5911 and #5074 and isn't something we will solve "today", but I jott it down here so we can ... think about it.

A Hugo Component can currently provide this:

archetypes
assets
data
i18n
layouts
resources
static

A quick and naive approach would be to add content to that list, but there are language configuration and the work coming in #5074 ... And the reason it's not there is that we (or I) do not want themes to provide content. Themes provide look and feel, I provide the prose.

It would, however, obviously be great if I as an enterprise documentation project owner could compose my content from versioned "content components" (partitioned by language or some other topic) so I could say:

content = ["github.com/bep/mytechcontent", "github.com/bep/jokes"]

There are some obvious missing pieces in the above (language, mapping to some section etc. and all the things coming in #5074 ).

/cc @regisphilibert @onedrawingperday and gang

@bep bep added the Enhancement label May 18, 2019

@bep bep added this to the v0.56 milestone May 18, 2019

@bep bep added the Proposal label May 18, 2019

@larzza

This comment has been minimized.

Copy link

commented May 18, 2019

This is crazy. I have been thinking about the exact same thing this afternoon, but you beat me to it! 😊 (...that must mean it is the correct approach!)

What I would like is to let a content provider just write content (no frontmatter) in a file hierarchy, for example in a markdown editor, i.e no technical stuff at all. Commit to git and thats it. Yeah, that’s more to it, but maybe it fits with the issue about getting content from other endpoints. (Now I seen you mentioned that issue above #5074)

I don’t think content should be a theme component but an own module type (as you also seem to think). This separates content from site and theme in a nice way.

@regisphilibert

This comment has been minimized.

Copy link

commented May 19, 2019

For languages, I suppose each language could have, if needed, its own set of content modules just like they can currently have have their own directory.

@zivbk1

This comment has been minimized.

Copy link
Contributor

commented May 21, 2019

Reminds me of the Antora playbook. https://docs.antora.org/antora/2.0/playbook/

@bep

This comment has been minimized.

Copy link
Member Author

commented May 21, 2019

@zivbk1 yes, I actually stumbled upon a YouTube presentation on Antora some days ago (but probably after I created this particular issue ... :-).

I think the big difference between this and that is that this is a versioned graph. Playbook looks líke a "flat thing" with manual versioning -- I guess you could do nesting, there, too with submodules, but I think that will get hard to manage as it grows.

@zivbk1

This comment has been minimized.

Copy link
Contributor

commented May 21, 2019

@bep I'm not sure what you mean by 'this is a versioned graph' and Antora would use manual versioning.

Here is how you specify the content sources to pull from and the content version (branches/tags) to include for each content source. https://docs.antora.org/antora/2.0/playbook/configure-content-sources/

You could point to master branch and always pull the latest, but you can also pull from specific branches/tags in that repository to allow for the user to select previous (or future/dev) versions of the content to view in the same site UI.

@bep

This comment has been minimized.

Copy link
Member Author

commented May 21, 2019

@zivbk1 what I mean is that it's a fairly shallow graph (one level) and by "manual versioning" I mean that you need to be fairly explicit when you tell what you want (give me v.1.3.2) and you don't have some of the auto-version-resolution you get in more complex dependency managers. Which is fine for the one-level scenario, but when you introduce transitive dependencies it gets much harder to reason about without help.

bep added a commit that referenced this issue Jun 3, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940

bep added a commit that referenced this issue Jun 10, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940

bep added a commit that referenced this issue Jun 10, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940

bep added a commit that referenced this issue Jun 10, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940

bep added a commit that referenced this issue Jun 11, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940

bep added a commit that referenced this issue Jun 16, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940

bep added a commit that referenced this issue Jun 18, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940

bep added a commit that referenced this issue Jun 18, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940

bep added a commit that referenced this issue Jun 20, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940

bep added a commit that referenced this issue Jun 21, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940

bep added a commit that referenced this issue Jun 26, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940

bep added a commit that referenced this issue Jun 26, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940

bep added a commit that referenced this issue Jun 28, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940

bep added a commit that referenced this issue Jul 3, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940

bep added a commit that referenced this issue Jul 5, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940

bep added a commit that referenced this issue Jul 6, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940
Fixes #6074

bep added a commit that referenced this issue Jul 10, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940
Fixes #6074
Fixes #6082

bep added a commit that referenced this issue Jul 10, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940
Fixes #6074
Fixes #6082

bep added a commit that referenced this issue Jul 17, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940
Fixes #6074
Fixes #6082

bep added a commit that referenced this issue Jul 19, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940
Fixes #6074
Fixes #6082
Fixes #6092

bep added a commit that referenced this issue Jul 21, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940
Fixes #6074
Fixes #6082
Fixes #6092

bep added a commit that referenced this issue Jul 22, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940
Fixes #6074
Fixes #6082
Fixes #6092

bep added a commit that referenced this issue Jul 23, 2019

Add Hugo Modules
Fixes #5973
Fixes #5996
Fixes #6010
Fixes #5911
Fixes #5940
Fixes #6074
Fixes #6082
Fixes #6092

bep added a commit that referenced this issue Jul 24, 2019

Add Hugo Modules
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

bep added a commit that referenced this issue Jul 24, 2019

Add Hugo Modules
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

bep added a commit that referenced this issue Jul 24, 2019

Add Hugo Modules
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

bep added a commit that referenced this issue Jul 24, 2019

Add Hugo Modules
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

@bep bep closed this in #5960 Jul 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.