mirror of
https://github.com/gohugoio/hugo.git
synced 2024-07-05 08:42:12 +00:00
Use page.Markup to determine which PageHandler to use if it's set.
This commit is contained in:
parent
ade2ca6072
commit
8a5dd06ad0
|
@ -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) {
|
func pageConverter(s *Site, pages <-chan *Page, results HandleResults, wg *sync.WaitGroup) {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
for page := range pages {
|
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 {
|
if h != nil {
|
||||||
h.Convert(page, s, results)
|
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) {
|
func fileConverter(s *Site, files <-chan *source.File, results HandleResults, wg *sync.WaitGroup) {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
for file := range files {
|
for file := range files {
|
||||||
fmt.Println(file.Path())
|
|
||||||
//Handling short codes prior to Conversion to HTML
|
|
||||||
h := FindHandler(file.Extension())
|
h := FindHandler(file.Extension())
|
||||||
if h != nil {
|
if h != nil {
|
||||||
h.Convert(file, s, results)
|
h.Convert(file, s, results)
|
||||||
|
|
Loading…
Reference in a new issue