This file contains hidden or 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
var Render = require('../render'), | |
render = Render.render; | |
function getContent(req, res) { | |
var hello = 'Hello'; | |
var world = 'World'; | |
render(req, res, { | |
view: 'page-index', | |
title: 'Main page', | |
meta: { |
This file contains hidden or 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
var path = require('path'), | |
express = require('express'), | |
favicon = require('serve-favicon'), | |
morgan = require('morgan'), | |
serveStatic = require('serve-static'), | |
bodyParser = require('body-parser'), | |
cookieParser = require('cookie-parser'), | |
expressSession = require('express-session'), |
This file contains hidden or 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
{ | |
"staticFolder": "static", | |
"defaultPort": 3000, | |
"cacheTTL": 30000, | |
"sessionSecret": "REPLACE_ME_WITH_RANDOM_STRING", | |
"services": { | |
"twitter": { | |
"consumer_key": "", | |
"consumer_secret": "", | |
"bearer_token": "" |
This file contains hidden or 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
node_modules/ | |
.DS_Store | |
.idea | |
.project | |
.svn | |
npm-debug.log | |
static/index.min.* | |
server/config.json |
This file contains hidden or 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
block('root').replace()(function() { | |
var ctx = this.ctx, | |
data = this.data = ctx.data, | |
meta = data.meta || {}, | |
og = meta.og || {}; | |
if (ctx.context) return ctx.context; | |
return { | |
block: 'page', |
This file contains hidden or 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
Object.assign || (Object.assign = require('object-assign')); | |
var fs = require('fs'), | |
path = require('path'), | |
express = require('express'), | |
app = express(), | |
bodyParser = require('body-parser'), | |
favicon = require('serve-favicon'), | |
morgan = require('morgan'), | |
serveStatic = require('serve-static'), |
This file contains hidden or 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
{ | |
block : 'page', | |
title : 'Support IE8', | |
head : [ | |
{ | |
elem : 'conditional-comment', | |
condition : '> IE 8', | |
msieOnly : false, | |
content : { elem : 'css', url : '_simple.css' } // styles for all browsers, including IE9+ | |
}, |
This file contains hidden or 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
block('goods')( | |
tag()('ul'), | |
content()(function() { | |
return this.ctx.goods.map(function(item){ | |
return [ | |
{ | |
elem: 'item', | |
elemMods: { new: item.new && 'yes' }, |
This file contains hidden or 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
module.exports = { | |
block: 'page', | |
title: 'Title of the page', | |
favicon: '/favicon.ico', | |
head: [ | |
{ elem: 'meta', attrs: { name: 'description', content: '' }}, | |
{ elem: 'css', url: 'index.min.css' } | |
], | |
scripts: [{ elem: 'js', url: 'index.min.js' }], | |
content: [ |
This file contains hidden or 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
module.exports = { | |
block: 'page', | |
title: 'Title of the page', | |
favicon: '/favicon.ico', | |
head: [ | |
{ elem: 'meta', attrs: { name: 'description', content: '' }}, | |
{ elem: 'css', url: 'index.min.css' } | |
], | |
scripts: [{ elem: 'js', url: 'index.min.js' }], | |
content: [ |