Permalink
Browse files

organized files

  • Loading branch information...
1 parent 52413d3 commit 8db93eafc4abfe626c25d7870a568976c957fd30 @samsonjs committed Dec 3, 2011
Showing with 208 additions and 207 deletions.
  1. +4 −7 .gitignore
  2. +0 −2 .publish
  3. +33 −33 Makefile
  4. +5 −1 assets/{ → css}/blog.css
  5. +7 −0 assets/css/ie6.css
  6. 0 assets/{ → css}/ie7.css
  7. 0 assets/{ → css}/mobile.css
  8. 0 assets/{ → css}/proj-common.css
  9. 0 assets/{ → css}/proj-index.css
  10. +2 −2 assets/{ → css}/proj.css
  11. +2 −2 assets/{ → css}/style.css
  12. +0 −7 assets/ie6.css
  13. BIN assets/img/dir.gif
  14. BIN assets/img/dir.png
  15. BIN assets/img/folder_explore.png
  16. BIN assets/img/la.gif
  17. BIN assets/img/la.png
  18. BIN assets/img/la_h.gif
  19. BIN assets/img/la_h.png
  20. BIN assets/img/txt.gif
  21. BIN assets/img/txt.png
  22. 0 assets/{ → js}/blog.js
  23. 0 assets/{ → js}/gitter.js
  24. 0 assets/{ → js}/jquery-serializeObject.js
  25. 0 assets/{ → js}/proj.js
  26. 0 assets/{ → js}/request.js
  27. 0 assets/{ → js}/showdown.js
  28. 0 assets/{ → js}/storage-polyfill.js
  29. 0 assets/{ → js}/store.js
  30. 0 assets/{ → js}/strftime.js
  31. 0 assets/{ → js}/tmpl.js
  32. +1 −1 { → bin}/blog.rb
  33. +30 −0 bin/combine.sh
  34. +5 −5 { → bin}/minify.sh
  35. +11 −6 build.js → bin/projects.js
  36. +33 −0 bin/publish.sh
  37. +0 −31 combine.sh
  38. 0 { → public}/.htaccess
  39. BIN { → public}/favicon.ico
  40. BIN {assets → public/images}/blank.gif
  41. BIN {assets → public/images}/forkme.png
  42. BIN {assets → public/images}/gh.png
  43. BIN {assets → public/images}/promotejsh.gif
  44. BIN {assets → public/images}/promotejshs.png
  45. BIN {assets → public/images}/s.gif
  46. BIN {assets → public/images}/spinner.gif
  47. +14 −9 { → public}/index.html
  48. 0 {assets → public/js}/border-radius.htc
  49. +1 −1 {assets → public/js}/iepngfix.htc
  50. BIN { → public}/json-diff/closed.png
  51. 0 { → public}/json-diff/index.html
  52. 0 { → public}/json-diff/json-diff.css
  53. BIN { → public}/json-diff/open.png
  54. +22 −62 samhuri.net.tmproj
  55. +3 −3 templates/blog/archive.html
  56. +5 −5 templates/blog/index.html
  57. +5 −5 templates/blog/post.html
  58. +14 −14 templates/proj/index.html
  59. +11 −11 templates/proj/{proj/index.html → project.html}
View
@@ -1,10 +1,7 @@
-.DS_Store
_blog
-assets/*.min.js
-assets/*.min.css
+public/js/*.js
+public/css/*.css
discussd/discuss.dirty
-blog
-!templates/blog
-proj
-!templates/proj
+public/blog
+public/proj
node_modules
View
@@ -1,2 +0,0 @@
-publish_host=samhuri.net
-publish_dir=samhuri.net/public/
View
@@ -1,51 +1,51 @@
-JAVASCRIPTS=assets/blog.js assets/gitter.js assets/jquery-serializeObject.js assets/proj.js \
- assets/request.js assets/showdown.js assets/storage-polyfill.js assets/store.js \
- assets/strftime.js assets/tmpl.js
-
-MIN_JAVASCRIPTS=assets/blog.min.js assets/gitter.min.js assets/jquery-serializeObject.min.js assets/proj.min.js \
- assets/request.min.js assets/showdown.min.js assets/storage-polyfill.min.js assets/store.min.js \
- assets/strftime.min.js assets/tmpl.min.js
-
-STYLESHEETS=assets/style.css assets/blog.css assets/proj.css
-
-MIN_STYLESHEETS=assets/style.min.css assets/blog.min.css assets/proj.min.css
-
-POSTS=$(shell echo _blog/published/*.html)
+JAVASCRIPTS=$(shell echo assets/js/*.js)
+STYLESHEETS=$(shell echo assets/css/*.css)
+POSTS=$(shell echo _blog/published/*.html) $(shell echo _blog/published/*.md)
all: proj blog combine
-proj: projects.json templates/proj/index.html templates/proj/proj/index.html
- ./build.js
+proj: projects.json templates/proj/index.html templates/proj/project.html
+ @echo
+ ./bin/projects.js projects.json public/proj
blog: _blog/blog.json templates/blog/index.html templates/blog/post.html $(POSTS)
@echo
- ./blog.rb _blog blog
+ ./bin/blog.rb _blog public/blog
minify: $(JAVASCRIPTS) $(STYLESHEETS)
@echo
- ./minify.sh
+ ./bin/minify.sh
+
+combine: minify $(JAVASCRIPTS) $(STYLESHEETS)
+ @echo
+ ./bin/combine.sh
+
+publish_assets: combine
+ @echo
+ ./bin/publish.sh --delete public/css public/images public/js
-combine: minify $(MIN_JAVASCRIPTS) $(MIN_STYLESHEETS)
+publish_blog: blog publish_assets
@echo
- ./combine.sh
+ ./bin/publish.sh --delete public/blog
+ scp public/blog/posts.json bohodev.net:discussd/posts.json
-publish_blog: blog combine
- publish assets
- publish blog
- scp blog/posts.json bohodev.net:discussd/posts.json
+publish_proj: proj publish_assets
+ @echo
+ ./bin/publish.sh --delete proj
-publish_proj: proj combine
- publish assets
- publish proj
+publish_index: public/index.html
+ @echo
+ ./bin/publish.sh public/index.html
-publish: publish_blog publish_proj index.html
- publish index.html
- publish .htaccess
+publish: publish_index publish_blog publish_proj
+ @echo
+ ./bin/publish.sh public/.htaccess
+ ./bin/publish.sh public/favicon.ico
clean:
- rm -rf proj/*
- rm -rf blog/*
- rm assets/*.min.js
- rm assets/*.min.css
+ rm -rf public/proj/*
+ rm -rf public/blog/*
+ rm public/css/*.css
+ rm public/js/*.js
.PHONY: proj blog
@@ -1,5 +1,7 @@
body { margin: 0
- ; padding: 0
+ ; padding: 0 0 4em
+ ; position: relative
+ ; min-height: 100%
}
h1 { margin: 0
@@ -168,6 +170,8 @@ footer { margin: 0
; border-top: solid 1px #bbb
; clear: both
; width: 100%
+ ; position: absolute
+ ; bottom: 0
}
footer p { margin: 0.5em }
View
@@ -0,0 +1,7 @@
+ul { behavior: none
+ ; padding-bottom: 25px
+ }
+
+img { behavior: url(../js/iepngfix.htc)
+ ; behavior: url(../../js/iepngfix.htc)
+ }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -8,8 +8,8 @@
; -moz-border-radius: 20px
; -webkit-border-radius: 20px
; border-radius: 20px
- ; behavior: url(../assets/border-radius.htc)
- ; behavior: url(../../assets/border-radius.htc)
+ ; behavior: url(../js/border-radius.htc)
+ ; behavior: url(../../js/border-radius.htc)
}
h4 { margin: 0.5em 0 0.7em }
@@ -47,8 +47,8 @@ ul.nav { text-align: center
; -moz-border-radius: 20px
; -webkit-border-radius: 20px
; border-radius: 20px
- ; behavior: url(assets/border-radius.htc)
- ; behavior: url(../assets/border-radius.htc)
+ ; behavior: url(js/border-radius.htc)
+ ; behavior: url(../js/border-radius.htc)
}
ul.nav li { display: block
View
@@ -1,7 +0,0 @@
-ul { behavior: none
- ; padding-bottom: 25px
- }
-
-img { behavior: url(../assets/iepngfix.htc)
- ; behavior: url(../../assets/iepngfix.htc)
- }
View
Deleted file not rendered
View
Deleted file not rendered
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -174,7 +174,7 @@ def rss_for_posts(options = {})
xml = Builder::XmlMarkup.new
xml.instruct! :xml, :version => '1.0'
- xml.instruct! 'xml-stylesheet', :href => 'http://samhuri.net/assets/blog-all.min.css', :type => 'text/css'
+ xml.instruct! 'xml-stylesheet', :href => 'http://samhuri.net/css/blog-all.min.css', :type => 'text/css'
xml.rss :version => '2.0' do
xml.channel do
xml.title title
View
@@ -0,0 +1,30 @@
+#!/usr/bin/env zsh
+
+### javascript ###
+
+# blog
+echo "request,showdown,strftime,tmpl,jquery-serializeObject,blog -> blog-all.min.js"
+cat public/js/{request,showdown,strftime,tmpl,jquery-serializeObject,blog}.min.js >|public/js/blog-all.min.js
+
+# project index
+echo "gitter,store -> proj-index-all.min.js"
+cat public/js/{gitter,store}.min.js >|public/js/proj-index-all.min.js
+
+# projects
+echo "gitter,store,proj -> proj-all.min.js"
+cat public/js/{gitter,store,proj}.min.js >|public/js/proj-all.min.js
+
+
+### css ###
+
+# blog
+echo "style,blog -> blog-all.min.css"
+cat public/css/{style,blog}.min.css >|public/css/blog-all.min.css
+
+# project index
+echo "style,proj-common,proj-index -> proj-index-all.min.css"
+cat public/css/{style,proj-common,proj-index}.min.css >|public/css/proj-index-all.min.css
+
+# projects
+echo "style,proj-common,proj -> proj-all.min.css"
+cat public/css/{style,proj-common,proj}.min.css >|public/css/proj-all.min.css
@@ -2,18 +2,18 @@
setopt extendedglob
-for js (assets/*.js~*.min.js) {
- target=${js%.js}.min.js
+for js (assets/js/*.js) {
+ target=public/js/${${js:t}%.js}.min.js
if [ ! -f $target ] || [ $js -nt $target ]; then
echo "$js -> $target"
closure < $js >| $target
fi
}
-for css (assets/*.css~*.min.css) {
- target=${css%.css}.min.css
+for css (assets/css/*.css) {
+ target=public/css/${${css:t}%.css}.min.css
if [ ! -f $target ] || [ $css -nt $target ]; then
echo "$css -> $target"
yui-compressor $css $target
fi
-}
+}
@@ -4,21 +4,26 @@ var fs = require('fs')
, path = require('path')
, mustache = require('mustache')
+ , rootDir = path.join(__dirname, '..')
+ , projectFile = path.join(rootDir, process.argv[2])
+ , templateDir = path.join(rootDir, 'templates', 'proj')
+ , targetDir = path.join(rootDir, process.argv[3])
+
function main() {
var ctx = {}
- fs.readFile(path.join(__dirname, 'templates', 'proj', 'proj', 'index.html'), function(err, html) {
+ fs.readFile(path.join(templateDir, 'project.html'), function(err, html) {
if (err) throw err
ctx.template = html.toString()
- fs.readFile(path.join(__dirname, 'projects.json'), function(err, json) {
+ fs.readFile(projectFile, function(err, json) {
if (err) throw err
var projects = JSON.parse(json)
, names = Object.keys(projects)
- , index = path.join(__dirname, 'proj', 'index.html')
+ , index = path.join(targetDir, 'index.html')
// write project index
- fs.readFile(path.join(__dirname, 'templates', 'proj', 'index.html'), function(err, tpl) {
+ fs.readFile(path.join(templateDir, 'index.html'), function(err, tpl) {
if (err) throw err
- fs.mkdir(path.join(__dirname, 'proj'), 0775, function(err) {
+ fs.mkdir(targetDir, 0775, function(err) {
if (err && err.code !== 'EEXIST') throw err
fs.unlink(index, function(err) {
if (err && err.code !== 'ENOENT') throw err
@@ -43,7 +48,7 @@ function main() {
}
function buildProject(name, project, ctx) {
- var dir = path.join(__dirname, 'proj', name)
+ var dir = path.join(targetDir, name)
, index = path.join(dir, 'index.html')
try {
View
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+bail() {
+ echo fail: $*
+ exit 1
+}
+
+# exit on errors
+set -e
+
+publish_host=samhuri.net
+publish_dir=samhuri.net/public/
+
+# test
+if [[ "$1" = "-t" ]]; then
+ prefix=echo
+ shift
+fi
+
+# --delete, passed to rsync
+if [[ "$1" = "--delete" ]]; then
+ delete="--delete"
+ shift
+fi
+
+if [[ $# -eq 0 ]]; then
+ if [[ "$delete" != "" ]]; then
+ bail "no paths given, cowardly refusing to publish everything with --delete"
+ fi
+ $prefix rsync -aKv $delete public/* "$publish_host":"${publish_dir}${subdir}"
+else
+ $prefix rsync -aKv $delete "$@" "$publish_host":"${publish_dir}${subdir}"
+fi
View
@@ -1,31 +0,0 @@
-#!/usr/bin/env zsh
-
-
-### javascript ###
-
-# blog
-echo "request,showdown,strftime,tmpl,jquery-serializeObject,blog -> assets/blog-all.min.js"
-cat assets/{request,showdown,strftime,tmpl,jquery-serializeObject,blog}.min.js >|assets/blog-all.min.js
-
-# project index
-echo "gitter,store -> assets/proj-index-all.min.js"
-cat assets/{gitter,store}.min.js >|assets/proj-index-all.min.js
-
-# projects
-echo "gitter,store,proj -> assets/proj-all.min.js"
-cat assets/{gitter,store,proj}.min.js >|assets/proj-all.min.js
-
-
-### css ###
-
-# blog
-echo "style,blog -> assets/blog-all.min.css"
-cat assets/{style,blog}.min.css >|assets/blog-all.min.css
-
-# project index
-echo "style,proj-common,proj-index -> assets/proj-index-all.min.css"
-cat assets/{style,proj-common,proj-index}.min.css >|assets/proj-index-all.min.css
-
-# projects
-echo "style,proj-common,proj -> assets/proj-all.min.css"
-cat assets/{style,proj-common,proj}.min.css >|assets/proj-all.min.css
File renamed without changes.
File renamed without changes.
View
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
@@ -4,35 +4,40 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>samhuri.net</title>
- <link rel="icon" type="image/gif" href="assets/s.gif">
- <link rel="stylesheet" href="assets/style.min.css">
- <link rel="stylesheet" media="screen" href="assets/mobile.min.css">
+ <link rel="icon" type="image/gif" href="images/s.gif">
+ <link rel="stylesheet" href="css/style.min.css">
+ <link rel="stylesheet" media="screen" href="css/mobile.min.css">
<!--[if lt IE 7]>
- <link rel="stylesheet" href="assets/ie6.min.css">
+ <link rel="stylesheet" href="css/ie6.min.css">
<![endif]-->
<!--[if lt IE 8]>
- <link rel="stylesheet" href="assets/ie7.min.css">
+ <link rel="stylesheet" href="css/ie7.min.css">
<![endif]-->
</head>
<body>
+
<header>
<h1>samhuri.net</h1>
</header>
-<a href="https://github.com/samsonjs/samhuri.net"><img id="forkme" src="assets/forkme.png" alt="Fork me on GitHub"></a>
+
+<a href="https://github.com/samsonjs/samhuri.net"><img id="forkme" src="images/forkme.png" alt="Fork me on GitHub"></a>
+
<nav>
<ul class="nav" id="main">
<li><a href="proj">projects</a></li>
<li><a href="blog">blog</a></li>
<li><a href="json-diff">json-diff</a></li>
</ul>
</nav>
+
+<p id="promote-js">
+ <a class="img" href="https://developer.mozilla.org/en/JavaScript/Guide" title="JS Tutorial, JavaScript Tutorial, JavaScript Guide, Learn JavaScript JS, How To Learn JS, Learning JavaScript"><img src="images/promotejshs.png" height="150" width="180" alt="JS Tutorial, JavaScript Tutorial, JavaScript Guide, Learn JavaScript JS, How To Learn JS, Learning JavaScript"></a>
+</p>
+
<footer>
<p><a href="https://twitter.com/_sjs">@_sjs</a></p>
<p><a href="mailto:sami.samhuri@gmail.com">sami.samhuri@gmail.com</a></p>
</footer>
-<p id="promote-js">
- <a class="img" href="https://developer.mozilla.org/en/JavaScript/Guide" title="JS Tutorial, JavaScript Tutorial, JavaScript Guide, Learn JavaScript JS, How To Learn JS, Learning JavaScript"><img src="assets/promotejshs.png" height="150" width="180" alt="JS Tutorial, JavaScript Tutorial, JavaScript Guide, Learn JavaScript JS, How To Learn JS, Learning JavaScript"></a>
-</p>
<script>
var _gaq = _gaq || []
File renamed without changes.
View
@@ -16,7 +16,7 @@ IEPNGFix.data = IEPNGFix.data || {};
// * An absolute path like: '/images/blank.gif'
// * A path relative to this HTC file like: thisFolder + 'blank.gif'
var thisFolder = document.URL.replace(/(\\|\/)[^\\\/]*$/, '/');
-IEPNGFix.blankImg = thisFolder + 'blank.gif';
+IEPNGFix.blankImg = '/images/blank.gif';
IEPNGFix.fix = function(elm, src, t) {
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
Oops, something went wrong. Retry.

0 comments on commit 8db93ea

Please sign in to comment.