sloria / sublime-html5-boilerplate

Sublime Text 2/3 snippet to generate HTML5 boilerplate
47 stars 65 forks source link

Sublime HTML5 Boilerplate

A Sublime Text 2/3 snippet to generate the HTML5 Boilerplate (v6.0.1) template.

Install

Option 1: Manual

Copy the files to your Packages directory.

Option 2: Package Control

In the command pallette (Cmd-Shift+P on Mac) type 'Install' then press enter to see a list of packages. Search for 'HTML Boilerplate' then press enter to install.

Usage

With a blank saved HTML file open, type

htmlboiler

and press TAB.

That generates:

<!doctype html>
<html class="no-js" lang="">
<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>${1}</title>
    <meta name="description" content="${2}">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="manifest" href="https://github.com/sloria/sublime-html5-boilerplate/blob/master/site.webmanifest">
    <link rel="apple-touch-icon" href="https://github.com/sloria/sublime-html5-boilerplate/blob/master/icon.png">
    <!-- Place favicon.ico in the root directory -->

    <link rel="stylesheet" href="https://github.com/sloria/sublime-html5-boilerplate/blob/master/css/normalize.css">
    <link rel="stylesheet" href="https://github.com/sloria/sublime-html5-boilerplate/blob/master/css/main.css">
</head> 
<body>
    <!--[if lte IE 9]>
        <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience and security.</p>
    <![endif]-->

    <!-- Add your site or application content here -->
    <p>Hello world! This is HTML5 Boilerplate.</p>
    <script src="https://github.com/sloria/sublime-html5-boilerplate/raw/master/js/vendor/modernizr-3.5.0.min.js"></script>
    <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
    <script>window.jQuery || document.write('<script src="https://github.com/sloria/sublime-html5-boilerplate/raw/master/js/vendor/jquery-3.2.1.min.js"><\/script>')</script>
    <script src="https://github.com/sloria/sublime-html5-boilerplate/raw/master/js/plugins.js"></script>
    <script src="https://github.com/sloria/sublime-html5-boilerplate/raw/master/js/main.js"></script>

    <!-- Google Analytics: change UA-XXXXX-Y to be your site's ID. -->
    <script>
        window.ga=function(){ga.q.push(arguments)};ga.q=[];ga.l=+new Date;
        ga('create','UA-XXXXX-Y','auto');ga('send','pageview')
    </script>
    <script src="https://www.google-analytics.com/analytics.js" async defer></script>
</body>
</html>

License

MIT Licensed.