Skip to content

Instantly share code, notes, and snippets.

@stevenkuipers
Last active August 2, 2018 13:26
Show Gist options
  • Save stevenkuipers/46a85785f512fdeabe5687d953beb9d6 to your computer and use it in GitHub Desktop.
Save stevenkuipers/46a85785f512fdeabe5687d953beb9d6 to your computer and use it in GitHub Desktop.
Atom snippet for more advanced HTML boilerplate
# A snippet for ATOM editor
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# One of the packages that come with ATOM is language-html, this package provides snippets
# for a most HTML-tags, including <html>
# I find it lacking in some places so I extended it.
#
# * Copy the following code into snippets.cson in you ATOM editor.
# * Create a new file with extension .html,
# * type html-advanced and press tab.
# * All variables that need your attention you can tab thru, starting at title, and fill out as needed.
{
".text.html.basic": {
'HTML':
'prefix': 'html-advanced'
'body': '<!DOCTYPE html>\n<html lang="${4:en}" dir="ltr" prefix="og: http://ogp.me/ns#">\n\t<head>\n\t\t<meta charset="utf-8">\n\t\t <!-- Instruct Internet Explorer to use its latest rendering engine -->\n\t\t<meta http-equiv="x-ua-compatible" content="ie=edge">\n\t\t<meta name="description" content="${2:description}">\n\t\t<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">\n\t\t<!-- Global site tag (gtag.js) - Google Analytics -->\n\t\t<!-- Replace GA_TRACKING_ID with the tracking ID of the Google Analytics property to which you want to send data. -->\n\t\t<script async src="https://www.googletagmanager.com/gtag/js?id=${3:GA_TRACKING_ID}"></script>\n\t\t<script>\n\t\t\t
window.dataLayer = window.dataLayer || [];\n\t\t\t
function gtag(){dataLayer.push(arguments);}\n\t\t\t
gtag(\'js\', new Date());\n\t\t\t
gtag(\'config\', \'${3:GA_TRACKING_ID}\');\n\t\t</script>\n\n\t\t<!-- Twitter Card and Facebook Open graph social media info -->\n\t\t
<meta name="twitter:card" content="summary" />\n\t\t
<meta property="og:url" content="https://${5:url}" />\n\t\t
<meta property="og:title" content="${1:title}" />\n\t\t
<meta property="og:type" content="${7:website}" />\n\t\t
<meta property="og:description" content="${2:description}" />\n\t\t
<meta property="og:image" content="${8:url}" />
\n\t\t<title>${1:title}</title>\n\t</head>\n\t<body>\n\t\t$9\n\t\n\n\t</body>\n</html>'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment