Be more verbose with servePubDir(), add an additional markdown file
extension, granted it's rare for someone to use it... Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja> git-svn-id: file:///srv/svn/repo/aya/trunk@62 cec141ff-132a-4243-88a5-ce187bd62f94
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
// $TheSupernovaDuo: cmd/aya/main.go,v 0.5.x 2023/4/26 8:49:6 yakumo_izuru Exp $
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -302,7 +303,7 @@ func buildRaw(path string, w io.Writer) error {
|
|||||||
|
|
||||||
func build(path string, w io.Writer, vars Vars) error {
|
func build(path string, w io.Writer, vars Vars) error {
|
||||||
ext := filepath.Ext(path)
|
ext := filepath.Ext(path)
|
||||||
if ext == ".md" || ext == ".mkd" {
|
if ext == ".md" || ext == ".mkd" || ext == ".markdown" {
|
||||||
return buildMarkdown(path, w, vars)
|
return buildMarkdown(path, w, vars)
|
||||||
} else if ext == ".html" || ext == ".xml" {
|
} else if ext == ".html" || ext == ".xml" {
|
||||||
return buildHTML(path, w, vars)
|
return buildHTML(path, w, vars)
|
||||||
@@ -363,6 +364,7 @@ func buildAll(watch bool) {
|
|||||||
func servePubDir() {
|
func servePubDir() {
|
||||||
rootdir := http.Dir(PUBDIR)
|
rootdir := http.Dir(PUBDIR)
|
||||||
http.Handle("/", http.FileServer(rootdir))
|
http.Handle("/", http.FileServer(rootdir))
|
||||||
|
log.Printf("Serving %v at port 8000, see http://localhost:8000", rootdir)
|
||||||
log.Fatal(http.ListenAndServe(":8000", nil))
|
log.Fatal(http.ListenAndServe(":8000", nil))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user