Skip to content

Instantly share code, notes, and snippets.

@nathanhornby
Last active July 11, 2022 20:06
Show Gist options
  • Save nathanhornby/4575744 to your computer and use it in GitHub Desktop.
Save nathanhornby/4575744 to your computer and use it in GitHub Desktop.
An HTML5 master utility template for SymphonyCMS (XSLT).
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8" indent="yes" />
<xsl:template match="/">
<xsl:text disable-output-escaping="yes">&lt;</xsl:text>!DOCTYPE html<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
<xsl:text disable-output-escaping="yes"><![CDATA[
<!--[if lt IE 7 ]> <html lang="en" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js lt-ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
]]></xsl:text>
<head prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article#">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<!-- Meta -->
<title>TITLE</title>
<meta name="description" content="DESC" />
<meta name="keywords" content="KEYW" />
<!-- Open Graph Meta -->
<meta property="og:title" content="TITLE" />
<meta property="og:description" content="DESC" />
<meta property="og:type" content="TYPE" />
<meta property="og:url" content="URL" />
<meta property="og:image" content="IMG" />
<meta property="og:site_name" content="TITLE" />
<link rel="shortcut icon" href="IMG" />
<!-- Stylesheets -->
<link rel="stylesheet" href="CSS" />
<!-- HTML5 tag fix -->
<xsl:text disable-output-escaping="yes"><![CDATA[
<!--[if lt IE 9 ]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
]]></xsl:text>
</head>
<body>
<!-- Page content -->
<xsl:apply-templates/>
<!-- Page content End -->
<!-- JavaScript -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="JS"></script>
</body>
<xsl:text disable-output-escaping="yes"><![CDATA[</html>]]></xsl:text>
</xsl:template>
<xsl:strip-space elements="*"/>
</xsl:stylesheet>
@animaux
Copy link

animaux commented Mar 24, 2015

Using this: do you get the <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">-part still in your HTML too?

Aparently it’s valid, but an unneccessary double of the <meta charset="UTF-8" />.

@nathanhornby
Copy link
Author

That would be generated by Symphony if I understand correctly - you may well be safe omitting the specific declaration in the head

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment