Skip to content
This repository has been archived by the owner on Dec 20, 2017. It is now read-only.

Commit

Permalink
options for title, user and repo
Browse files Browse the repository at this point in the history
  • Loading branch information
jgallen23 committed Apr 23, 2012
1 parent 7ec4b8e commit a959d2e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
9 changes: 6 additions & 3 deletions bin/markx-project.js
Expand Up @@ -10,6 +10,9 @@ program
.usage('[options] <file>')
.option('-o, --output <dir>', 'directory to write all assets')
.option('-p, --preview <port>', 'start server to preview')
.option('-t, --title', 'page title')
.option('-u, --user', 'github user')
.option('-r, --repo', 'github repo')
.option('-d, --debug', 'use this option if you are building new templates')
.parse(process.argv);

Expand All @@ -25,9 +28,9 @@ if (files.length == 1) {
template: assets + '/layout/template.jade',
preview: program.preview,
data: {
pageTitle: 'Project name',
user: 'jgallen23',
repo: 'toc',
pageTitle: program.title,
user: program.user,
repo: program.repo,
preview: (program.preview)
},
masher: {
Expand Down
17 changes: 10 additions & 7 deletions layout/template.jade
Expand Up @@ -10,15 +10,18 @@ html
include analytics
body
div#toc
a(href="http://github.com/#{user}/#{repo}")
img(style="position: absolute; top: 0; right: 0; border: 0;",src="https://a248.e.akamai.net/assets.github.com/img/7afbc8b248c68eb468279e8c17986ad46549fb71/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67",alt="Fork me on GitHub")
if user && repo
a(href="http://github.com/#{user}/#{repo}")
img(style="position: absolute; top: 0; right: 0; border: 0;",src="https://a248.e.akamai.net/assets.github.com/img/7afbc8b248c68eb468279e8c17986ad46549fb71/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67",alt="Fork me on GitHub")
div#wrapper
!= body
!= masher.script('common')
if user && repo
script
var ghInfo = $('<div/>').hubInfo({
user: '#{user}',
repo: '#{repo}'
});
$('h2:eq(0)').before(ghInfo);
script
var ghInfo = $('<div/>').hubInfo({
user: '#{user}',
repo: '#{repo}'
});
$('h2:eq(0)').before(ghInfo);
$('#toc').toc();

0 comments on commit a959d2e

Please sign in to comment.