| @ -1,39 +0,0 @@ | |||
| WINTERSMITH = ./node_modules/.bin/wintersmith | |||
| ARTICLE_DIR = ./contents/writing/about | |||
| build: | |||
| @./node_modules/.bin/cleancss ./contents/css/main.css > ./contents/css/main.min.css | |||
| @$(WINTERSMITH) build | |||
| clean: | |||
| @rm -rf build | |||
| preview: | |||
| @$(WINTERSMITH) preview | |||
| add_article: | |||
| @echo "Enter Article Title: " | |||
| @read title;\ | |||
| dir=`echo $$title | sed "s/ /-/g" | tr "[:upper:]" "[:lower:]"`;\ | |||
| mkdir -p $(ARTICLE_DIR)/$$dir;\ | |||
| cat base.md | sed "s/{title}/$$title/g" | sed s/{date}/`date "+%Y-%m-%d"`/g> $(ARTICLE_DIR)/$$dir/index.md;\ | |||
| $$EDITOR $(ARTICLE_DIR)/$$dir/index.md | |||
| remove_article: | |||
| @echo "Enter Article Title: " | |||
| @read title;\ | |||
| dir=`echo $$title | sed "s/ /-/g"`;\ | |||
| rm -rf $(ARTICLE_DIR)/$$dir | |||
| edit_article: | |||
| @echo "Enter Article Title: " | |||
| @read title;\ | |||
| dir=`echo $$title | sed "s/ /-/g"`;\ | |||
| $$EDITOR $(ARTICLE_DIR)/$$dir/index.md | |||
| pull: | |||
| git pull origin master | |||
| update: pull build | |||
| .PHONY: build clean preview add_article remove_article edit_article pull update | |||
| @ -1,10 +0,0 @@ | |||
| --- | |||
| title: {title} | |||
| author: Brett Langdon | |||
| date: {date} | |||
| template: article.jade | |||
| --- | |||
| Summary | |||
| --- | |||
| @ -1,27 +0,0 @@ | |||
| { | |||
| "locals": { | |||
| "url": "http://brett.is", | |||
| "name": "Brett.Is", | |||
| "owner": "Brett Langdon", | |||
| "description": "A geek with a blog" | |||
| }, | |||
| "plugins": [ | |||
| "./plugins/paginator.coffee" | |||
| ], | |||
| "require": { | |||
| "moment": "moment", | |||
| "_": "underscore", | |||
| "typogr": "typogr" | |||
| }, | |||
| "jade": { | |||
| "pretty": true | |||
| }, | |||
| "markdown": { | |||
| "smartLists": true, | |||
| "smartypants": true, | |||
| "gfm": true | |||
| }, | |||
| "paginator": { | |||
| "perPage": 3 | |||
| } | |||
| } | |||
| @ -1,27 +0,0 @@ | |||
| { | |||
| "name": "brett.is", | |||
| "version": "0.1.0", | |||
| "description": "Personal blog of Brett Langdon", | |||
| "main": "", | |||
| "private": true, | |||
| "dependencies": { | |||
| "clean-css": "^2.2.2", | |||
| "moment": "~2.3.1", | |||
| "typogr": "~0.5.2", | |||
| "underscore": "~1.4.4", | |||
| "wintersmith": "~2.0.8" | |||
| }, | |||
| "devDependencies": {}, | |||
| "scripts": { | |||
| "test": "echo \"Error: no test specified\" && exit 1" | |||
| }, | |||
| "repository": { | |||
| "type": "git", | |||
| "url": "git://github.com/brettlangdon/brett.is.git" | |||
| }, | |||
| "author": "Brett Langdon <brett@blangdon.com> (http://brett.is)", | |||
| "license": "MIT", | |||
| "bugs": { | |||
| "url": "https://github.com/brettlangdon/brett.is/issues" | |||
| } | |||
| } | |||
| @ -1,86 +0,0 @@ | |||
| module.exports = (env, callback) -> | |||
| ### Paginator plugin. Defaults can be overridden in config.json | |||
| e.g. "paginator": {"perPage": 10} ### | |||
| defaults = | |||
| template: 'index.jade' # template that renders pages | |||
| first: 'index.html' # filename/url for first page | |||
| filename: 'page/%d/index.html' # filename for rest of pages | |||
| perPage: 2 # number of articles per page | |||
| # assign defaults any option not set in the config file | |||
| options = env.config.paginator or {} | |||
| for key, value of defaults | |||
| options[key] ?= defaults[key] | |||
| getArticles = (contents) -> | |||
| # helper that returns a list of articles found in *contents* | |||
| # note that each article is assumed to have its own directory in the articles directory | |||
| articles = contents.writing.about._.directories.map (item) -> item.index | |||
| articles.sort (a, b) -> b.date - a.date | |||
| return articles | |||
| class PaginatorPage extends env.plugins.Page | |||
| ### A page has a number and a list of articles ### | |||
| constructor: (@pageNum, @articles) -> | |||
| getFilename: -> | |||
| if @pageNum is 1 | |||
| options.first | |||
| else | |||
| options.filename.replace '%d', @pageNum | |||
| getView: -> (env, locals, contents, templates, callback) -> | |||
| # simple view to pass articles and pagenum to the paginator template | |||
| # note that this function returns a funciton | |||
| # get the pagination template | |||
| template = templates[options.template] | |||
| if not template? | |||
| return callback new Error "unknown paginator template '#{ options.template }'" | |||
| # setup the template context | |||
| ctx = {@articles, @prevPage, @nextPage} | |||
| # extend the template context with the enviroment locals | |||
| env.utils.extend ctx, locals | |||
| # finally render the template | |||
| template.render ctx, callback | |||
| # register a generator, 'paginator' here is the content group generated content will belong to | |||
| # i.e. contents._.paginator | |||
| env.registerGenerator 'paginator', (contents, callback) -> | |||
| # find all articles | |||
| articles = getArticles contents | |||
| # populate pages | |||
| numPages = Math.ceil articles.length / options.perPage | |||
| pages = [] | |||
| for i in [0...numPages] | |||
| pageArticles = articles.slice i * options.perPage, (i + 1) * options.perPage | |||
| pages.push new PaginatorPage i + 1, pageArticles | |||
| # add references to prev/next to each page | |||
| for page, i in pages | |||
| page.prevPage = pages[i - 1] | |||
| page.nextPage = pages[i + 1] | |||
| # create the object that will be merged with the content tree (contents) | |||
| # do _not_ modify the tree directly inside a generator, consider it read-only | |||
| rv = {pages:{}} | |||
| for page in pages | |||
| rv.pages["#{ page.pageNum }.page"] = page # file extension is arbitrary | |||
| rv['index.page'] = pages[0] # alias for first page | |||
| # callback with the generated contents | |||
| callback null, rv | |||
| # add the article helper to the environment so we can use it later | |||
| env.helpers.getArticles = getArticles | |||
| # tell the plugin manager we are done | |||
| callback() | |||
| @ -1,5 +0,0 @@ | |||
| extends layout | |||
| block content | |||
| h3 Could not find the page you were logging for. | |||
| @ -1,37 +0,0 @@ | |||
| extends layout | |||
| //- this logic should be moved to a view at some point | |||
| block content | |||
| - var lineHeight = 2.2; | |||
| - var archives = _.chain(env.helpers.getArticles(contents)).groupBy(function(item) { | |||
| - return item.date.getFullYear() | |||
| - }).value() | |||
| - for (var archive in archives) { | |||
| - archives[archive] = _.groupBy(archives[archive], function(item){return item.date.getMonth();}) | |||
| - } | |||
| - var month_names = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] | |||
| section.archive | |||
| h2 Archive | |||
| ul | |||
| - var yearsK = _.chain(archives).keys().reverse().value() | |||
| - for(var year in yearsK) | |||
| - months = archives[yearsK[year]] | |||
| - var yearHeight = lineHeight * _.reduce(months, function(memo,month) { return memo + month.length; }, 0); | |||
| li | |||
| span.year-label(style='line-height:' + yearHeight+'em')=yearsK[year] | |||
| ul(style='margin-left:4em') | |||
| - var monthsK = _.chain(months).keys().reverse().value() | |||
| - for(month in monthsK){ | |||
| - var monthHeight = lineHeight * months[monthsK[month]].length | |||
| li | |||
| span.month-label(style='line-height:'+monthHeight+'em')=month_names[monthsK[month]] | |||
| ul(style='margin-left:7em') | |||
| each item in months[monthsK[month]] | |||
| li(style='height:'+ lineHeight + 'em;line-height:'+ lineHeight + 'em;') | |||
| a(href=item.url)=item.title | |||
| - } | |||
| block prepend footer | |||
| div.nav | |||
| a(href="/") Home » | |||
| @ -1,24 +0,0 @@ | |||
| include mixins/disqus | |||
| extends layout | |||
| block append vars | |||
| - bodyclass = 'article-detail' | |||
| block prepend title | |||
| | #{ page.title + " - "} | |||
| block append header | |||
| h1= page.title | |||
| p.author | |||
| | Written by #{page.metadata.author} | |||
| block content | |||
| article.article | |||
| section.content!= typogr(page.html).typogrify() | |||
| section.comments | |||
| +disqus | |||
| block prepend footer | |||
| div.nav | |||
| a(href=contents.index.url) « Home | |||
| @ -1,25 +0,0 @@ | |||
| doctype xml | |||
| rss(version='2.0', | |||
| xmlns:content='http://purl.org/rss/1.0/modules/content/', | |||
| xmlns:wfw='http://wellformedweb.org/CommentAPI/', | |||
| xmlns:dc='http://purl.org/dc/elements/1.1/' | |||
| xmlns:atom='http://www.w3.org/2005/Atom') | |||
| channel | |||
| - var articles = env.helpers.getArticles(contents); | |||
| title= locals.name | |||
| atom:link(href=locals.url + '/feed.xml', rel='self', type='application/rss+xml') | |||
| link= locals.url | |||
| description= locals.description | |||
| pubDate= articles[0].rfc822date | |||
| generator Wintersmith - https://github.com/jnordberg/wintersmith | |||
| language en | |||
| for article in articles | |||
| - var permalink = locals.url + article.url | |||
| item | |||
| title= article.title | |||
| link= permalink | |||
| pubDate= article.rfc822date | |||
| guid(isPermaLink='true')= permalink | |||
| author= article.author | |||
| //- passing locals.url resolves all relative urls to absolute | |||
| description= article.getHtml(locals.url) | |||
| @ -1,23 +0,0 @@ | |||
| extends layout | |||
| block content | |||
| each article in articles | |||
| article.article.intro | |||
| header | |||
| p.date | |||
| span= moment.utc(article.date).format('DD. MMMM YYYY') | |||
| h2 | |||
| a(href=article.url)= article.title | |||
| section.content !{typogr(article.intro).typogrify()} | |||
| if article.hasMore | |||
| p.more | |||
| a(href=article.url) more | |||
| block prepend footer | |||
| div.nav | |||
| if prevPage | |||
| a(href=prevPage.url) « Newer | |||
| else | |||
| a(href='/archive.html') « Archives | |||
| if nextPage | |||
| a(href=nextPage.url) Older » | |||
| @ -1,56 +0,0 @@ | |||
| doctype html | |||
| block vars | |||
| - var bodyclass = null; | |||
| html(lang='en') | |||
| head | |||
| block head | |||
| meta(charset='utf-8') | |||
| meta(http-equiv='X-UA-Compatible', content='IE=edge,chrome=1') | |||
| meta(name='viewport', content='width=device-width') | |||
| title | |||
| block title | |||
| = locals.name | |||
| link(href='/favicon.ico', rel='shortcut icon', type='image/x-icon') | |||
| link(rel='alternate', href=locals.url+'/feed.xml', type='application/rss+xml', title=locals.description) | |||
| link(rel='stylesheet', href='//fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic|Anonymous+Pro:400,700,400italic,700italic|Merriweather:400,700,300') | |||
| link(rel='stylesheet', href='/css/main.min.css') | |||
| body(class=bodyclass) | |||
| header.header | |||
| div.content-wrap | |||
| block header | |||
| div.logo | |||
| h1 | |||
| a(href=locals.url) | |||
| img(src="/img/avatar.png") | |||
| = locals.name | |||
| p.description= locals.description | |||
| div#content | |||
| div.content-wrap | |||
| block content | |||
| h2 Welcome to brett.is! | |||
| div.ad | |||
| script(async, src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js") | |||
| ins.adsbygoogle(style="display:block", data-ad-client="ca-pub-3200991035275362" | |||
| data-ad-slot="4431182737", data-ad-format="auto") | |||
| footer | |||
| div.content-wrap | |||
| block footer | |||
| section.about | |||
| !=contents['about.md'].html | |||
| section.social-links | |||
| include mixins/social | |||
| +social_links | |||
| section.copy | |||
| p © #{ new Date().getFullYear() } #{ locals.owner } — powered by | |||
| a(href='https://github.com/jnordberg/wintersmith') Wintersmith | |||
| //- please leave the "powered by" if you use the design | |||
| script(type='text/javascript'). | |||
| (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |||
| (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |||
| m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |||
| })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |||
| ga('create', 'UA-34513423-1', 'brett.is'); | |||
| ga('send', 'pageview'); | |||
| (adsbygoogle = window.adsbygoogle || []).push({}); | |||
| @ -1,18 +0,0 @@ | |||
| mixin disqus | |||
| #disqus_thread | |||
| script(type="text/javascript"). | |||
| var disqus_shortname = 'brettlangdon'; | |||
| var disqus_identifier = 'http://brett.is#{page.url}'; | |||
| var disqus_title = '#{page.title.replace("\'", "")}'; | |||
| var disqus_url = "http://brett.is#{page.url}"; | |||
| (function() { | |||
| var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; | |||
| dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; | |||
| (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); | |||
| })(); | |||
| noscript | |||
| | Please enable JavaScript to view the | |||
| a(href="http://disqus.com/?ref_noscript")=" comments powered by Disqus." | |||
| a(href="http://disqus.com").dsq-brlink | |||
| | comments powered by | |||
| span.logo-disqus=" Disqus" | |||
| @ -1,17 +0,0 @@ | |||
| mixin link_img(type, link, image) | |||
| a(href=link, target="_blank") | |||
| img(src=image, title="Follow Me on: " + type, alt="Follow Me on: " + type) | |||
| mixin social_links | |||
| ul | |||
| li | |||
| +link_img("Twitter", "//www.twitter.com/#!/brett_langdon", "/img/twitter.png") | |||
| li | |||
| +link_img("Linkedin", "//www.linkedin.com/in/brettlangdon", "/img/linkedin.png") | |||
| li | |||
| +link_img("GitHub", "//github.com/brettlangdon", "/img/github.svg") | |||
| li | |||
| +link_img("RSS", "//brett.is/feed.xml", "/img/rss.png") | |||
| li | |||
| +link_img("E-Mail", "mailto:brett@blangdon.com", "/img/email.png") | |||
| span(style="clear:both") | |||