Skip to content

Commit

Permalink
Templating and serving up statig files working!
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcbrewer committed Aug 16, 2012
1 parent 9b8768a commit 756580e
Show file tree
Hide file tree
Showing 7 changed files with 871 additions and 7 deletions.
23 changes: 21 additions & 2 deletions app.js
Expand Up @@ -93,21 +93,40 @@ var https = require('https'),
// to retreive the account changeset.
server.listen(8888);


// Sevring up the assets directory
var publicDir = __dirname + '/public',
assetsDir = publicDir + '/assets';

server.use('/assets', express.static( assetsDir ));


// Set up our routes
server.get('/', function (req, res) {

var debug = false;


// debug = JSON.stringify(req.query);

var source = app.loadTemplate('layout.tmpl'),
template = handlebars.compile(source),
view = template({
copy: 'test',
copy: 's;kdflkjlkj',
stylesheets: [
{ href: 'assets/css/reset.css' },
{ href: 'assets/css/core.css' }
]
],
scripts: [
{ href: '' }
],
debug: debug
});


res.send(view);


// app.init(res);
// app.getChangesets();

Expand Down
1 change: 1 addition & 0 deletions app.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions public/assets/css/core.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions public/assets/js/lib/modernizr-2.6.1.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

158 changes: 158 additions & 0 deletions public/assets/less/core.less
@@ -0,0 +1,158 @@
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
core.css
Contains core styles
Created at:
Created by:
@credits
This site uses a modification on the SMACSS design - http://smacss.com/ - by @snookca
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/

/* ====================================================
LESS IMPORTS
==================================================== */

@import "libs/css3.less";




/* ====================================================
LESS VARS
==================================================== */
@c-bg: #FFF;
@c-copy: #333;




/* ====================================================
BASE STYLES
Base rules are the defaults. They are almost exclusively
single element selectors but it could include attribute selectors,
pseudo-class selectors, child selectors or sibling selectors.
Essentially, a base style says that wherever this element is on the page,
it should look like...
==================================================== */

* {
/* Paul Irish's suggestion: http://paulirish.com/2012/box-sizing-border-box-ftw/ */
-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;

/* Chris Coyier's suggestions */
background-repeat: no-repeat;
vertical-align: middle;
}


::-moz-selection{ background:#333; color:#F8F8F8; text-shadow:none; }
::selection { background:#333; color:#F8F8F8; text-shadow:none; }

html, body { -web-font-smoothing: antialiased; }
body { color: #333; background-color: #F8F8F8; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }


::-webkit-input-placeholder {}
:-moz-placeholder {}
[type=search] {
/* resets webkit styling on search inputs */
-webkit-appearance: none;
}
/* Style the webkit validation message for forms */
::-webkit-validation-bubble-message {
padding: 40px;
}

a {}
a:link {}
a:visited {}
a:hover {}
a:active {}
a:focus {}

input:required {}
input:optional {}
input:valid {}
input:invalid {}
input:default {}
input:focus {}

input:enabled {}
input:disabled {}
input:checked {}
input:indeterminate {} /* un-selected radio buttons :) */

::-webkit-input-placeholder {}
:-moz-placeholder {}

code { font-family: Monaco; padding: 10px; border: 1px solid #DDD; border-radius: 4px; background-color: #F2F2F2; text-shadow: 0px 1px 0px #FFF; }


/* ====================================================
LAYOUT STYLES
Layout rules divide the page into sections.
Layouts hold one or more modules together.
==================================================== */



/* ====================================================
MODULES STYLES
Modules are the reusable, modular parts of our design.
They are the callouts, the sidebar sections, the product lists and so on.
==================================================== */
.debug { position: fixed; bottom: 20px; right: 20px; font-size: 14px; }


/* ====================================================
STATES STYLES
State rules are ways to describe how our modules or layouts will
look when in a particular state.
Is it hidden or expanded? Is it active or inactive?
They are about describing how a module or layout looks on screens that are smaller or bigger.
They are also about describing how a module might look in different
views like the home page or the inside page.
==================================================== */




/* ==|== Media Queries ======================================================
PLACEHOLDER Media Queries for Responsive Design.
Modify as content requires.
Notes:
MOBILE FIRST - use min-width (lowest first) and style upwards
MOBILE RESPONSIVE - use max-width (highest first) and style downwards
Never set breakpoints for devices, only when the design requires it.
========================================================================== */

@media (max-width: 1000px) {}


/* ==|== print styles =======================================================
Print styles.
Inlined to avoid required HTTP connection: h5bp.com/r
========================================================================== */

@media print {
* { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important; -ms-filter: none !important; } /* Black prints faster: h5bp.com/s */
a, a:visited { text-decoration: underline; }
a[href]:after { content: " (" attr(href) ")"; }
abbr[title]:after { content: " (" attr(title) ")"; }
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } /* Don't show links for images, or javascript/internal links */
pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
thead { display: table-header-group; } /* h5bp.com/t */
tr, img { page-break-inside: avoid; }
img { max-width: 100% !important; }
@page { margin: 0.5cm; }
p, h2, h3 { orphans: 3; widows: 3; }
h2, h3 { page-break-after: avoid; }
}

0 comments on commit 756580e

Please sign in to comment.