mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-26 21:51:02 +03:00
parent
481924b34d
commit
9891c0fb0e
6 changed files with 22 additions and 329 deletions
|
@ -62,35 +62,31 @@ func NewContentSpec(cfg config.Provider) *ContentSpec {
|
|||
|
||||
// Blackfriday holds configuration values for Blackfriday rendering.
|
||||
type Blackfriday struct {
|
||||
Smartypants bool
|
||||
SmartypantsQuotesNBSP bool
|
||||
AngledQuotes bool
|
||||
Fractions bool
|
||||
HrefTargetBlank bool
|
||||
SmartDashes bool
|
||||
LatexDashes bool
|
||||
TaskLists bool
|
||||
PlainIDAnchors bool
|
||||
SourceRelativeLinksEval bool
|
||||
SourceRelativeLinksProjectFolder string
|
||||
Extensions []string
|
||||
ExtensionsMask []string
|
||||
Smartypants bool
|
||||
SmartypantsQuotesNBSP bool
|
||||
AngledQuotes bool
|
||||
Fractions bool
|
||||
HrefTargetBlank bool
|
||||
SmartDashes bool
|
||||
LatexDashes bool
|
||||
TaskLists bool
|
||||
PlainIDAnchors bool
|
||||
Extensions []string
|
||||
ExtensionsMask []string
|
||||
}
|
||||
|
||||
// NewBlackfriday creates a new Blackfriday filled with site config or some sane defaults.
|
||||
func (c ContentSpec) NewBlackfriday() *Blackfriday {
|
||||
defaultParam := map[string]interface{}{
|
||||
"smartypants": true,
|
||||
"angledQuotes": false,
|
||||
"smartypantsQuotesNBSP": false,
|
||||
"fractions": true,
|
||||
"hrefTargetBlank": false,
|
||||
"smartDashes": true,
|
||||
"latexDashes": true,
|
||||
"plainIDAnchors": true,
|
||||
"taskLists": true,
|
||||
"sourceRelativeLinks": false,
|
||||
"sourceRelativeLinksProjectFolder": "/docs/content",
|
||||
"smartypants": true,
|
||||
"angledQuotes": false,
|
||||
"smartypantsQuotesNBSP": false,
|
||||
"fractions": true,
|
||||
"hrefTargetBlank": false,
|
||||
"smartDashes": true,
|
||||
"latexDashes": true,
|
||||
"plainIDAnchors": true,
|
||||
"taskLists": true,
|
||||
}
|
||||
|
||||
ToLowerMap(defaultParam)
|
||||
|
@ -112,13 +108,6 @@ func (c ContentSpec) NewBlackfriday() *Blackfriday {
|
|||
jww.FATAL.Printf("Failed to get site rendering config\n%s", err.Error())
|
||||
}
|
||||
|
||||
if combinedConfig.SourceRelativeLinksEval {
|
||||
// Remove in Hugo 0.21
|
||||
Deprecated("blackfriday", "sourceRelativeLinksEval",
|
||||
`There is no replacement for this feature, as no developer has stepped up to the plate and volunteered to maintain this feature`, false)
|
||||
|
||||
}
|
||||
|
||||
return combinedConfig
|
||||
}
|
||||
|
||||
|
@ -412,8 +401,6 @@ type RenderingContext struct {
|
|||
DocumentName string
|
||||
Config *Blackfriday
|
||||
RenderTOC bool
|
||||
FileResolver FileResolverFunc
|
||||
LinkResolver LinkResolverFunc
|
||||
Cfg config.Provider
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue