Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lwjohnst86 committed Nov 1, 2015
0 parents commit c7b71d6
Show file tree
Hide file tree
Showing 15 changed files with 986 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Ignore everything ...


## ...But not ignore these files

10 changes: 10 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: default
title: "404: Page not found"
permalink: 404.html
---

<div class="page">
<h1 class="page-title">404: Page not found</h1>
<p class="lead">Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. <a href="{{ site.github.url }}">Head back home</a> to try finding it again.</p>
</div>
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
codeasmanuscript.org
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
##-------------------------------------------------------------------
# Variables
site_repo=`basename "$$PWD"`

## List of commands to use for Makefile.
all :
@grep -E '^##' Makefile | sed -e 's/##//g'
##-------------------------------------------------------------------
## test_local : Test the site locally before building live version
test_local :
jekyll serve --watch

## build_site : Build the GitHub pages site
build_site :
rsync -a --exclude='.git/' --exclude='.gitignore' ../workshops/ ../${site_repo}/
./knitpost.R
jekyll build
git clean -d -x -f

.PHONY : build_site test_local

30 changes: 30 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Dependencies
markdown: kramdown
highlighter: pygments

# Permalinks
permalink: pretty
relative_permalinks: false

# Setup
title: Code As Manuscript
tagline: 'Change the way you see your code.'
description: 'Writing your code and analyses as if <i>it</i> was the manuscript.'
url: http://codeasmanuscript.org

author:
name: 'Code As Manuscript'

# Custom vars
version: 2.1.0

github:
repo: https://github.com/codeasmanuscript

lesson-list: [Git, Intro, Plotting, Wrangling, Rmarkdown, Macros, ODS]
category-list: [R, Git, Macros, ODS, Lessons]
tag-list: [Lessons, Git, GitHub, Macros, ODS, Assignment, Slides, Cheatsheet]

exclude: ['lessons/template/*', gps/eventListing.md, '*.Rmd',
evals/, survey/, lessons/potentials.md, README.md]

29 changes: 29 additions & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<head>
<link href="http://gmpg.org/xfn/11" rel="profile">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=utf-8">

<!-- Enable responsiveness on mobile devices-->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">

<title>
{% if page.title == "Home" %}
{{ site.title }} &middot; {{ site.tagline }}
{% else %}
{{ page.title }} &middot; {{ site.title }}
{% endif %}
</title>

<!-- CSS -->
<link rel="stylesheet" href="{{ site.github.url }}/public/css/poole.css">
<link rel="stylesheet" href="{{ site.github.url }}/public/css/syntax.css">
<link rel="stylesheet" href="{{ site.github.url }}/public/css/hyde.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700|Abril+Fatface">

<!-- Icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ site.github.url }}/public/apple-touch-icon-144-precomposed.png">
<link rel="shortcut icon" href="{{ site.github.url }}/public/favicon.ico">

<!-- RSS -->
<link rel="alternate" type="application/rss+xml" title="RSS" href="/atom.xml">
</head>
36 changes: 36 additions & 0 deletions _includes/sidebar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<div class="sidebar">
<div class="container"> <!--sidebar-sticky? I deleted it from here-->
<div class="sidebar-about">
<h2>
<a href="{{ site.github.url }}">
{{ site.title }}
</a>
</h2>
<p class="lead">{{ site.description }}</p>
</div>

<nav class="sidebar-nav">
<a class="sidebar-nav-item{% if page.url == site.github.url %} active{% endif %}" href="{{ site.github.url }}/">Home</a>

{% comment %}
The code below dynamically generates a sidebar nav of pages with
`layout: page` in the front-matter. See readme for usage.
{% endcomment %}

{% assign pages_list = site.pages %}
{% for node in pages_list %}
{% if node.title != null %}
{% if node.sidebar == true %}
{% if node.layout == "page" %}
<a class="sidebar-nav-item{% if page.url == node.url %} active{% endif %}" href="{{ site.github.url }}{{ node.url }}">{{ node.title }}</a>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}

<a class="sidebar-nav-item" href="{{ site.github.repo }}">GitHub</a>
</nav>

<p>&copy; {{ site.time | date: '%Y' }}. All rights reserved.</p>
</div>
</div>
15 changes: 15 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">

{% include head.html %}

<body class="theme-base-0d">

{% include sidebar.html %}

<div class="content container">
{{ content }}
</div>

</body>
</html>
8 changes: 8 additions & 0 deletions _layouts/page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
layout: default
---

<div class="page">
<h1 class="page-title">{{ page.title }}</h1>
{{ content }}
</div>
25 changes: 25 additions & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
layout: default
---

<div class="post">
<h1 class="post-title">{{ page.title }}</h1>
<span class="post-date">{{ page.date | date_to_string }}</span>
{{ content }}
</div>

<div class="related">
<h2>Related Posts</h2>
<ul class="related-posts">
{% for post in site.related_posts limit:3 %}
<li>
<h3>
<a href="{{ site.github.url }}{{ post.url }}">
{{ post.title }}
<small>{{ post.date | date_to_string }}</small>
</a>
</h3>
</li>
{% endfor %}
</ul>
</div>
28 changes: 28 additions & 0 deletions atom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
layout: null
---

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

<title>{{ site.title }}</title>
<link href="{{ site.url }}/atom.xml" rel="self"/>
<link href="{{ site.url }}/"/>
<updated>{{ site.time | date_to_xmlschema }}</updated>
<id>{{ site.url }}</id>
<author>
<name>{{ site.author.name }}</name>
<email>{{ site.author.email }}</email>
</author>

{% for post in site.posts %}
<entry>
<title>{{ post.title }}</title>
<link href="{{ site.url }}{{ post.url }}"/>
<updated>{{ post.date | date_to_xmlschema }}</updated>
<id>{{ site.url }}{{ post.id }}</id>
<content type="html">{{ post.content | xml_escape }}</content>
</entry>
{% endfor %}

</feed>
33 changes: 33 additions & 0 deletions knitpost.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/Rscript --vanilla

# Taken and modified from
# http://varianceexplained.org/pages/workflow.html

# compiles all .Rmd files in _R directory into .md files in the _posts
# directory, if the input file is older than the output file.

# run ./knitpages.R to update all knitr files that need to be updated.

KnitPost <- function(input, outfile, base.url = '/') {
# this function is a modified version of an example here:
# http://jfisher-usgs.github.com/r/2012/07/03/knitr-jekyll/
knitr::opts_knit$set(base.url = base.url)
knitr::opts_chunk$set(fig.path = 'images/',
collapse = TRUE)
knitr::render_jekyll()
knitr::knit(input, outfile, envir = parent.frame())
txt <- sub('^published: false', 'published: true',
readLines(outfile))
writeLines(txt, outfile)
}

for (infile in list.files(pattern="*.Rmd", full.names=TRUE, recursive = TRUE)) {
outfile <- paste0(sub("\\.Rmd$", ".md", infile))

# knit only if the input file is the last one modified
if (!file.exists(outfile) |
file.info(infile)$mtime > file.info(outfile)$mtime) {
KnitPost(infile, outfile)
}
}

Loading

0 comments on commit c7b71d6

Please sign in to comment.