mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Create a struct with all of Hugo's config options
Primary motivation is documentation, but it will also hopefully simplify the code. Also, * Lower case the default output format names; this is in line with the custom ones (map keys) and how it's treated all the places. This avoids doing `stringds.EqualFold` everywhere. Closes #10896 Closes #10620
This commit is contained in:
@@ -199,7 +199,7 @@ func (t *postcssTransformation) Transform(ctx *resources.ResourceTransformationC
|
||||
stderr := io.MultiWriter(infoW, &errBuf)
|
||||
cmdArgs = append(cmdArgs, hexec.WithStderr(stderr))
|
||||
cmdArgs = append(cmdArgs, hexec.WithStdout(ctx.To))
|
||||
cmdArgs = append(cmdArgs, hexec.WithEnviron(hugo.GetExecEnviron(t.rs.WorkingDir, t.rs.Cfg, t.rs.BaseFs.Assets.Fs)))
|
||||
cmdArgs = append(cmdArgs, hexec.WithEnviron(hugo.GetExecEnviron(t.rs.Cfg.BaseConfig().WorkingDir, t.rs.Cfg, t.rs.BaseFs.Assets.Fs)))
|
||||
|
||||
cmd, err := ex.Npx(binaryName, cmdArgs...)
|
||||
if err != nil {
|
||||
@@ -382,10 +382,13 @@ func (imp *importResolver) resolve() (io.Reader, error) {
|
||||
// See https://www.w3schools.com/cssref/pr_import_rule.asp
|
||||
// We currently only support simple file imports, no urls, no media queries.
|
||||
// So this is OK:
|
||||
// @import "navigation.css";
|
||||
//
|
||||
// @import "navigation.css";
|
||||
//
|
||||
// This is not:
|
||||
// @import url("navigation.css");
|
||||
// @import "mobstyle.css" screen and (max-width: 768px);
|
||||
//
|
||||
// @import url("navigation.css");
|
||||
// @import "mobstyle.css" screen and (max-width: 768px);
|
||||
func (imp *importResolver) shouldImport(s string) bool {
|
||||
if !strings.HasPrefix(s, importIdentifier) {
|
||||
return false
|
||||
|
Reference in New Issue
Block a user