mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Use page.Markup to determine which PageHandler to use if it's set.
This commit is contained in:
parent
ade2ca6072
commit
8a5dd06ad0
1 changed files with 6 additions and 3 deletions
|
@ -428,7 +428,12 @@ func sourceReader(s *Site, files <-chan *source.File, results chan<- HandledResu
|
|||
func pageConverter(s *Site, pages <-chan *Page, results HandleResults, wg *sync.WaitGroup) {
|
||||
defer wg.Done()
|
||||
for page := range pages {
|
||||
h := FindHandler(page.File.Extension())
|
||||
var h Handler
|
||||
if page.Markup != "" {
|
||||
h = FindHandler(page.Markup)
|
||||
} else {
|
||||
h = FindHandler(page.File.Extension())
|
||||
}
|
||||
if h != nil {
|
||||
h.Convert(page, s, results)
|
||||
}
|
||||
|
@ -438,8 +443,6 @@ func pageConverter(s *Site, pages <-chan *Page, results HandleResults, wg *sync.
|
|||
func fileConverter(s *Site, files <-chan *source.File, results HandleResults, wg *sync.WaitGroup) {
|
||||
defer wg.Done()
|
||||
for file := range files {
|
||||
fmt.Println(file.Path())
|
||||
//Handling short codes prior to Conversion to HTML
|
||||
h := FindHandler(file.Extension())
|
||||
if h != nil {
|
||||
h.Convert(file, s, results)
|
||||
|
|
Loading…
Reference in a new issue