|
|
|
@ -9,6 +9,7 @@ module.exports = function(Meta) {
|
|
|
|
|
var tests = {
|
|
|
|
|
isCategory: /^category\/\d+\/?/,
|
|
|
|
|
isTopic: /^topic\/\d+\/?/,
|
|
|
|
|
isTag: /^tags\/[\s\S]+\/?/,
|
|
|
|
|
isUserPage: /^user\/[^\/]+(\/[\w]+)?/
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -25,6 +26,7 @@ module.exports = function(Meta) {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Meta.title.parseFragment = function (urlFragment, language, callback) {
|
|
|
|
|
console.log(urlFragment);
|
|
|
|
|
var translated = ['', 'recent', 'unread', 'users', 'notifications'];
|
|
|
|
|
if (translated.indexOf(urlFragment) !== -1) {
|
|
|
|
|
if (!urlFragment.length) {
|
|
|
|
@ -42,6 +44,9 @@ module.exports = function(Meta) {
|
|
|
|
|
var tid = urlFragment.match(/topic\/(\d+)/)[1];
|
|
|
|
|
|
|
|
|
|
require('../topics').getTopicField(tid, 'title', callback);
|
|
|
|
|
} else if (tests.isTag.test(urlFragment)) {
|
|
|
|
|
var tag = urlFragment.match(/tags\/([\s\S]+)/)[1];
|
|
|
|
|
callback(null, tag);
|
|
|
|
|
} else if (tests.isUserPage.test(urlFragment)) {
|
|
|
|
|
var matches = urlFragment.match(/user\/([^\/]+)\/?([\w]+)?/),
|
|
|
|
|
userslug = matches[1],
|
|
|
|
|