Skip to content

Commit f784751

Browse files
author
David Briggs
committed
add jekyll generator and some content
1 parent 93e3bdc commit f784751

36 files changed

+1547
-9
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
.DS_Store
1+
.DS_Store
2+
_site
3+
.sass-cache

Gemfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
source 'http://rubygems.org'
2+
3+
gem 'jekyll', '0.11.0'
4+
gem 'rdiscount'
5+
gem 'sass'

Gemfile.lock

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
GEM
2+
remote: http://rubygems.org/
3+
specs:
4+
albino (1.3.3)
5+
posix-spawn (>= 0.3.6)
6+
classifier (1.3.3)
7+
fast-stemmer (>= 1.0.0)
8+
directory_watcher (1.4.1)
9+
fast-stemmer (1.0.1)
10+
jekyll (0.11.0)
11+
albino (>= 1.3.2)
12+
classifier (>= 1.3.1)
13+
directory_watcher (>= 1.1.1)
14+
kramdown (>= 0.13.2)
15+
liquid (>= 1.9.0)
16+
maruku (>= 0.5.9)
17+
kramdown (0.13.7)
18+
liquid (2.3.0)
19+
maruku (0.6.0)
20+
syntax (>= 1.0.0)
21+
posix-spawn (0.3.6)
22+
rdiscount (1.6.8)
23+
sass (3.1.19)
24+
syntax (1.0.0)
25+
26+
PLATFORMS
27+
ruby
28+
29+
DEPENDENCIES
30+
jekyll (= 0.11.0)
31+
rdiscount
32+
sass

Rakefile

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
ssh_user = ''
2+
local_user = ''
3+
4+
def jekyll(opts="", path="")
5+
sh "rm -rf _site"
6+
sh path + "jekyll " + opts
7+
end
8+
9+
desc "Build site using Jekyll"
10+
task :build do
11+
jekyll
12+
end
13+
14+
desc "Serve on Localhost with port 4000"
15+
task :preview do
16+
jekyll "--server 4321 --auto"
17+
end
18+
19+
desc "Deploy to Dev"
20+
task :deploy => :"deploy:local"
21+
22+
namespace :deploy do
23+
desc "Deploy to Local"
24+
task :local => :build do
25+
rsync local_user, "infosurv.com"
26+
end
27+
28+
desc "Deploy to Dev"
29+
task :dev => :build do
30+
rsync ssh_user, "dev.infosurv.com"
31+
end
32+
33+
desc "Deploy to Live"
34+
task :live => :build do
35+
rsync ssh_user, "infosurv.com"
36+
end
37+
38+
desc "Deploy to Dev and Live"
39+
task :all => [:dev, :live, :local]
40+
41+
def rsync(user, domain)
42+
sh "rsync -rtz --delete _site/ #{user}:~/#{domain}/"
43+
end
44+
end
45+
46+
namespace :post do
47+
desc "Create a new post"
48+
task :new, :title do |t, args|
49+
args.with_defaults(:title => 'new-post')
50+
title = args.title
51+
filename = "_posts/#{Time.now.strftime('%Y-%m-%d')}-#{url_from(title)}.md"
52+
if File.exist?(filename)
53+
abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n'
54+
end
55+
puts "Creating new post: #{filename}"
56+
open(filename, 'w') do |post|
57+
post.puts "---"
58+
post.puts "layout: post"
59+
post.puts "title: #{title.gsub(/&/,'&')}"
60+
post.puts "date: #{Time.now.strftime('%Y-%m-%d %H:%M')}"
61+
post.puts "category: "
62+
post.puts "---"
63+
end
64+
end
65+
end
66+
67+
def ask(message, valid_options)
68+
if valid_options
69+
answer = get_stdin("#{message} #{valid_options.to_s.gsub(/"/, '').gsub(/, /,'/')} ") while !valid_options.include?(answer)
70+
else
71+
answer = get_stdin(message)
72+
end
73+
answer
74+
end
75+
76+
def get_stdin(message)
77+
print message
78+
STDIN.gets.chomp
79+
end
80+
81+
def url_from(value)
82+
value.downcase.gsub(/\s+/, "-").sub(/^#{"-"}*/, "").sub(/#{"-"}*$/, "").squeeze("-")
83+
end

_config.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
permalink: /:title/
2+
markdown: rdiscount
3+
4+
exclude: [docs, Rakefile, README.md, Gemfile, Gemfile.lock]
5+
6+
category_dir: portfolio
7+
category_title_prefix: ""

_layouts/2-column.html

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
layout: default
3+
---
4+
<div id="main">
5+
{{ content }}
6+
</div>
7+
8+
<div id="sidebar">
9+
<h1>Portfolio</h1>
10+
<div id="sidemenu">
11+
<ul>
12+
<li><a href="/portfolio/recent/">Most Recent</a></li>
13+
{% for category in site.categories %}
14+
<li><a href="/portfolio/{{ category[0] | replace:' ', '-' | downcase }}">{{ category[0] }}</a></li>
15+
{% endfor %}
16+
<li><a href="/portfolio/">Archives</a></li>
17+
</ul>
18+
</div>
19+
</div>

_layouts/category_index.html

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
layout: 2-column
3+
---
4+
5+
{% for post in site.categories[page.category] limit: 10 %}
6+
7+
<div class="post">
8+
<h2>
9+
<a href="{{ post.url }}">{{ post.title }}</a>
10+
</h2>
11+
<div class="details">Posted in {{ post.category }} on {{ post.date | date:"%B %d, %Y" }}</div>
12+
{{ post.content | markdownify | html_truncatewords }}
13+
</div>
14+
15+
{% endfor %}

_layouts/default.html

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<title>Sankage {% if page.title %}| {{ page.title }}{% endif %}</title>
4+
<meta name="viewport" content="width=device-width">
5+
<link rel="stylesheet" href="/css/styles.css">
6+
<header>
7+
<ul>
8+
<li><a href="/">Home</a></li>
9+
<li><a href="/portfolio">Portfolio</a></li>
10+
</ul>
11+
</header>
12+
<div class="content">
13+
<section>{{ content }}</section>
14+
</div>
15+
<footer></footer>

_layouts/post.html

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
layout: 2-column
3+
---
4+
<div class="post">
5+
<h2>{{ page.title }}</h2>
6+
<div class="details">Posted in {{ page.category }} on {{ page.date | date:"%B %d, %Y" }}</div>
7+
{{ content }}
8+
</div>

_plugins/category.rb

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
module Jekyll
2+
3+
class CategoryIndex < Page
4+
def initialize(site, base, dir, category)
5+
@site = site
6+
@base = base
7+
@dir = dir
8+
@name = 'index.html'
9+
10+
self.process(@name)
11+
self.read_yaml(File.join(base, '_layouts'), 'category_index.html')
12+
self.data['category'] = category
13+
14+
category_title_prefix = site.config['category_title_prefix'] || 'Category: '
15+
self.data['title'] = "#{category_title_prefix}#{category}"
16+
end
17+
end
18+
19+
class CategoryList < Page
20+
def initialize(site, base, dir, categories)
21+
@site = site
22+
@base = base
23+
@dir = dir
24+
@name = 'index.html'
25+
26+
self.process(@name)
27+
self.read_yaml(File.join(base, '_layouts'), 'category_list.html')
28+
self.data['categories'] = categories
29+
end
30+
end
31+
32+
class CategoryGenerator < Generator
33+
safe true
34+
35+
def generate(site)
36+
if site.layouts.key? 'category_index'
37+
dir = site.config['category_dir'] || 'categories'
38+
site.categories.keys.each do |category|
39+
write_category_index(site, File.join(dir, category.gsub(/\s/, "-").gsub(/[^\w-]/, '').downcase), category)
40+
end
41+
end
42+
43+
if site.layouts.key? 'category_list'
44+
dir = site.config['category_dir'] || 'categories'
45+
write_category_list(site, dir, site.categories.keys.sort)
46+
end
47+
end
48+
49+
def write_category_index(site, dir, category)
50+
index = CategoryIndex.new(site, site.source, dir, category)
51+
index.render(site.layouts, site.site_payload)
52+
index.write(site.dest)
53+
site.static_files << index
54+
end
55+
56+
def write_category_list(site, dir, categories)
57+
index = CategoryList.new(site, site.source, dir, categories)
58+
index.render(site.layouts, site.site_payload)
59+
index.write(site.dest)
60+
site.static_files << index
61+
end
62+
end
63+
64+
end

_plugins/sass_converter.rb

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module Jekyll
2+
# Sass plugin to convert .scss to .css
3+
#
4+
# Note: This is configured to use the new css like syntax available in sass.
5+
require 'sass'
6+
class SassConverter < Converter
7+
safe true
8+
priority :low
9+
10+
def matches(ext)
11+
ext =~ /scss/i
12+
end
13+
14+
def output_ext(ext)
15+
".css"
16+
end
17+
18+
def convert(content)
19+
begin
20+
puts "Performing Sass Conversion."
21+
engine = Sass::Engine.new(content, syntax: :scss, load_paths: ["./css/"], style: :compact)
22+
engine.render
23+
rescue StandardError => e
24+
puts "!!! SASS Error: " + e.message
25+
end
26+
end
27+
end
28+
end

_posts/2011-08-25-website-redesign.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
layout: post
3+
title: Website Redesign
4+
date: 2011-08-25 18:15
5+
category: Redesign
6+
---
7+
8+
In an effort to help drive change in Infosurv's website design, I rebuilt it using the [Jekyll](https://github.com/mojombo/jekyll) static-site generator. I took most of the original design's components and made tweeks to them to both look and function better. It was my desire to remove alot of the cruft that has built up and make our site faster for end users and less server/database intensive on the backend.
9+
10+
![Home Page](/imgs/info-home.png)
11+
12+
I removed the dropdown menus to allow for future deployment to iOS devices. (Yes, :hover does work, but you would need to realize that something is hoverable and touch it to make it visible, not nearly as intuitive as simply giving the links to the users.) To keep the links available I moved them to the footer:
13+
14+
![Footer](/imgs/info-footer.png)
15+
16+
I redesigned our contact form with the goal of making it simplier for end users. Before it had a captcha system and required more fields. Now it would look like this:
17+
18+
![Contact](/imgs/info-contact.png)
19+
20+
We also have a contact form on every page of the site. While I didn't fully agree that it was needed, I did simplify it and made it smaller and less intrusive by placing it into a sidebar:
21+
22+
![Sidebar](/imgs/info-sidebar.png)
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
layout: post
3+
title: Choice Hotels Portal
4+
date: 2012-04-23 15:56
5+
category: Portals
6+
---
7+
8+
This is a reporting portal for Choice Hotels.
9+
10+
It was developed at Infosurv, Inc. for the use of Choice Hotel's management to access reports and helpful resources associated with an employee survey also conducted by Infosurv, Inc.
11+
12+
### Login
13+
14+
As the survey data is filtered down to show only a subset of data per user, a user management system was put in place.
15+
16+
![Login](/imgs/choice-login.png)
17+
18+
### Reports
19+
20+
Once logged in, users can view reports related to everyone within their organization as well as those who directly report to them.
21+
22+
![Report](/imgs/choice-report.png)
23+
24+
25+
### Resources
26+
27+
Managers have access to resources associated with the survey's questions. If they see that they are not doing well in their reports to a specific question, they can come here and get helpful resources to try and improve their results.
28+
29+
![Resources](/imgs/choice-resources.png)
30+
31+
### Updates
32+
33+
The reporting portal was also designed to import data directly from Vovici's API. An admin user will fill in the necessary information to start the import process.
34+
35+
![Import](/imgs/choice-import.png)
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
layout: post
3+
title: Smile Brands Portal
4+
category: Portals
5+
---
6+
7+
This is a reporting portal for Smile Brands designed and constructed by Infosurv, Inc.
8+
9+
It has gone through 2 major revisions since its original creation, and is consistantly tweeked and edited to the clients specifications.
10+
11+
### Login
12+
13+
Access to reports is restricted by varying levels of management. To establish this authorization, users are required to login to the system. To allow for a easier user management, login requests are directed through a client-based API. The returned response dictates what levels of access a user is able to have.
14+
15+
![Login](/imgs/sb-login.png)
16+
17+
### Reports
18+
19+
The basic report is a Trending report based on NPS scores.
20+
21+
![Trend](/imgs/sb-trend.png)
22+
23+
The advanced report breaks down and clusters the NPS buckets and the explanations of why a certain score was given.
24+
25+
![Summary](/imgs/sb-summary.png)
26+
27+
### Issue Tracking
28+
29+
30+
### Redemption Rates

0 commit comments

Comments
 (0)