feat(sidebar): Add sidebar support

This commit is contained in:
Michael Beemer
2021-06-17 14:56:27 -04:00
parent a9bb6df01f
commit 75717374a8
4 changed files with 19 additions and 5 deletions

View File

@@ -19,6 +19,7 @@ const (
HeaderAttachment = `Attachment`
HeaderLabel = `Label`
HeaderInclude = `Include`
HeaderSidebar = `Sidebar`
)
type Meta struct {
@@ -27,6 +28,7 @@ type Meta struct {
Type string
Title string
Layout string
Sidebar string
Attachments map[string]string
Labels []string
}
@@ -96,6 +98,10 @@ func ExtractMeta(data []byte) (*Meta, []byte, error) {
case HeaderLayout:
meta.Layout = strings.TrimSpace(value)
case HeaderSidebar:
meta.Layout = "article"
meta.Sidebar = strings.TrimSpace(value)
case HeaderAttachment:
meta.Attachments[value] = value

View File

@@ -95,7 +95,7 @@ func templates(api *confluence.API) (*template.Template, error) {
/**/ `<ac:layout>`,
/**/ `<ac:layout-section ac:type="two_right_sidebar">`,
/**/ `<ac:layout-cell>{{ .Body }}</ac:layout-cell>`,
/**/ `<ac:layout-cell></ac:layout-cell>`,
/**/ `<ac:layout-cell>{{ .Sidebar }}</ac:layout-cell>`,
/**/ `</ac:layout-section>`,
/**/ `</ac:layout>`,
`{{ else }}`,