mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 15:28:54 +00:00
docs: Fix lineNos default value in docs.yaml
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
773664b812
commit
498431d641
+1
-1
@@ -1345,7 +1345,7 @@ config:
|
||||
hl_inline: false
|
||||
lineAnchors: ''
|
||||
lineNoStart: 1
|
||||
lineNos: null
|
||||
lineNos: false
|
||||
lineNumbersInTable: true
|
||||
noClasses: true
|
||||
style: monokai
|
||||
|
||||
@@ -27,6 +27,7 @@ import (
|
||||
var (
|
||||
keyMatchRegex = regexp.MustCompile(`\"(\w+)\":`)
|
||||
nullEnableBoolRegex = regexp.MustCompile(`\"(enable\w+)\":null`)
|
||||
nullLineNosRegex = regexp.MustCompile(`\"(lineNos)\":null`)
|
||||
)
|
||||
|
||||
type NullBoolJSONMarshaller struct {
|
||||
@@ -38,7 +39,9 @@ func (c NullBoolJSONMarshaller) MarshalJSON() ([]byte, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nullEnableBoolRegex.ReplaceAll(b, []byte(`"$1": false`)), nil
|
||||
b = nullEnableBoolRegex.ReplaceAll(b, []byte(`"$1": false`))
|
||||
b = nullLineNosRegex.ReplaceAll(b, []byte(`"$1": false`))
|
||||
return b, nil
|
||||
}
|
||||
|
||||
// Code adapted from https://gist.github.com/piersy/b9934790a8892db1a603820c0c23e4a7
|
||||
|
||||
Reference in New Issue
Block a user