{{ project.title }}
+{{ project.description }}
+ ++ GitHub + • + + • + +
+ ++ Last updated on +
+diff --git a/Readme.md b/Readme.md index 8e05b05..cda75dd 100644 --- a/Readme.md +++ b/Readme.md @@ -43,13 +43,13 @@ Execution, trying TDD for the first time: - [x] check and delete _data.json - - [ ] Migrate projects to the new site generator + - [x] Migrate projects to the new site generator - - [ ] Migrate projects page + - [x] Migrate projects page - - [ ] Migrate project page + - [x] Migrate project page - - [ ] Check and delete _data.json + - [x] Check and delete _data.json - [ ] Migrate posts to markdown with headers somehow diff --git a/projects.json b/projects.json new file mode 100644 index 0000000..78360f9 --- /dev/null +++ b/projects.json @@ -0,0 +1,60 @@ +{ + "projects": [ + { + "title": "bin", + "description": "my collection of scripts in ~/bin" + }, + { + "title": "config", + "description": "important dot files (zsh, emacs, vim, screen)" + }, + { + "title": "compiler", + "description": "a compiler targeting x86 in Ruby" + }, + { + "title": "lake", + "description": "a simple implementation of Scheme in C" + }, + { + "title": "strftime", + "description": "strftime for JavaScript" + }, + { + "title": "format", + "description": "printf for JavaScript" + }, + { + "title": "gitter", + "description": "a GitHub client for Node (v3 API)" + }, + { + "title": "mojo.el", + "description": "turn emacs into a sweet mojo editor" + }, + { + "title": "ThePusher", + "description": "Github post-receive hook router" + }, + { + "title": "NorthWatcher", + "description": "cron for filesystem changes" + }, + { + "title": "repl-edit", + "description": "edit Node repl commands with your text editor" + }, + { + "title": "cheat.el", + "description": "cheat from emacs" + }, + { + "title": "batteries", + "description": "a general purpose node library" + }, + { + "title": "samhuri.net", + "description": "this site" + } + ] +} diff --git a/public/css/style.less b/public/css/style.less index ff4de40..e9bb714 100644 --- a/public/css/style.less +++ b/public/css/style.less @@ -354,10 +354,13 @@ ul.archive { .project-listing { margin-bottom: 1rem; - h4, p { - margin: 0.5rem 0; + h4 { + margin: 0.5rem 0 1rem; } + p { + margin: 0.5rem 0 2rem; + } } .project-stats { @@ -370,10 +373,8 @@ ul.archive { } -body.projects:not(.index) .container { - /* FIXME: find out where this is used and do it differently ... this selector sucks */ - body { background-color: red; } - h2, h4 { +article.project { + h1, h4 { text-align: center; } } diff --git a/public/js/projects.js b/public/js/projects.js index 9fa866b..68bc0b9 100644 --- a/public/js/projects.js +++ b/public/js/projects.js @@ -1,12 +1,14 @@ ;(function() { - if (SJS.projectName) { - SJS.ready(initProject) + if (document.addEventListener) { + document.addEventListener('DOMContentLoaded', initProject, false) + } else if (window.attachEvent) { + window.attachEvent('onload', initProject) } function initProject() { - - var data = createObjectStore(SJS.projectName) + var projectName = document.getElementById('project').dataset.title + var data = createObjectStore(projectName) function html(id, h) { document.getElementById(id).innerHTML = h @@ -63,11 +65,10 @@ var Months = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' ') - var t = data.get('t-' + SJS.projectName) + var t = data.get('t-' + projectName) if (!t || +new Date() - t > 3600 * 1000) { - console.log('stale ' + String(t)) - data.set('t-' + SJS.projectName, +new Date()) - var repo = GITR.repo('samsonjs', SJS.projectName) + data.set('t-' + projectName, +new Date()) + var repo = GITR.repo('samsonjs', projectName) repo .fetch(function(err, repo) { if (err) { @@ -102,13 +103,13 @@ }) } else { try { - updateBranches(SJS.projectName, data.get('branches')) + updateBranches(projectName, data.get('branches')) updateLangs(data.get('langs')) updateContributors(data.get('contributors')) updateStars(data.get('stars').length) updateN('fork', data.get('forks').length) } catch (e) { - data.set('t-' + SJS.projectName, null) + data.set('t-' + projectName, null) initProject() } } diff --git a/public/projects/NorthWatcher.ejs b/public/projects/NorthWatcher.ejs deleted file mode 100644 index 68d64e5..0000000 --- a/public/projects/NorthWatcher.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('_project') %> diff --git a/public/projects/ThePusher.ejs b/public/projects/ThePusher.ejs deleted file mode 100644 index 68d64e5..0000000 --- a/public/projects/ThePusher.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('_project') %> diff --git a/public/projects/_data.json b/public/projects/_data.json deleted file mode 100644 index 00e44be..0000000 --- a/public/projects/_data.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "_scripts": [ - "https://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js", - "/js/gitter.js", - "/js/store.js", - "/js/projects.js" - ], - "index": { - "title": "Projects" - }, - "strftime": { - "title": "strftime", - "description": "strftime for JavaScript" - }, - "bin": { - "title": "bin", - "description": "~/bin" - }, - "compiler": { - "title": "compiler", - "description": "a compiler targeting x86 in Ruby" - }, - "config": { - "title": "config", - "description": "important dot files (zsh, emacs, vim, screen)" - }, - "format": { - "title": "format", - "description": "printf for JavaScript" - }, - "gitter": { - "title": "gitter", - "description": "a GitHub client for Node (v3 API)" - }, - "samhuri.net": { - "title": "samhuri.net", - "description": "this site" - }, - "samhuri": { - "hidden": true, - "title": "samhuri.net", - "description": "this site" - }, - "ThePusher": { - "title": "ThePusher", - "description": "Github post-receive hook router" - }, - "lake": { - "title": "lake", - "description": "A simple implementation of Scheme in C" - }, - "mojo.el": { - "title": "mojo.el", - "description": "turn emacs into a sweet mojo editor" - }, - "mojo": { - "hidden": true, - "title": "mojo.el", - "description": "turn emacs into a sweet mojo editor" - }, - "NorthWatcher": { - "title": "NorthWatcher", - "description": "cron for filesystem changes" - }, - "batteries": { - "title": "batteries", - "description": "a general purpose node library" - }, - "repl-edit": { - "title": "repl-edit", - "description": "edit Node repl commands with your text editor" - }, - "cheat.el": { - "title": "cheat.el", - "description": "cheat from emacs" - }, - "cheat": { - "hidden": true, - "title": "cheat.el", - "description": "cheat from emacs" - } -} diff --git a/public/projects/_project.ejs b/public/projects/_project.ejs deleted file mode 100644 index bbfdbde..0000000 --- a/public/projects/_project.ejs +++ /dev/null @@ -1,31 +0,0 @@ -
- GitHub - • - - • - -
- -- Last updated on -
-<%= project.description %>
-+ GitHub + • + + • + +
+ ++ Last updated on +
++
{{ project.description }}
++