diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-02-27 13:36:58 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-02-27 17:59:36 +0100 |
commit | 5f671515504b56d7d1906fa2d17e72de49d84437 (patch) | |
tree | da3e8ea491e7ad9603fa13b494a66baa88b7b780 /tpl/diagrams | |
parent | f7109771a038e0237350dcfbe20f1036e9c8a46b (diff) |
tpl/diagrams: Rename Body to Inner
This relates to #9577 – there's no concept a body element in SVG, so we might as well use an exsisting "Hugo term".
Diffstat (limited to 'tpl/diagrams')
-rw-r--r-- | tpl/diagrams/diagrams.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tpl/diagrams/diagrams.go b/tpl/diagrams/diagrams.go index 1bdbc2a02..b0ddf5a42 100644 --- a/tpl/diagrams/diagrams.go +++ b/tpl/diagrams/diagrams.go @@ -25,9 +25,17 @@ import ( ) type SVGDiagram interface { - Body() template.HTML + // Inner returns the inner markup of the SVG. + // This allows for the <svg> container to be created manually. + Inner() template.HTML + + // SVG returns the diagram as an SVG, including the <svg> container. SVG() template.HTML + + // Width returns the width of the SVG. Width() int + + // Height returns the height of the SVG. Height() int } @@ -35,7 +43,7 @@ type goatDiagram struct { d goat.SVG } -func (d goatDiagram) Body() template.HTML { +func (d goatDiagram) Inner() template.HTML { return template.HTML(d.d.Body) } |