2019-01-02 06:33:26 -05:00
|
|
|
// Copyright 2019 The Hugo Authors. All rights reserved.
|
2017-08-17 04:24:17 -04:00
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
2019-01-02 06:33:26 -05:00
|
|
|
package page
|
2018-02-22 03:15:12 -05:00
|
|
|
|
2019-01-02 06:33:26 -05:00
|
|
|
import (
|
|
|
|
"html/template"
|
|
|
|
"time"
|
|
|
|
|
2019-11-21 15:59:38 -05:00
|
|
|
"github.com/gohugoio/hugo/common/maps"
|
2023-01-04 12:24:36 -05:00
|
|
|
"github.com/gohugoio/hugo/config/privacy"
|
|
|
|
"github.com/gohugoio/hugo/config/services"
|
2023-01-24 14:57:15 -05:00
|
|
|
"github.com/gohugoio/hugo/identity"
|
2019-11-21 15:59:38 -05:00
|
|
|
|
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
2019-05-03 03:16:58 -04:00
|
|
|
"github.com/gohugoio/hugo/config"
|
|
|
|
|
2019-01-02 06:33:26 -05:00
|
|
|
"github.com/gohugoio/hugo/common/hugo"
|
|
|
|
"github.com/gohugoio/hugo/langs"
|
|
|
|
"github.com/gohugoio/hugo/navigation"
|
|
|
|
)
|
2017-08-17 04:24:17 -04:00
|
|
|
|
2024-02-11 06:51:33 -05:00
|
|
|
// Site represents a site. There can be multiple sites in a multilingual setup.
|
2018-11-26 04:11:22 -05:00
|
|
|
type Site interface {
|
2022-04-21 04:59:13 -04:00
|
|
|
// Returns the Language configured for this Site.
|
2018-11-26 04:11:22 -05:00
|
|
|
Language() *langs.Language
|
2022-04-21 04:59:13 -04:00
|
|
|
|
2023-05-17 07:12:49 -04:00
|
|
|
// Returns all the languages configured for all sites.
|
|
|
|
Languages() langs.Languages
|
|
|
|
|
2023-01-04 12:24:36 -05:00
|
|
|
GetPage(ref ...string) (Page, error)
|
|
|
|
|
2023-05-17 03:59:57 -04:00
|
|
|
// AllPages returns all pages for all languages.
|
|
|
|
AllPages() Pages
|
|
|
|
|
2022-04-21 04:59:13 -04:00
|
|
|
// Returns all the regular Pages in this Site.
|
2019-01-02 06:33:26 -05:00
|
|
|
RegularPages() Pages
|
2022-04-21 04:59:13 -04:00
|
|
|
|
|
|
|
// Returns all Pages in this Site.
|
2019-01-02 06:33:26 -05:00
|
|
|
Pages() Pages
|
2022-04-21 04:59:13 -04:00
|
|
|
|
2023-05-16 12:53:34 -04:00
|
|
|
// Returns all the top level sections.
|
|
|
|
Sections() Pages
|
|
|
|
|
2023-01-04 12:24:36 -05:00
|
|
|
// A shortcut to the home
|
2022-02-17 07:04:00 -05:00
|
|
|
Home() Page
|
2022-04-21 04:59:13 -04:00
|
|
|
|
2024-03-09 14:21:46 -05:00
|
|
|
// Deprecated: Use hugo.IsServer instead.
|
2018-11-26 04:11:22 -05:00
|
|
|
IsServer() bool
|
2022-04-21 04:59:13 -04:00
|
|
|
|
|
|
|
// Returns the server port.
|
2019-01-02 06:33:26 -05:00
|
|
|
ServerPort() int
|
2022-04-21 04:59:13 -04:00
|
|
|
|
|
|
|
// Returns the configured title for this Site.
|
2019-01-02 06:33:26 -05:00
|
|
|
Title() string
|
2022-04-21 04:59:13 -04:00
|
|
|
|
2023-05-27 09:44:41 -04:00
|
|
|
// Deprecated: Use .Language.LanguageCode instead.
|
2023-01-04 12:24:36 -05:00
|
|
|
LanguageCode() string
|
|
|
|
|
|
|
|
// Returns the configured copyright information for this Site.
|
|
|
|
Copyright() string
|
|
|
|
|
2022-04-21 04:59:13 -04:00
|
|
|
// Returns all Sites for all languages.
|
2019-01-02 06:33:26 -05:00
|
|
|
Sites() Sites
|
2022-04-21 04:59:13 -04:00
|
|
|
|
|
|
|
// Returns Site currently rendering.
|
2022-04-05 03:57:58 -04:00
|
|
|
Current() Site
|
2022-04-21 04:59:13 -04:00
|
|
|
|
|
|
|
// Returns a struct with some information about the build.
|
2023-01-04 12:24:36 -05:00
|
|
|
Hugo() hugo.HugoInfo
|
2022-04-21 04:59:13 -04:00
|
|
|
|
|
|
|
// Returns the BaseURL for this Site.
|
2023-10-30 04:07:03 -04:00
|
|
|
BaseURL() string
|
2022-04-21 04:59:13 -04:00
|
|
|
|
2023-02-18 15:47:35 -05:00
|
|
|
// Returns a taxonomy map.
|
2022-12-30 03:20:58 -05:00
|
|
|
Taxonomies() TaxonomyList
|
2022-04-21 04:59:13 -04:00
|
|
|
|
all: Rework page store, add a dynacache, improve partial rebuilds, and some general spring cleaning
There are some breaking changes in this commit, see #11455.
Closes #11455
Closes #11549
This fixes a set of bugs (see issue list) and it is also paying some technical debt accumulated over the years. We now build with Staticcheck enabled in the CI build.
The performance should be about the same as before for regular sized Hugo sites, but it should perform and scale much better to larger data sets, as objects that uses lots of memory (e.g. rendered Markdown, big JSON files read into maps with transform.Unmarshal etc.) will now get automatically garbage collected if needed. Performance on partial rebuilds when running the server in fast render mode should be the same, but the change detection should be much more accurate.
A list of the notable new features:
* A new dependency tracker that covers (almost) all of Hugo's API and is used to do fine grained partial rebuilds when running the server.
* A new and simpler tree document store which allows fast lookups and prefix-walking in all dimensions (e.g. language) concurrently.
* You can now configure an upper memory limit allowing for much larger data sets and/or running on lower specced PCs.
We have lifted the "no resources in sub folders" restriction for branch bundles (e.g. sections).
Memory Limit
* Hugos will, by default, set aside a quarter of the total system memory, but you can set this via the OS environment variable HUGO_MEMORYLIMIT (in gigabytes). This is backed by a partitioned LRU cache used throughout Hugo. A cache that gets dynamically resized in low memory situations, allowing Go's Garbage Collector to free the memory.
New Dependency Tracker: Hugo has had a rule based coarse grained approach to server rebuilds that has worked mostly pretty well, but there have been some surprises (e.g. stale content). This is now revamped with a new dependency tracker that can quickly calculate the delta given a changed resource (e.g. a content file, template, JS file etc.). This handles transitive relations, e.g. $page -> js.Build -> JS import, or $page1.Content -> render hook -> site.GetPage -> $page2.Title, or $page1.Content -> shortcode -> partial -> site.RegularPages -> $page2.Content -> shortcode ..., and should also handle changes to aggregated values (e.g. site.Lastmod) effectively.
This covers all of Hugo's API with 2 known exceptions (a list that may not be fully exhaustive):
Changes to files loaded with template func os.ReadFile may not be handled correctly. We recommend loading resources with resources.Get
Changes to Hugo objects (e.g. Page) passed in the template context to lang.Translate may not be detected correctly. We recommend having simple i18n templates without too much data context passed in other than simple types such as strings and numbers.
Note that the cachebuster configuration (when A changes then rebuild B) works well with the above, but we recommend that you revise that configuration, as it in most situations should not be needed. One example where it is still needed is with TailwindCSS and using changes to hugo_stats.json to trigger new CSS rebuilds.
Document Store: Previously, a little simplified, we split the document store (where we store pages and resources) in a tree per language. This worked pretty well, but the structure made some operations harder than they needed to be. We have now restructured it into one Radix tree for all languages. Internally the language is considered to be a dimension of that tree, and the tree can be viewed in all dimensions concurrently. This makes some operations re. language simpler (e.g. finding translations is just a slice range), but the idea is that it should also be relatively inexpensive to add more dimensions if needed (e.g. role).
Fixes #10169
Fixes #10364
Fixes #10482
Fixes #10630
Fixes #10656
Fixes #10694
Fixes #10918
Fixes #11262
Fixes #11439
Fixes #11453
Fixes #11457
Fixes #11466
Fixes #11540
Fixes #11551
Fixes #11556
Fixes #11654
Fixes #11661
Fixes #11663
Fixes #11664
Fixes #11669
Fixes #11671
Fixes #11807
Fixes #11808
Fixes #11809
Fixes #11815
Fixes #11840
Fixes #11853
Fixes #11860
Fixes #11883
Fixes #11904
Fixes #7388
Fixes #7425
Fixes #7436
Fixes #7544
Fixes #7882
Fixes #7960
Fixes #8255
Fixes #8307
Fixes #8863
Fixes #8927
Fixes #9192
Fixes #9324
2023-12-24 13:11:05 -05:00
|
|
|
// Deprecated: Use .Lastmod instead.
|
2019-01-02 06:33:26 -05:00
|
|
|
LastChange() time.Time
|
2022-04-21 04:59:13 -04:00
|
|
|
|
all: Rework page store, add a dynacache, improve partial rebuilds, and some general spring cleaning
There are some breaking changes in this commit, see #11455.
Closes #11455
Closes #11549
This fixes a set of bugs (see issue list) and it is also paying some technical debt accumulated over the years. We now build with Staticcheck enabled in the CI build.
The performance should be about the same as before for regular sized Hugo sites, but it should perform and scale much better to larger data sets, as objects that uses lots of memory (e.g. rendered Markdown, big JSON files read into maps with transform.Unmarshal etc.) will now get automatically garbage collected if needed. Performance on partial rebuilds when running the server in fast render mode should be the same, but the change detection should be much more accurate.
A list of the notable new features:
* A new dependency tracker that covers (almost) all of Hugo's API and is used to do fine grained partial rebuilds when running the server.
* A new and simpler tree document store which allows fast lookups and prefix-walking in all dimensions (e.g. language) concurrently.
* You can now configure an upper memory limit allowing for much larger data sets and/or running on lower specced PCs.
We have lifted the "no resources in sub folders" restriction for branch bundles (e.g. sections).
Memory Limit
* Hugos will, by default, set aside a quarter of the total system memory, but you can set this via the OS environment variable HUGO_MEMORYLIMIT (in gigabytes). This is backed by a partitioned LRU cache used throughout Hugo. A cache that gets dynamically resized in low memory situations, allowing Go's Garbage Collector to free the memory.
New Dependency Tracker: Hugo has had a rule based coarse grained approach to server rebuilds that has worked mostly pretty well, but there have been some surprises (e.g. stale content). This is now revamped with a new dependency tracker that can quickly calculate the delta given a changed resource (e.g. a content file, template, JS file etc.). This handles transitive relations, e.g. $page -> js.Build -> JS import, or $page1.Content -> render hook -> site.GetPage -> $page2.Title, or $page1.Content -> shortcode -> partial -> site.RegularPages -> $page2.Content -> shortcode ..., and should also handle changes to aggregated values (e.g. site.Lastmod) effectively.
This covers all of Hugo's API with 2 known exceptions (a list that may not be fully exhaustive):
Changes to files loaded with template func os.ReadFile may not be handled correctly. We recommend loading resources with resources.Get
Changes to Hugo objects (e.g. Page) passed in the template context to lang.Translate may not be detected correctly. We recommend having simple i18n templates without too much data context passed in other than simple types such as strings and numbers.
Note that the cachebuster configuration (when A changes then rebuild B) works well with the above, but we recommend that you revise that configuration, as it in most situations should not be needed. One example where it is still needed is with TailwindCSS and using changes to hugo_stats.json to trigger new CSS rebuilds.
Document Store: Previously, a little simplified, we split the document store (where we store pages and resources) in a tree per language. This worked pretty well, but the structure made some operations harder than they needed to be. We have now restructured it into one Radix tree for all languages. Internally the language is considered to be a dimension of that tree, and the tree can be viewed in all dimensions concurrently. This makes some operations re. language simpler (e.g. finding translations is just a slice range), but the idea is that it should also be relatively inexpensive to add more dimensions if needed (e.g. role).
Fixes #10169
Fixes #10364
Fixes #10482
Fixes #10630
Fixes #10656
Fixes #10694
Fixes #10918
Fixes #11262
Fixes #11439
Fixes #11453
Fixes #11457
Fixes #11466
Fixes #11540
Fixes #11551
Fixes #11556
Fixes #11654
Fixes #11661
Fixes #11663
Fixes #11664
Fixes #11669
Fixes #11671
Fixes #11807
Fixes #11808
Fixes #11809
Fixes #11815
Fixes #11840
Fixes #11853
Fixes #11860
Fixes #11883
Fixes #11904
Fixes #7388
Fixes #7425
Fixes #7436
Fixes #7544
Fixes #7882
Fixes #7960
Fixes #8255
Fixes #8307
Fixes #8863
Fixes #8927
Fixes #9192
Fixes #9324
2023-12-24 13:11:05 -05:00
|
|
|
// Returns the last modification date of the content.
|
|
|
|
Lastmod() time.Time
|
|
|
|
|
2022-04-21 04:59:13 -04:00
|
|
|
// Returns the Menus for this site.
|
2019-01-02 06:33:26 -05:00
|
|
|
Menus() navigation.Menus
|
2022-04-21 04:59:13 -04:00
|
|
|
|
2023-01-04 12:24:36 -05:00
|
|
|
// The main sections in the site.
|
|
|
|
MainSections() []string
|
|
|
|
|
2022-04-21 04:59:13 -04:00
|
|
|
// Returns the Params configured for this site.
|
2019-11-21 15:59:38 -05:00
|
|
|
Params() maps.Params
|
2022-04-21 04:59:13 -04:00
|
|
|
|
2023-05-17 07:12:49 -04:00
|
|
|
// Param is a convenience method to do lookups in Params.
|
|
|
|
Param(key any) (any, error)
|
|
|
|
|
2022-04-21 04:59:13 -04:00
|
|
|
// Returns a map of all the data inside /data.
|
2022-03-17 17:03:27 -04:00
|
|
|
Data() map[string]any
|
2023-01-24 14:57:15 -05:00
|
|
|
|
2023-01-04 12:24:36 -05:00
|
|
|
// Returns the site config.
|
|
|
|
Config() SiteConfig
|
|
|
|
|
|
|
|
// Author is deprecated and will be removed in a future release.
|
|
|
|
Author() map[string]interface{}
|
|
|
|
|
2023-05-17 03:59:57 -04:00
|
|
|
// Authors is deprecated and will be removed in a future release.
|
|
|
|
Authors() AuthorList
|
|
|
|
|
2023-01-04 12:24:36 -05:00
|
|
|
// Returns the social links for this site.
|
|
|
|
Social() map[string]string
|
|
|
|
|
|
|
|
// Deprecated: Use Config().Services.GoogleAnalytics instead.
|
|
|
|
GoogleAnalytics() string
|
|
|
|
|
|
|
|
// Deprecated: Use Config().Privacy.Disqus instead.
|
|
|
|
DisqusShortname() string
|
|
|
|
|
2023-05-18 05:05:56 -04:00
|
|
|
// BuildDrafts is deprecated and will be removed in a future release.
|
2023-05-17 03:59:57 -04:00
|
|
|
BuildDrafts() bool
|
|
|
|
|
2024-03-09 14:21:46 -05:00
|
|
|
// Deprecated: Use hugo.IsMultiLingual instead.
|
2023-05-17 03:59:57 -04:00
|
|
|
IsMultiLingual() bool
|
2023-05-17 17:27:40 -04:00
|
|
|
|
2023-05-18 05:05:56 -04:00
|
|
|
// LanguagePrefix returns the language prefix for this site.
|
2023-05-17 17:27:40 -04:00
|
|
|
LanguagePrefix() string
|
2023-06-14 06:04:32 -04:00
|
|
|
|
2024-03-09 14:21:46 -05:00
|
|
|
// Deprecated: Use .Site.Home.OutputFormats.Get "rss" instead.
|
2023-06-14 06:04:32 -04:00
|
|
|
RSSLink() template.URL
|
2019-01-02 06:33:26 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Sites represents an ordered list of sites (languages).
|
|
|
|
type Sites []Site
|
|
|
|
|
|
|
|
// First is a convenience method to get the first Site, i.e. the main language.
|
|
|
|
func (s Sites) First() Site {
|
|
|
|
if len(s) == 0 {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return s[0]
|
2017-08-17 04:24:17 -04:00
|
|
|
}
|
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
2019-05-03 03:16:58 -04:00
|
|
|
|
all: Rework page store, add a dynacache, improve partial rebuilds, and some general spring cleaning
There are some breaking changes in this commit, see #11455.
Closes #11455
Closes #11549
This fixes a set of bugs (see issue list) and it is also paying some technical debt accumulated over the years. We now build with Staticcheck enabled in the CI build.
The performance should be about the same as before for regular sized Hugo sites, but it should perform and scale much better to larger data sets, as objects that uses lots of memory (e.g. rendered Markdown, big JSON files read into maps with transform.Unmarshal etc.) will now get automatically garbage collected if needed. Performance on partial rebuilds when running the server in fast render mode should be the same, but the change detection should be much more accurate.
A list of the notable new features:
* A new dependency tracker that covers (almost) all of Hugo's API and is used to do fine grained partial rebuilds when running the server.
* A new and simpler tree document store which allows fast lookups and prefix-walking in all dimensions (e.g. language) concurrently.
* You can now configure an upper memory limit allowing for much larger data sets and/or running on lower specced PCs.
We have lifted the "no resources in sub folders" restriction for branch bundles (e.g. sections).
Memory Limit
* Hugos will, by default, set aside a quarter of the total system memory, but you can set this via the OS environment variable HUGO_MEMORYLIMIT (in gigabytes). This is backed by a partitioned LRU cache used throughout Hugo. A cache that gets dynamically resized in low memory situations, allowing Go's Garbage Collector to free the memory.
New Dependency Tracker: Hugo has had a rule based coarse grained approach to server rebuilds that has worked mostly pretty well, but there have been some surprises (e.g. stale content). This is now revamped with a new dependency tracker that can quickly calculate the delta given a changed resource (e.g. a content file, template, JS file etc.). This handles transitive relations, e.g. $page -> js.Build -> JS import, or $page1.Content -> render hook -> site.GetPage -> $page2.Title, or $page1.Content -> shortcode -> partial -> site.RegularPages -> $page2.Content -> shortcode ..., and should also handle changes to aggregated values (e.g. site.Lastmod) effectively.
This covers all of Hugo's API with 2 known exceptions (a list that may not be fully exhaustive):
Changes to files loaded with template func os.ReadFile may not be handled correctly. We recommend loading resources with resources.Get
Changes to Hugo objects (e.g. Page) passed in the template context to lang.Translate may not be detected correctly. We recommend having simple i18n templates without too much data context passed in other than simple types such as strings and numbers.
Note that the cachebuster configuration (when A changes then rebuild B) works well with the above, but we recommend that you revise that configuration, as it in most situations should not be needed. One example where it is still needed is with TailwindCSS and using changes to hugo_stats.json to trigger new CSS rebuilds.
Document Store: Previously, a little simplified, we split the document store (where we store pages and resources) in a tree per language. This worked pretty well, but the structure made some operations harder than they needed to be. We have now restructured it into one Radix tree for all languages. Internally the language is considered to be a dimension of that tree, and the tree can be viewed in all dimensions concurrently. This makes some operations re. language simpler (e.g. finding translations is just a slice range), but the idea is that it should also be relatively inexpensive to add more dimensions if needed (e.g. role).
Fixes #10169
Fixes #10364
Fixes #10482
Fixes #10630
Fixes #10656
Fixes #10694
Fixes #10918
Fixes #11262
Fixes #11439
Fixes #11453
Fixes #11457
Fixes #11466
Fixes #11540
Fixes #11551
Fixes #11556
Fixes #11654
Fixes #11661
Fixes #11663
Fixes #11664
Fixes #11669
Fixes #11671
Fixes #11807
Fixes #11808
Fixes #11809
Fixes #11815
Fixes #11840
Fixes #11853
Fixes #11860
Fixes #11883
Fixes #11904
Fixes #7388
Fixes #7425
Fixes #7436
Fixes #7544
Fixes #7882
Fixes #7960
Fixes #8255
Fixes #8307
Fixes #8863
Fixes #8927
Fixes #9192
Fixes #9324
2023-12-24 13:11:05 -05:00
|
|
|
// Some additional interfaces implemented by siteWrapper that's not on Site.
|
|
|
|
var _ identity.ForEeachIdentityByNameProvider = (*siteWrapper)(nil)
|
|
|
|
|
2023-01-04 12:24:36 -05:00
|
|
|
type siteWrapper struct {
|
|
|
|
s Site
|
|
|
|
}
|
|
|
|
|
|
|
|
func WrapSite(s Site) Site {
|
|
|
|
if s == nil {
|
|
|
|
panic("Site is nil")
|
|
|
|
}
|
|
|
|
return &siteWrapper{s: s}
|
|
|
|
}
|
|
|
|
|
all: Rework page store, add a dynacache, improve partial rebuilds, and some general spring cleaning
There are some breaking changes in this commit, see #11455.
Closes #11455
Closes #11549
This fixes a set of bugs (see issue list) and it is also paying some technical debt accumulated over the years. We now build with Staticcheck enabled in the CI build.
The performance should be about the same as before for regular sized Hugo sites, but it should perform and scale much better to larger data sets, as objects that uses lots of memory (e.g. rendered Markdown, big JSON files read into maps with transform.Unmarshal etc.) will now get automatically garbage collected if needed. Performance on partial rebuilds when running the server in fast render mode should be the same, but the change detection should be much more accurate.
A list of the notable new features:
* A new dependency tracker that covers (almost) all of Hugo's API and is used to do fine grained partial rebuilds when running the server.
* A new and simpler tree document store which allows fast lookups and prefix-walking in all dimensions (e.g. language) concurrently.
* You can now configure an upper memory limit allowing for much larger data sets and/or running on lower specced PCs.
We have lifted the "no resources in sub folders" restriction for branch bundles (e.g. sections).
Memory Limit
* Hugos will, by default, set aside a quarter of the total system memory, but you can set this via the OS environment variable HUGO_MEMORYLIMIT (in gigabytes). This is backed by a partitioned LRU cache used throughout Hugo. A cache that gets dynamically resized in low memory situations, allowing Go's Garbage Collector to free the memory.
New Dependency Tracker: Hugo has had a rule based coarse grained approach to server rebuilds that has worked mostly pretty well, but there have been some surprises (e.g. stale content). This is now revamped with a new dependency tracker that can quickly calculate the delta given a changed resource (e.g. a content file, template, JS file etc.). This handles transitive relations, e.g. $page -> js.Build -> JS import, or $page1.Content -> render hook -> site.GetPage -> $page2.Title, or $page1.Content -> shortcode -> partial -> site.RegularPages -> $page2.Content -> shortcode ..., and should also handle changes to aggregated values (e.g. site.Lastmod) effectively.
This covers all of Hugo's API with 2 known exceptions (a list that may not be fully exhaustive):
Changes to files loaded with template func os.ReadFile may not be handled correctly. We recommend loading resources with resources.Get
Changes to Hugo objects (e.g. Page) passed in the template context to lang.Translate may not be detected correctly. We recommend having simple i18n templates without too much data context passed in other than simple types such as strings and numbers.
Note that the cachebuster configuration (when A changes then rebuild B) works well with the above, but we recommend that you revise that configuration, as it in most situations should not be needed. One example where it is still needed is with TailwindCSS and using changes to hugo_stats.json to trigger new CSS rebuilds.
Document Store: Previously, a little simplified, we split the document store (where we store pages and resources) in a tree per language. This worked pretty well, but the structure made some operations harder than they needed to be. We have now restructured it into one Radix tree for all languages. Internally the language is considered to be a dimension of that tree, and the tree can be viewed in all dimensions concurrently. This makes some operations re. language simpler (e.g. finding translations is just a slice range), but the idea is that it should also be relatively inexpensive to add more dimensions if needed (e.g. role).
Fixes #10169
Fixes #10364
Fixes #10482
Fixes #10630
Fixes #10656
Fixes #10694
Fixes #10918
Fixes #11262
Fixes #11439
Fixes #11453
Fixes #11457
Fixes #11466
Fixes #11540
Fixes #11551
Fixes #11556
Fixes #11654
Fixes #11661
Fixes #11663
Fixes #11664
Fixes #11669
Fixes #11671
Fixes #11807
Fixes #11808
Fixes #11809
Fixes #11815
Fixes #11840
Fixes #11853
Fixes #11860
Fixes #11883
Fixes #11904
Fixes #7388
Fixes #7425
Fixes #7436
Fixes #7544
Fixes #7882
Fixes #7960
Fixes #8255
Fixes #8307
Fixes #8863
Fixes #8927
Fixes #9192
Fixes #9324
2023-12-24 13:11:05 -05:00
|
|
|
func (s *siteWrapper) Key() string {
|
|
|
|
return s.s.Language().Lang
|
|
|
|
}
|
|
|
|
|
2023-01-04 12:24:36 -05:00
|
|
|
func (s *siteWrapper) Social() map[string]string {
|
|
|
|
return s.s.Social()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *siteWrapper) Author() map[string]interface{} {
|
|
|
|
return s.s.Author()
|
|
|
|
}
|
2023-10-30 04:07:03 -04:00
|
|
|
|
2023-05-17 03:59:57 -04:00
|
|
|
func (s *siteWrapper) Authors() AuthorList {
|
|
|
|
return AuthorList{}
|
|
|
|
}
|
2023-01-04 12:24:36 -05:00
|
|
|
|
2024-03-09 14:21:46 -05:00
|
|
|
// Deprecated: Use .Site.Config.Services.GoogleAnalytics.ID instead.
|
2023-01-04 12:24:36 -05:00
|
|
|
func (s *siteWrapper) GoogleAnalytics() string {
|
|
|
|
return s.s.GoogleAnalytics()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *siteWrapper) GetPage(ref ...string) (Page, error) {
|
|
|
|
return s.s.GetPage(ref...)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *siteWrapper) Language() *langs.Language {
|
|
|
|
return s.s.Language()
|
|
|
|
}
|
|
|
|
|
2023-05-17 07:12:49 -04:00
|
|
|
func (s *siteWrapper) Languages() langs.Languages {
|
|
|
|
return s.s.Languages()
|
|
|
|
}
|
|
|
|
|
2023-05-17 03:59:57 -04:00
|
|
|
func (s *siteWrapper) AllPages() Pages {
|
|
|
|
return s.s.AllPages()
|
|
|
|
}
|
|
|
|
|
2023-01-04 12:24:36 -05:00
|
|
|
func (s *siteWrapper) RegularPages() Pages {
|
|
|
|
return s.s.RegularPages()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *siteWrapper) Pages() Pages {
|
|
|
|
return s.s.Pages()
|
|
|
|
}
|
|
|
|
|
2023-05-16 12:53:34 -04:00
|
|
|
func (s *siteWrapper) Sections() Pages {
|
|
|
|
return s.s.Sections()
|
|
|
|
}
|
|
|
|
|
2023-01-04 12:24:36 -05:00
|
|
|
func (s *siteWrapper) Home() Page {
|
|
|
|
return s.s.Home()
|
|
|
|
}
|
|
|
|
|
2024-03-09 14:21:46 -05:00
|
|
|
// Deprecated: Use hugo.IsServer instead.
|
2023-01-04 12:24:36 -05:00
|
|
|
func (s *siteWrapper) IsServer() bool {
|
|
|
|
return s.s.IsServer()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *siteWrapper) ServerPort() int {
|
|
|
|
return s.s.ServerPort()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *siteWrapper) Title() string {
|
|
|
|
return s.s.Title()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *siteWrapper) LanguageCode() string {
|
|
|
|
return s.s.LanguageCode()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *siteWrapper) Copyright() string {
|
|
|
|
return s.s.Copyright()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *siteWrapper) Sites() Sites {
|
|
|
|
return s.s.Sites()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *siteWrapper) Current() Site {
|
|
|
|
return s.s.Current()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *siteWrapper) Config() SiteConfig {
|
|
|
|
return s.s.Config()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *siteWrapper) Hugo() hugo.HugoInfo {
|
|
|
|
return s.s.Hugo()
|
|
|
|
}
|
|
|
|
|
2023-10-30 04:07:03 -04:00
|
|
|
func (s *siteWrapper) BaseURL() string {
|
2023-01-04 12:24:36 -05:00
|
|
|
return s.s.BaseURL()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *siteWrapper) Taxonomies() TaxonomyList {
|
|
|
|
return s.s.Taxonomies()
|
|
|
|
}
|
|
|
|
|
2024-03-09 14:21:46 -05:00
|
|
|
// Deprecated: Use .Site.Lastmod instead.
|
2023-01-04 12:24:36 -05:00
|
|
|
func (s *siteWrapper) LastChange() time.Time {
|
2024-03-09 14:21:46 -05:00
|
|
|
return s.s.LastChange()
|
all: Rework page store, add a dynacache, improve partial rebuilds, and some general spring cleaning
There are some breaking changes in this commit, see #11455.
Closes #11455
Closes #11549
This fixes a set of bugs (see issue list) and it is also paying some technical debt accumulated over the years. We now build with Staticcheck enabled in the CI build.
The performance should be about the same as before for regular sized Hugo sites, but it should perform and scale much better to larger data sets, as objects that uses lots of memory (e.g. rendered Markdown, big JSON files read into maps with transform.Unmarshal etc.) will now get automatically garbage collected if needed. Performance on partial rebuilds when running the server in fast render mode should be the same, but the change detection should be much more accurate.
A list of the notable new features:
* A new dependency tracker that covers (almost) all of Hugo's API and is used to do fine grained partial rebuilds when running the server.
* A new and simpler tree document store which allows fast lookups and prefix-walking in all dimensions (e.g. language) concurrently.
* You can now configure an upper memory limit allowing for much larger data sets and/or running on lower specced PCs.
We have lifted the "no resources in sub folders" restriction for branch bundles (e.g. sections).
Memory Limit
* Hugos will, by default, set aside a quarter of the total system memory, but you can set this via the OS environment variable HUGO_MEMORYLIMIT (in gigabytes). This is backed by a partitioned LRU cache used throughout Hugo. A cache that gets dynamically resized in low memory situations, allowing Go's Garbage Collector to free the memory.
New Dependency Tracker: Hugo has had a rule based coarse grained approach to server rebuilds that has worked mostly pretty well, but there have been some surprises (e.g. stale content). This is now revamped with a new dependency tracker that can quickly calculate the delta given a changed resource (e.g. a content file, template, JS file etc.). This handles transitive relations, e.g. $page -> js.Build -> JS import, or $page1.Content -> render hook -> site.GetPage -> $page2.Title, or $page1.Content -> shortcode -> partial -> site.RegularPages -> $page2.Content -> shortcode ..., and should also handle changes to aggregated values (e.g. site.Lastmod) effectively.
This covers all of Hugo's API with 2 known exceptions (a list that may not be fully exhaustive):
Changes to files loaded with template func os.ReadFile may not be handled correctly. We recommend loading resources with resources.Get
Changes to Hugo objects (e.g. Page) passed in the template context to lang.Translate may not be detected correctly. We recommend having simple i18n templates without too much data context passed in other than simple types such as strings and numbers.
Note that the cachebuster configuration (when A changes then rebuild B) works well with the above, but we recommend that you revise that configuration, as it in most situations should not be needed. One example where it is still needed is with TailwindCSS and using changes to hugo_stats.json to trigger new CSS rebuilds.
Document Store: Previously, a little simplified, we split the document store (where we store pages and resources) in a tree per language. This worked pretty well, but the structure made some operations harder than they needed to be. We have now restructured it into one Radix tree for all languages. Internally the language is considered to be a dimension of that tree, and the tree can be viewed in all dimensions concurrently. This makes some operations re. language simpler (e.g. finding translations is just a slice range), but the idea is that it should also be relatively inexpensive to add more dimensions if needed (e.g. role).
Fixes #10169
Fixes #10364
Fixes #10482
Fixes #10630
Fixes #10656
Fixes #10694
Fixes #10918
Fixes #11262
Fixes #11439
Fixes #11453
Fixes #11457
Fixes #11466
Fixes #11540
Fixes #11551
Fixes #11556
Fixes #11654
Fixes #11661
Fixes #11663
Fixes #11664
Fixes #11669
Fixes #11671
Fixes #11807
Fixes #11808
Fixes #11809
Fixes #11815
Fixes #11840
Fixes #11853
Fixes #11860
Fixes #11883
Fixes #11904
Fixes #7388
Fixes #7425
Fixes #7436
Fixes #7544
Fixes #7882
Fixes #7960
Fixes #8255
Fixes #8307
Fixes #8863
Fixes #8927
Fixes #9192
Fixes #9324
2023-12-24 13:11:05 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *siteWrapper) Lastmod() time.Time {
|
|
|
|
return s.s.Lastmod()
|
2023-01-04 12:24:36 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *siteWrapper) Menus() navigation.Menus {
|
|
|
|
return s.s.Menus()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *siteWrapper) MainSections() []string {
|
|
|
|
return s.s.MainSections()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *siteWrapper) Params() maps.Params {
|
|
|
|
return s.s.Params()
|
|
|
|
}
|
|
|
|
|
2023-05-17 07:12:49 -04:00
|
|
|
func (s *siteWrapper) Param(key any) (any, error) {
|
|
|
|
return s.s.Param(key)
|
|
|
|
}
|
|
|
|
|
2023-01-04 12:24:36 -05:00
|
|
|
func (s *siteWrapper) Data() map[string]any {
|
|
|
|
return s.s.Data()
|
|
|
|
}
|
|
|
|
|
2023-05-17 03:59:57 -04:00
|
|
|
func (s *siteWrapper) BuildDrafts() bool {
|
|
|
|
return s.s.BuildDrafts()
|
|
|
|
}
|
|
|
|
|
2024-03-09 14:21:46 -05:00
|
|
|
// Deprecated: Use hugo.IsMultiLingual instead.
|
2023-05-17 03:59:57 -04:00
|
|
|
func (s *siteWrapper) IsMultiLingual() bool {
|
|
|
|
return s.s.IsMultiLingual()
|
|
|
|
}
|
|
|
|
|
2024-03-09 14:21:46 -05:00
|
|
|
// Deprecated: Use .Site.Config.Services.Disqus.Shortname instead.
|
2023-01-04 12:24:36 -05:00
|
|
|
func (s *siteWrapper) DisqusShortname() string {
|
|
|
|
return s.s.DisqusShortname()
|
|
|
|
}
|
|
|
|
|
2023-05-17 17:27:40 -04:00
|
|
|
func (s *siteWrapper) LanguagePrefix() string {
|
|
|
|
return s.s.LanguagePrefix()
|
|
|
|
}
|
|
|
|
|
2024-03-09 14:21:46 -05:00
|
|
|
// Deprecated: Use .Site.Home.OutputFormats.Get "rss" instead.
|
2023-06-14 06:04:32 -04:00
|
|
|
func (s *siteWrapper) RSSLink() template.URL {
|
|
|
|
return s.s.RSSLink()
|
|
|
|
}
|
|
|
|
|
all: Rework page store, add a dynacache, improve partial rebuilds, and some general spring cleaning
There are some breaking changes in this commit, see #11455.
Closes #11455
Closes #11549
This fixes a set of bugs (see issue list) and it is also paying some technical debt accumulated over the years. We now build with Staticcheck enabled in the CI build.
The performance should be about the same as before for regular sized Hugo sites, but it should perform and scale much better to larger data sets, as objects that uses lots of memory (e.g. rendered Markdown, big JSON files read into maps with transform.Unmarshal etc.) will now get automatically garbage collected if needed. Performance on partial rebuilds when running the server in fast render mode should be the same, but the change detection should be much more accurate.
A list of the notable new features:
* A new dependency tracker that covers (almost) all of Hugo's API and is used to do fine grained partial rebuilds when running the server.
* A new and simpler tree document store which allows fast lookups and prefix-walking in all dimensions (e.g. language) concurrently.
* You can now configure an upper memory limit allowing for much larger data sets and/or running on lower specced PCs.
We have lifted the "no resources in sub folders" restriction for branch bundles (e.g. sections).
Memory Limit
* Hugos will, by default, set aside a quarter of the total system memory, but you can set this via the OS environment variable HUGO_MEMORYLIMIT (in gigabytes). This is backed by a partitioned LRU cache used throughout Hugo. A cache that gets dynamically resized in low memory situations, allowing Go's Garbage Collector to free the memory.
New Dependency Tracker: Hugo has had a rule based coarse grained approach to server rebuilds that has worked mostly pretty well, but there have been some surprises (e.g. stale content). This is now revamped with a new dependency tracker that can quickly calculate the delta given a changed resource (e.g. a content file, template, JS file etc.). This handles transitive relations, e.g. $page -> js.Build -> JS import, or $page1.Content -> render hook -> site.GetPage -> $page2.Title, or $page1.Content -> shortcode -> partial -> site.RegularPages -> $page2.Content -> shortcode ..., and should also handle changes to aggregated values (e.g. site.Lastmod) effectively.
This covers all of Hugo's API with 2 known exceptions (a list that may not be fully exhaustive):
Changes to files loaded with template func os.ReadFile may not be handled correctly. We recommend loading resources with resources.Get
Changes to Hugo objects (e.g. Page) passed in the template context to lang.Translate may not be detected correctly. We recommend having simple i18n templates without too much data context passed in other than simple types such as strings and numbers.
Note that the cachebuster configuration (when A changes then rebuild B) works well with the above, but we recommend that you revise that configuration, as it in most situations should not be needed. One example where it is still needed is with TailwindCSS and using changes to hugo_stats.json to trigger new CSS rebuilds.
Document Store: Previously, a little simplified, we split the document store (where we store pages and resources) in a tree per language. This worked pretty well, but the structure made some operations harder than they needed to be. We have now restructured it into one Radix tree for all languages. Internally the language is considered to be a dimension of that tree, and the tree can be viewed in all dimensions concurrently. This makes some operations re. language simpler (e.g. finding translations is just a slice range), but the idea is that it should also be relatively inexpensive to add more dimensions if needed (e.g. role).
Fixes #10169
Fixes #10364
Fixes #10482
Fixes #10630
Fixes #10656
Fixes #10694
Fixes #10918
Fixes #11262
Fixes #11439
Fixes #11453
Fixes #11457
Fixes #11466
Fixes #11540
Fixes #11551
Fixes #11556
Fixes #11654
Fixes #11661
Fixes #11663
Fixes #11664
Fixes #11669
Fixes #11671
Fixes #11807
Fixes #11808
Fixes #11809
Fixes #11815
Fixes #11840
Fixes #11853
Fixes #11860
Fixes #11883
Fixes #11904
Fixes #7388
Fixes #7425
Fixes #7436
Fixes #7544
Fixes #7882
Fixes #7960
Fixes #8255
Fixes #8307
Fixes #8863
Fixes #8927
Fixes #9192
Fixes #9324
2023-12-24 13:11:05 -05:00
|
|
|
// For internal use only.
|
|
|
|
func (s *siteWrapper) ForEeachIdentityByName(name string, f func(identity.Identity) bool) {
|
|
|
|
s.s.(identity.ForEeachIdentityByNameProvider).ForEeachIdentityByName(name, f)
|
|
|
|
}
|
|
|
|
|
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
2019-05-03 03:16:58 -04:00
|
|
|
type testSite struct {
|
2023-01-04 12:24:36 -05:00
|
|
|
h hugo.HugoInfo
|
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
2019-05-03 03:16:58 -04:00
|
|
|
l *langs.Language
|
|
|
|
}
|
|
|
|
|
2023-01-04 12:24:36 -05:00
|
|
|
func (s testSite) Author() map[string]interface{} {
|
|
|
|
return nil
|
|
|
|
}
|
2023-10-30 04:07:03 -04:00
|
|
|
|
2023-05-17 03:59:57 -04:00
|
|
|
func (s testSite) Authors() AuthorList {
|
|
|
|
return AuthorList{}
|
|
|
|
}
|
2023-01-04 12:24:36 -05:00
|
|
|
|
|
|
|
func (s testSite) Social() map[string]string {
|
|
|
|
return make(map[string]string)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t testSite) Hugo() hugo.HugoInfo {
|
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
2019-05-03 03:16:58 -04:00
|
|
|
return t.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t testSite) ServerPort() int {
|
|
|
|
return 1313
|
|
|
|
}
|
|
|
|
|
2024-03-09 14:21:46 -05:00
|
|
|
// Deprecated: Use .Site.Lastmod instead.
|
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
2019-05-03 03:16:58 -04:00
|
|
|
func (testSite) LastChange() (t time.Time) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
all: Rework page store, add a dynacache, improve partial rebuilds, and some general spring cleaning
There are some breaking changes in this commit, see #11455.
Closes #11455
Closes #11549
This fixes a set of bugs (see issue list) and it is also paying some technical debt accumulated over the years. We now build with Staticcheck enabled in the CI build.
The performance should be about the same as before for regular sized Hugo sites, but it should perform and scale much better to larger data sets, as objects that uses lots of memory (e.g. rendered Markdown, big JSON files read into maps with transform.Unmarshal etc.) will now get automatically garbage collected if needed. Performance on partial rebuilds when running the server in fast render mode should be the same, but the change detection should be much more accurate.
A list of the notable new features:
* A new dependency tracker that covers (almost) all of Hugo's API and is used to do fine grained partial rebuilds when running the server.
* A new and simpler tree document store which allows fast lookups and prefix-walking in all dimensions (e.g. language) concurrently.
* You can now configure an upper memory limit allowing for much larger data sets and/or running on lower specced PCs.
We have lifted the "no resources in sub folders" restriction for branch bundles (e.g. sections).
Memory Limit
* Hugos will, by default, set aside a quarter of the total system memory, but you can set this via the OS environment variable HUGO_MEMORYLIMIT (in gigabytes). This is backed by a partitioned LRU cache used throughout Hugo. A cache that gets dynamically resized in low memory situations, allowing Go's Garbage Collector to free the memory.
New Dependency Tracker: Hugo has had a rule based coarse grained approach to server rebuilds that has worked mostly pretty well, but there have been some surprises (e.g. stale content). This is now revamped with a new dependency tracker that can quickly calculate the delta given a changed resource (e.g. a content file, template, JS file etc.). This handles transitive relations, e.g. $page -> js.Build -> JS import, or $page1.Content -> render hook -> site.GetPage -> $page2.Title, or $page1.Content -> shortcode -> partial -> site.RegularPages -> $page2.Content -> shortcode ..., and should also handle changes to aggregated values (e.g. site.Lastmod) effectively.
This covers all of Hugo's API with 2 known exceptions (a list that may not be fully exhaustive):
Changes to files loaded with template func os.ReadFile may not be handled correctly. We recommend loading resources with resources.Get
Changes to Hugo objects (e.g. Page) passed in the template context to lang.Translate may not be detected correctly. We recommend having simple i18n templates without too much data context passed in other than simple types such as strings and numbers.
Note that the cachebuster configuration (when A changes then rebuild B) works well with the above, but we recommend that you revise that configuration, as it in most situations should not be needed. One example where it is still needed is with TailwindCSS and using changes to hugo_stats.json to trigger new CSS rebuilds.
Document Store: Previously, a little simplified, we split the document store (where we store pages and resources) in a tree per language. This worked pretty well, but the structure made some operations harder than they needed to be. We have now restructured it into one Radix tree for all languages. Internally the language is considered to be a dimension of that tree, and the tree can be viewed in all dimensions concurrently. This makes some operations re. language simpler (e.g. finding translations is just a slice range), but the idea is that it should also be relatively inexpensive to add more dimensions if needed (e.g. role).
Fixes #10169
Fixes #10364
Fixes #10482
Fixes #10630
Fixes #10656
Fixes #10694
Fixes #10918
Fixes #11262
Fixes #11439
Fixes #11453
Fixes #11457
Fixes #11466
Fixes #11540
Fixes #11551
Fixes #11556
Fixes #11654
Fixes #11661
Fixes #11663
Fixes #11664
Fixes #11669
Fixes #11671
Fixes #11807
Fixes #11808
Fixes #11809
Fixes #11815
Fixes #11840
Fixes #11853
Fixes #11860
Fixes #11883
Fixes #11904
Fixes #7388
Fixes #7425
Fixes #7436
Fixes #7544
Fixes #7882
Fixes #7960
Fixes #8255
Fixes #8307
Fixes #8863
Fixes #8927
Fixes #9192
Fixes #9324
2023-12-24 13:11:05 -05:00
|
|
|
func (testSite) Lastmod() (t time.Time) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
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
2019-05-03 03:16:58 -04:00
|
|
|
func (t testSite) Title() string {
|
|
|
|
return "foo"
|
|
|
|
}
|
|
|
|
|
2023-01-04 12:24:36 -05:00
|
|
|
func (t testSite) LanguageCode() string {
|
|
|
|
return t.l.Lang
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t testSite) Copyright() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
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
2019-05-03 03:16:58 -04:00
|
|
|
func (t testSite) Sites() Sites {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-05-16 12:53:34 -04:00
|
|
|
func (t testSite) Sections() Pages {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-01-04 12:24:36 -05:00
|
|
|
func (t testSite) GetPage(ref ...string) (Page, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
2022-04-05 03:57:58 -04:00
|
|
|
func (t testSite) Current() Site {
|
|
|
|
return t
|
|
|
|
}
|
|
|
|
|
2023-05-17 17:27:40 -04:00
|
|
|
func (s testSite) LanguagePrefix() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2023-05-17 07:12:49 -04:00
|
|
|
func (t testSite) Languages() langs.Languages {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2024-03-09 14:21:46 -05:00
|
|
|
// Deprecated: Use .Site.Config.Services.GoogleAnalytics.ID instead.
|
2023-01-04 12:24:36 -05:00
|
|
|
func (t testSite) GoogleAnalytics() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t testSite) MainSections() []string {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2024-03-09 14:21:46 -05:00
|
|
|
// Deprecated: Use hugo.IsServer instead.
|
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
2019-05-03 03:16:58 -04:00
|
|
|
func (t testSite) IsServer() bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t testSite) Language() *langs.Language {
|
|
|
|
return t.l
|
|
|
|
}
|
|
|
|
|
2022-02-17 07:04:00 -05:00
|
|
|
func (t testSite) Home() Page {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
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
2019-05-03 03:16:58 -04:00
|
|
|
func (t testSite) Pages() Pages {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-05-17 03:59:57 -04:00
|
|
|
func (t testSite) AllPages() Pages {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
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
2019-05-03 03:16:58 -04:00
|
|
|
func (t testSite) RegularPages() Pages {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t testSite) Menus() navigation.Menus {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2022-12-30 03:20:58 -05:00
|
|
|
func (t testSite) Taxonomies() TaxonomyList {
|
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
2019-05-03 03:16:58 -04:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-10-30 04:07:03 -04:00
|
|
|
func (t testSite) BaseURL() string {
|
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
2019-05-03 03:16:58 -04:00
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2019-11-21 15:59:38 -05:00
|
|
|
func (t testSite) Params() maps.Params {
|
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
2019-05-03 03:16:58 -04:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2022-03-17 17:03:27 -04:00
|
|
|
func (t testSite) Data() map[string]any {
|
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
2019-05-03 03:16:58 -04:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-01-04 12:24:36 -05:00
|
|
|
func (s testSite) Config() SiteConfig {
|
|
|
|
return SiteConfig{}
|
|
|
|
}
|
|
|
|
|
2024-03-09 14:21:46 -05:00
|
|
|
// Deprecated: Use .Site.Config.Services.Disqus.Shortname instead.
|
2023-01-04 12:24:36 -05:00
|
|
|
func (testSite) DisqusShortname() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2023-05-17 03:59:57 -04:00
|
|
|
func (s testSite) BuildDrafts() bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2024-03-09 14:21:46 -05:00
|
|
|
// Deprecated: Use hugo.IsMultiLingual instead.
|
2023-05-17 03:59:57 -04:00
|
|
|
func (s testSite) IsMultiLingual() bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2023-05-17 07:12:49 -04:00
|
|
|
func (s testSite) Param(key any) (any, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
2024-03-09 14:21:46 -05:00
|
|
|
// Deprecated: Use .Site.Home.OutputFormats.Get "rss" instead.
|
2023-06-14 06:04:32 -04:00
|
|
|
func (s testSite) RSSLink() template.URL {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
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
2019-05-03 03:16:58 -04:00
|
|
|
// NewDummyHugoSite creates a new minimal test site.
|
2023-05-20 09:04:22 -04:00
|
|
|
func NewDummyHugoSite(conf config.AllProvider) Site {
|
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
2019-05-03 03:16:58 -04:00
|
|
|
return testSite{
|
2023-05-20 09:04:22 -04:00
|
|
|
h: hugo.NewInfo(conf, nil),
|
2023-01-04 12:24:36 -05:00
|
|
|
l: &langs.Language{
|
|
|
|
Lang: "en",
|
|
|
|
},
|
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
2019-05-03 03:16:58 -04:00
|
|
|
}
|
|
|
|
}
|
2023-01-04 12:24:36 -05:00
|
|
|
|
|
|
|
// SiteConfig holds the config in site.Config.
|
|
|
|
type SiteConfig struct {
|
|
|
|
// This contains all privacy related settings that can be used to
|
|
|
|
// make the YouTube template etc. GDPR compliant.
|
|
|
|
Privacy privacy.Config
|
|
|
|
|
|
|
|
// Services contains config for services such as Google Analytics etc.
|
|
|
|
Services services.Config
|
|
|
|
}
|