Skip to content

Commit

Permalink
Update routes, templates add ghost tpl
Browse files Browse the repository at this point in the history
Update routes, twitter api fetch excludes replies and rts, ghost blog
only takes 2 posts and includes tags. Added ghost templates to show at
the main page (needs more jade and css) #2
  • Loading branch information
carloscuesta committed Dec 29, 2015
1 parent e4e1ed3 commit 2336909
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/app/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,24 @@ exports.index = function(req, res) {

var userTimeline = TwitterApiClient.getUserTimeline({
screen_name: 'crloscuesta',
count: 4
count: 4,
exclude_replies: true,
include_rts: false
});

var lastPosts = GhostApiClient.getLastPosts({
client_id: process.env.GHOST_CLIENT_ID,
client_secret: process.env.GHOST_CLIENT_SECRET
client_secret: process.env.GHOST_CLIENT_SECRET,
limit: 2,
include: 'tags'
});

Promise.all([ghUserCCStars, userTimeline, lastPosts]).then(function(data) {
var tweets = TwitterApiClient.parseTweets(data[1]);
res.render('views/index', {
githubData: data[0],
twitterData: tweets,
ghostData: data[2],
me: staticData.me,
site: staticData.site,
social: staticData.social,
Expand Down
1 change: 1 addition & 0 deletions src/app/templates/_includes/_body.jade
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include _sections/_aboutme.jade
include _sections/_github.jade
include _sections/_twitter.jade
include _sections/_ghost.jade
include _sections/_contact.jade
include _footer.jade
script.
Expand Down
7 changes: 7 additions & 0 deletions src/app/templates/_includes/_sections/_ghost.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
section.twitter
.wrap
.row.center-xs
-each post in ghostData.posts
article.col-xs-12.col-sm-6.col-md-6
h4 #{post.title}
a(href="http://carloscuesta.me/blog#{post.url}") Read More

0 comments on commit 2336909

Please sign in to comment.