Skip to content

Commit

Permalink
Merge pull request #130 from OpenGG/master
Browse files Browse the repository at this point in the history
增加对 wordpress postid 的支持
  • Loading branch information
tommy351 committed Mar 29, 2013
2 parents 6f7d0c0 + d8c90d4 commit c479313
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var moment = require('moment'),
configLink = config.permalink || ':year/:month/:day/:title/';

var schemaPosts = new Schema({
id: Number,
title: String,
date: Date,
updated: Date,
Expand Down Expand Up @@ -103,6 +104,7 @@ schemaPosts.virtual('path').get(function(){
var date = this.date,
cat = this.categories.last();
return configLink
.replace(':id', this.id || 0)
.replace(':category', cat ? cat.slug : defaultCategory)
.replace(':year', date.format('YYYY'))
.replace(':month', date.format('MM'))
Expand Down

0 comments on commit c479313

Please sign in to comment.