notes on ro dont have comments
parent
b975a7c103
commit
f60d0618e6
|
|
@ -115,7 +115,7 @@ func (n *Notes) commentFormer(urlPath string, md []byte) html.RenderNodeFunc {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return func(w io.Writer, node ast.Node, entering bool) (ast.WalkStatus, bool) {
|
return func(w io.Writer, node ast.Node, entering bool) (ast.WalkStatus, bool) {
|
||||||
if heading, ok := node.(*ast.Heading); ok && !entering {
|
if heading, ok := node.(*ast.Heading); !n.ro && ok && !entering {
|
||||||
nextHeader()
|
nextHeader()
|
||||||
fmt.Fprintf(w, `
|
fmt.Fprintf(w, `
|
||||||
<form method="POST" action=%q class="comment">
|
<form method="POST" action=%q class="comment">
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,12 @@ import "local/notes-server/config"
|
||||||
|
|
||||||
type Notes struct {
|
type Notes struct {
|
||||||
root string
|
root string
|
||||||
|
ro bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func New() *Notes {
|
func New() *Notes {
|
||||||
return &Notes{
|
return &Notes{
|
||||||
root: config.Root,
|
root: config.Root,
|
||||||
|
ro: config.ReadOnly,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue