@ -6,17 +6,14 @@ var path = require('path'),
topics = require ( './topics' ) ,
sitemap = {
getStaticUrls : function ( callback ) {
var relative _path = global . nconf . get ( 'relative_path' ) ;
callback ( null , [
{ url : relative _path , changefreq : 'weekly' , priority : '0.6' } ,
{ url : path . join ( relative _path , 'recent' ) , changefreq : 'daily' , priority : '0.4' } ,
{ url : path . join ( relative _path , 'users' ) , changefreq : 'daily' , priority : '0.4' }
{ url : '' , changefreq : 'weekly' , priority : '0.6' } ,
{ url : 'recent' , changefreq : 'daily' , priority : '0.4' } ,
{ url : 'users' , changefreq : 'daily' , priority : '0.4' }
] ) ;
} ,
getDynamicUrls : function ( callback ) {
var relative _path = global . nconf . get ( 'relative_path' ) ,
returnUrls = [ ] ;
var returnUrls = [ ] ;
async . parallel ( [
function ( next ) {
@ -24,7 +21,7 @@ var path = require('path'),
categories . getAllCategories ( function ( data ) {
data . categories . forEach ( function ( category ) {
categoryUrls . push ( {
url : path . join ( relative _path , 'category' , category . slug ) ,
url : path . join ( 'category' , category . slug ) ,
changefreq : 'weekly' ,
priority : '0.4'
} ) ;
@ -38,7 +35,7 @@ var path = require('path'),
topics . getAllTopics ( null , null , function ( topics ) {
topics . forEach ( function ( topic ) {
topicUrls . push ( {
url : path . join ( relative _path , 'topic' , topic . slug ) ,
url : path . join ( 'topic' , topic . slug ) ,
changefreq : 'daily' ,
priority : '0.6'
} ) ;
@ -59,7 +56,7 @@ var path = require('path'),
async . parallel ( [ sitemap . getStaticUrls , sitemap . getDynamicUrls ] , function ( err , urls ) {
var urls = urls [ 0 ] . concat ( urls [ 1 ] ) ,
map = sm . createSitemap ( {
hostname : global . nconf . get ( ' base_ url') + ( global . nconf . get ( 'use_port' ) ? ':' + global . nconf . get ( 'port' ) : '' ) + '/' ,
hostname : global . nconf . get ( ' url') ,
cacheTime : 600000 ,
urls : urls
} ) ,