mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-19 21:21:39 +02:00
Reimplement archetypes
The old implementation had some issues, mostly related to the context (e.g. name, file paths) passed to the template. This new implementation is using the exact same code path for evaluating the pages as in a regular build. This also makes it more robust and easier to reason about in a multilingual setup. Now, if you are explicit about the target path, Hugo will now always pick the correct mount and language: ```bash hugo new content/en/posts/my-first-post.md ``` Fixes #9032 Fixes #7589 Fixes #9043 Fixes #9046 Fixes #9047
This commit is contained in:
@@ -22,6 +22,8 @@ import (
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/gohugoio/hugo/hugofs/glob"
|
||||
|
||||
"github.com/fsnotify/fsnotify"
|
||||
|
||||
"github.com/gohugoio/hugo/identity"
|
||||
@@ -677,6 +679,9 @@ type BuildCfg struct {
|
||||
// Recently visited URLs. This is used for partial re-rendering.
|
||||
RecentlyVisited map[string]bool
|
||||
|
||||
// Can be set to build only with a sub set of the content source.
|
||||
ContentInclusionFilter *glob.FilenameFilter
|
||||
|
||||
testCounters *testCounters
|
||||
}
|
||||
|
||||
@@ -819,7 +824,7 @@ func (h *HugoSites) Pages() page.Pages {
|
||||
}
|
||||
|
||||
func (h *HugoSites) loadData(fis []hugofs.FileMetaInfo) (err error) {
|
||||
spec := source.NewSourceSpec(h.PathSpec, nil)
|
||||
spec := source.NewSourceSpec(h.PathSpec, nil, nil)
|
||||
|
||||
h.data = make(map[string]interface{})
|
||||
for _, fi := range fis {
|
||||
|
Reference in New Issue
Block a user