The properties of a document can be exported as metadata on an HTML page easily. This metadata such as keywords or DC.description is used by web crawlers or search engines to enhance user experience or the search rank ratings. To enable the rendering as metadata, add some Velocity statements to the 'Main Layout'. Content Marker |
---|
|
Code Block |
---|
| #if ($projectdocContext)
${projectdocContext.toHtml($sitemeshPage)}
#end |
|
To add the snippet, follow the following steps: - As admin user, select 'Layout' in the 'General configuration'
Image Removed Then click 'Create custom' (if you have not already applied changes to the layout) or 'Edit' (if there are already changes to the default provided by Confluence)
Note Box |
---|
If you have not customized your layout yet, you need to click on "Create custom" to create one instead of "Edit" as shown above. |
- Finally add the above snippet after the rendering of the meta elements
- Save the changes
Warning Box |
---|
Note that you need to define metadata sets to actually map properties to metadata keys used in the HTML header. Without this mapping properties get exported with keys that match their name (e.g. Tags instead of keywords ). Add a space property named Metadata Sets to your space homepage, with a value of DC, HTML . Image Added For more information please refer to Add HTML Meta Tags. |
|