html: Export "#+HUGO: more" as <!--more-->
This commit is contained in:
parent
144f2ce84f
commit
16a978fe48
4 changed files with 17 additions and 3 deletions
|
@ -163,9 +163,11 @@ func (w *HTMLWriter) writeDrawer(d Drawer) {
|
||||||
w.writeNodes(d.Children...)
|
w.writeNodes(d.Children...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *HTMLWriter) writeKeyword(k Keyword) {
|
func (w *HTMLWriter) writeKeyword(kw Keyword) {
|
||||||
if k.Key == "HTML" {
|
if k, v := kw.Key, kw.Value; k == "HTML" {
|
||||||
w.WriteString(k.Value + "\n")
|
w.WriteString(v + "\n")
|
||||||
|
} else if k == "HUGO" && v == "more" {
|
||||||
|
w.WriteString("<!--more-->\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
4
org/testdata/keywords.html
vendored
4
org/testdata/keywords.html
vendored
|
@ -16,3 +16,7 @@ and an image with custom html attributes and a caption
|
||||||
kittens!
|
kittens!
|
||||||
</figcaption>
|
</figcaption>
|
||||||
</figure>
|
</figure>
|
||||||
|
<p>
|
||||||
|
This will be exported as <!–more–> just for hugo
|
||||||
|
</p>
|
||||||
|
<!--more-->
|
||||||
|
|
4
org/testdata/keywords.org
vendored
4
org/testdata/keywords.org
vendored
|
@ -12,3 +12,7 @@ and an image with custom html attributes and a caption
|
||||||
#+ATTR_HTML: :style height: 100%; :id overwritten
|
#+ATTR_HTML: :style height: 100%; :id overwritten
|
||||||
#+ATTR_HTML: :style border: 10px solid black; :id kittens
|
#+ATTR_HTML: :style border: 10px solid black; :id kittens
|
||||||
[[https://placekitten.com/200/200#.png]]
|
[[https://placekitten.com/200/200#.png]]
|
||||||
|
|
||||||
|
|
||||||
|
This will be exported as <!--more--> just for hugo
|
||||||
|
#+HUGO: more
|
||||||
|
|
4
org/testdata/keywords.pretty_org
vendored
4
org/testdata/keywords.pretty_org
vendored
|
@ -12,3 +12,7 @@ and an image with custom html attributes and a caption
|
||||||
#+ATTR_HTML: :style height: 100%; :id overwritten
|
#+ATTR_HTML: :style height: 100%; :id overwritten
|
||||||
#+ATTR_HTML: :style border: 10px solid black; :id kittens
|
#+ATTR_HTML: :style border: 10px solid black; :id kittens
|
||||||
[[https://placekitten.com/200/200#.png]]
|
[[https://placekitten.com/200/200#.png]]
|
||||||
|
|
||||||
|
|
||||||
|
This will be exported as <!--more--> just for hugo
|
||||||
|
#+HUGO: more
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue