Helper Functions 
The seomatic.helper functions are utilities that can help with pagination, previews, and preparing text and Assets.
seomatic.helper.paginate(PAGEINFO)– Given thePAGEINFOvariable from the{% paginate %}tag as described here, this will properly set thecanonicalUrl, as well as adding the<link rel='prev'>and<link rel='next'>tags for you.seomatic.helper.isPreview()– Returnstrueif the current request is a preview,falseif it is not.seomatic.helper.sameAsByHandle(HANDLE)– Returns an array of information about the Same As URLs site specified inHANDLE. Here’s an example of the information in the returned array:phparray (size=4) 'siteName' => string 'Twitter' 'handle' => string 'twitter' 'url' => string 'https://twitter.com/nystudio107' 'account' => string 'nystudio107'seomatic.helper.truncate(TEXT, LENGTH, SUBSTR)– Truncates theTEXTto a givenLENGTH. IfSUBSTRis provided, and truncating occurs, the string is further truncated so that the substring may be appended without exceeding the desired length.seomatic.helper.truncateOnWord(TEXT, LENGTH, SUBSTR)– Truncates theTEXTto a givenLENGTH, while ensuring that it does not split words. IfSUBSTRis provided, and truncating occurs, the string is further truncated so that the substring may be appended without exceeding the desired length.seomatic.helper.getLocalizedUrls(URI, SITE_ID)– Return a list of localized URLs for a givenURIthat are in theSITE_IDsite’s group. BothURIandSITE_IDare optional, and will use the current request’sURIand the current site’sSITE_IDif omitted.seomatic.helper.loadMetadataForUri(URI, SITE_ID)– Load the appropriate meta containers for the givenURIand optionalSITE_ID.seomatic.helper.sitemapIndexForSiteId(SITE_ID)– Get the URL to theSITE_IDs sitemap indexseomatic.helper.extractTextFromField(FIELD)– Extract plain text from a PlainText, Redactor, CKEdtior, Tags, Matrix, or Neo field.seomatic.helper.extractKeywords(TEXT, LIMIT)– Extract up toLIMITmost important keywords fromTEXT.seomatic.helper.extractSummary(TEXT)– Extract the most important 3 sentences fromTEXT.seomatic.helper.socialTransform(ASSET, TRANSFORMNAME)– Transform theASSET(either an Asset or an Asset ID) for social media sites inTRANSFORMNAME; valid values arebase,facebook,twitter-summary, andtwitter-large.seomatic.helper.seoFileLink(FILE_URL, ROBOTS, CANONICAL, INLINE)– Generates a link to a local or remote file that allows you to set theX-Robots-Tagheader viaROBOTS(defaults toall) andLinkcanonical header viaCANONICAL(defaults to'') as per Advanced rel="canonical" HTTP Headers.INLINEcontrols whether the file will be displayed inline or downloaded. If any values are empty'', the headers will not be included.seomatic.helper.sanitizeUserInput(TEXT)– Sanitize theTEXTby decoding any HTML Entities, URL decoding the text, then removing any newlines, stripping HTML tags, stripping Twig tags, and changing single {}'s into ()'s.