Add recently-updated macro

This commit is contained in:
Manuel Rüger 2023-07-05 17:28:59 +02:00
parent ac982f3077
commit bf16d55d68
2 changed files with 50 additions and 28 deletions

View File

@ -447,6 +447,15 @@ By default, mark provides several built-in templates and macros:
- TitleColor: Text color of the title
- BorderStyle: Style of the panel's border
* template `ac:recently-updated` to display a list of most recently changed content
- Spaces: List of Spaces to watch (optional, default is current Space)
- ShowProfilePic: Show profile picture of editor
- Max: Maximum number of changes
- Types: Include these content types only (comments, blogposts, pages)
- Theme: Apperance of the macro (concise, social, sidebar)
- HideHeading: Determines whether the macro hides or displays the text 'Recently Updated' as a title above the list of content
- Labels: Filter the results by label. The macro will display only the pages etc which are tagged with the label(s) you specify here.
* macro `@{...}` to mention user by name specified in the braces.
## Template & Macros Usecases

View File

@ -406,6 +406,19 @@ func templates(api *confluence.API) (*template.Template, error) {
`</ac:structured-macro>`,
),
/* */
`ac:recently-updated`: text(
`<ac:structured-macro ac:name="recently-updated">`,
`{{ if .Spaces }}<ac:parameter ac:name="spaces"><ri:space ri:space-key={{ .Spaces }}/></ac:parameter>{{ end }}`,
`<ac:parameter ac:name="showProfilePic">{{ or .ShowProfilePic "" }}</ac:parameter>`,
`<ac:parameter ac:name="types">{{ or .Types "page, comment, blogpost" }}</ac:parameter>`,
`<ac:parameter ac:name="max">{{ or .Max "" }}</ac:parameter>`,
`<ac:parameter ac:name="labels">{{ or .Labels "" }}</ac:parameter>`,
`<ac:parameter ac:name="hideHeading">{{ or .HideHeading "" }}</ac:parameter>`,
`<ac:parameter ac:name="theme">{{ or .Theme "" }}</ac:parameter>`,
`</ac:structured-macro>`,
),
// TODO(seletskiy): more templates here
} {
templates, err = templates.New(name).Parse(body)