Back

Pull in your SEO Friendly Meta Description & Keywords

Description

The SEO fields in Page Properties > Advanced Properties collect meta description and meta keywords.  A simple regex string replace here to remove leading & trailing white space.

Code

#set($RegexPatternLeadingWhiteSpaceTrailingLineBreaks = "(^\s*|[\n\t\r])")
#if ($UtilMethods.isSet($HTMLPAGE_KEYWORDS))
	<META name="keywords" lang="en-us" content="$HTMLPAGE_KEYWORDS.replaceAll($RegexPatternLeadingWhiteSpaceTrailingLineBreaks, "")">
#end
#if ($UtilMethods.isSet($HTMLPAGE_DESCRIPTION))
	<META name="description" lang="en-us" content="$HTMLPAGE_DESCRIPTION.replaceAll($RegexPatternLeadingWhiteSpaceTrailingLineBreaks, "")">
#end