Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert to using ruby, haml, scss, and AWS cli
- Loading branch information
Showing
15 changed files
with
97 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
public/ | ||
.sass-cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
latentninja |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2.2.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- mode: ruby -*- | ||
|
||
source 'https://rubygems.org' | ||
|
||
gem 'haml' | ||
gem 'sass' | ||
gem 'thin' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
daemons (1.2.2) | ||
eventmachine (1.0.7) | ||
haml (4.0.6) | ||
tilt | ||
rack (1.6.0) | ||
sass (3.4.13) | ||
thin (1.6.3) | ||
daemons (~> 1.0, >= 1.0.9) | ||
eventmachine (~> 1.0) | ||
rack (~> 1.0) | ||
tilt (2.0.1) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
haml | ||
sass | ||
thin |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require 'bundler' | ||
Bundler.require | ||
|
||
require 'yaml' | ||
require 'pp' | ||
|
||
desc "Generate www.latentninja.com homepage" | ||
task :default do | ||
config = YAML.load(File.read('index.yml')) | ||
column_count = config.count | ||
|
||
snippet = "$column_count: #{column_count};\n" | ||
sass_input = snippet + File.read('index.scss') | ||
sass = Sass::Engine.new( sass_input, syntax: :scss, style: :compressed ) | ||
raw_css = sass.render | ||
|
||
haml_input = File.read('index.haml') | ||
haml = Haml::Engine.new( haml_input, ugly: true, remove_whitespace: true ) | ||
raw_html = haml.render( Object.new, { link_columns: config, raw_css: raw_css } ) | ||
|
||
File.open( 'public/index.html', 'w' ) do |f| | ||
f.print raw_html | ||
end | ||
end | ||
|
||
desc "Start local dev server" | ||
task :server do | ||
exec 'bundle exec rackup' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
use Rack::Static, :urls => [""], :root => 'public', :index => 'index.html' | ||
run ->{ [404, nil, nil] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
!!! 5 | ||
%html( lang="en" ) | ||
%head | ||
%meta(http-equiv="Content-Type" content="text/html; charset=utf-8") | ||
%title Startup Links for Ryan D Johnson | ||
:css | ||
#{raw_css} | ||
%body | ||
- link_columns.each do |column| | ||
.c | ||
- column.each do |link_group| | ||
.g | ||
.l= link_group['group_name'] | ||
%ul | ||
- link_group['links'].each do |link| | ||
%li | ||
%a{ href: link['uri'] }= link['name'] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
#!/bin/bash | ||
|
||
. $(dirname $0)/s3vars.sh | ||
if [[ ! -x $(which aws) ]]; then | ||
echo "Requires AWS cli (brew install aws)" 1>&2 | ||
exit 1 | ||
fi | ||
|
||
SOURCE=$(dirname $0)/public/ | ||
BUCKET=www.latentninja.com | ||
DEST=/ | ||
export AWS_DEFAULT_REGION=us-east-1 | ||
|
||
SRC=$(dirname $0)/public/ | ||
DST=/ | ||
|
||
source $(dirname $0)/s3vars.sh | ||
|
||
aws s3 sync public s3://${BUCKET}/ --exclude .gitkeep | ||
|
||
s3sync -p -r --expires="Mon, 09 Dec 2019 04:45:17 GMT" --cache-control="max-age=311040000" --progress ${SOURCE} ${BUCKET}:${DEST} |