Skip to content

Instantly share code, notes, and snippets.

@joshcoast
Created August 19, 2014 20:48
Show Gist options
  • Save joshcoast/9f04d0679b1228b3bd6f to your computer and use it in GitHub Desktop.
Save joshcoast/9f04d0679b1228b3bd6f to your computer and use it in GitHub Desktop.
MODX Meta Tags
[[if?
&subject=`[[*titleTag]]`
&operator=`!empty`
&then=`<title>[[*titleTag]]</title>`
&else=`<title>[[*pagetitle]], [[++site_name]]</title>`
]]
[[if?
&subject=`[[*descriptionTag]]`
&operator=`!empty`
&then=`<meta name="description" content="[[*descriptionTag]]">`
&else=`<meta name="description" content="YOUR DEFAULT DISCRIPTION">`
]]
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width">
<meta property="og:site_name" content="YOUR SITE NAME"/>
[[if?
&subject=`[[*ogTitle]]`
&operator=`!empty`
&then=`<meta property="og:title" content="[[*ogTitle]]">`
&else=`<meta property="og:title" content="YOUR DEFAULT OG TITLE"/>`
]]
[[if?
&subject=`[[*ogImage]]`
&operator=`!empty`
&then=`<meta property="og:image" content="[[*ogImage]]">`
]]
<meta property="og:image" content="[[!++site_url]]/og-pic-full.jpg">
<meta property="og:image:type" content="image/jpeg">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
[[if?
&subject=`[[*ogDescription]]`
&operator=`!empty`
&then=`<meta property="og:description" content="[[*ogDescription]]">`
&else=`<meta property="og:description" content="YOUR DEFAULT OG DESCRIPTION"/>`
]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment