mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-15 20:44:01 +02:00
@@ -18,6 +18,7 @@ import (
|
||||
"fmt"
|
||||
"html/template"
|
||||
"io"
|
||||
"mime"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -610,6 +611,15 @@ type whatChanged struct {
|
||||
other bool
|
||||
}
|
||||
|
||||
// RegisterMediaTypes will register the Site's media types in the mime
|
||||
// package, so it will behave correctly with Hugo's built-in server.
|
||||
func (s *Site) RegisterMediaTypes() {
|
||||
for _, mt := range s.mediaTypesConfig {
|
||||
// The last one will win if there are any duplicates.
|
||||
mime.AddExtensionType("."+mt.Suffix, mt.Type()+"; charset=utf-8")
|
||||
}
|
||||
}
|
||||
|
||||
// reBuild partially rebuilds a site given the filesystem events.
|
||||
// It returns whetever the content source was changed.
|
||||
func (s *Site) reProcess(events []fsnotify.Event) (whatChanged, error) {
|
||||
|
Reference in New Issue
Block a user