Permalink
Browse files

- make an article layout. Much is duplicated from 'landing'. Will

  refactor later.
  • Loading branch information...
jordansissel committed Mar 17, 2012
1 parent 03e57ca commit 049a4b6834f6ef4d908c45fd1a99cd50f9e97b3d
Showing with 126 additions and 0 deletions.
  1. +89 −0 _layouts/article.html
  2. +37 −0 js/article.js
View
@@ -0,0 +1,89 @@
+<!DOCTYPE html>
+<html class="no-js" lang="en"a>
+<head>
+ <meta charset="utf-8">
+
+ <!-- Use the .htaccess and remove these lines to avoid edge case issues.
+ More info: h5bp.com/i/378 -->
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+
+ <title>{{ page.title }} - lol, logging.</title>
+ <meta name="description" content="lol, logging.">
+
+ <!-- Mobile viewport optimized: h5bp.com/viewport -->
+ <meta name="viewport" content="width=device-width">
+
+ <!-- Place favicon.ico and apple-touch-icon.png in the root directory: mathiasbynens.be/notes/touch-icons -->
+
+ <link rel="stylesheet" href="{{ site.baseurl }}/css/style.css">
+ <link href='http://fonts.googleapis.com/css?family=Signika+Negative|Gudea|Noticia+Text' rel='stylesheet' type='text/css'>
+
+
+ <!-- More ideas for your <head> here: h5bp.com/d/head-Tips -->
+
+ <!-- All JavaScript at the bottom, except this Modernizr build.
+ Modernizr enables HTML5 elements & feature detects for optimal performance.
+ Create your own custom Modernizr build: www.modernizr.com/download/ -->
+ <script src="{{ site.baseurl }}/js/libs/modernizr-2.5.3.min.js"></script>
+ <style>
+ /* This is necessary because I don't know how to make Jekyll do template
+ * processing on sass/css files */
+ .logstashize .inner {
+ background: url("{{ site.baseurl }}/img/logstash.png") top right no-repeat;
+ }
+ </style>
+</head>
+<body class="landing">
+ <!-- Prompt IE 6 users to install Chrome Frame. Remove this if you support IE 6.
+ chromium.org/developers/how-tos/chrome-frame-getting-started -->
+ <!--[if lt IE 7]><p class=chromeframe>Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p><![endif]-->
+ <header>
+ <span class="logo">
+ <a href="{{site.baseurl}}/">
+ lol, logging.
+ </a>
+ </span>
+ <span class="edit-this-page">
+ <script>
+ document.writeln(
+ '<a href="http://github.com/jordansissel/lol-logging/edit/master/'
+ + '{{page.url}}'.replace('.html', '.md').replace(/^\//, '')
+ + '">[edit this page]</a>'
+ );
+ </script>
+ </span>
+ </header>
+
+ <div role="main" id="content">
+ {{ content }}
+ </div>
+
+ <!--
+ <footer class="footer">
+ footer
+ </footer>
+ -->
+
+ <!-- JavaScript at the bottom for fast page loading -->
+
+ <!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
+ <script>window.jQuery || document.write('<script src="{{ site.baseurl }}/js/libs/jquery-1.7.1.min.js"><\/script>')</script>
+
+ <!-- scripts concatenated and minified via build script -->
+ <script src="{{ site.baseurl }}/js/plugins.js"></script>
+ <script src="{{ site.baseurl }}/js/article.js"></script>
+ <!-- end scripts -->
+
+ <!-- Asynchronous Google Analytics snippet. Change UA-XXXXX-X to be your site's ID.
+ mathiasbynens.be/notes/async-analytics-snippet -->
+ <!--
+ <script>
+ var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']];
+ (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
+ g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
+ s.parentNode.insertBefore(g,s)}(document,'script'));
+ </script>
+ -->
+</body>
+</html>
View
@@ -0,0 +1,37 @@
+$(document).ready(function() {
+
+ /* Wrap markdown sections
+ *
+ * Take the a selector (h1, h2, etc) up until the next tag
+ * that usually marks a section (h1, h2, etc), and wrap all of
+ * that in a <div> with a given css_class */
+ var markdownwrapper = function(selector, css_class_list) {
+ var section_break_elements = [ "H1", "H2", "H3" ]
+ var count = 0;
+ $(selector).each(function(i, element) {
+ var current = $(element)
+ var contents = [current];
+ for (var el = current.next(); el && el.size() > 0 ; el = el.next()) {
+ var tag = el.get(0).tagName;
+ if ($.inArray(tag, section_break_elements) >= 0) {
+ break;
+ }
+ contents.push(el);
+ }
+
+ var outer = $("<div>");
+ outer.insertAfter(current);
+ var inner = $("<div>")
+ $.each(css_class_list, function(i, value) { outer.addClass(value) })
+ $.each(contents, function(i, value) {
+ inner.append(value);
+ });
+ outer.addClass("outer")
+ inner.addClass("inner")
+ outer.append(inner)
+
+ }); /* $(selector).each */
+ }/* markdownwrapper */
+
+ markdownwrapper("#content h1", ["article-splash", "logstashize"]);
+});

0 comments on commit 049a4b6

Please sign in to comment.