Baris Usakli 12 years ago
commit 6e5420fd64

@ -5,7 +5,9 @@
<div class="alert"> <div class="alert">
<form> <form>
<label>Site Title</label> <label>Site Title</label>
<input type="text" placeholder="My Forum" data-field="title" /> <input type="text" placeholder="Your Community Name" data-field="title" />
<label>Site Description</label>
<input type="text" class="input-xxlarge" placeholder="A short description about your community" data-field="description" />
</form> </form>
</div> </div>

@ -48,8 +48,8 @@
</button> </button>
</div> </div>
<div class="btn-group"> <div class="btn-group">
<button class="btn btn-primary btn post_reply" type="button">Reply <i class="icon-reply"></i></button>
<button id="quote_{main_posts.pid}_{main_posts.uid}" class="btn quote" type="button" title="Quote"><i class="icon-quote-left"></i></button> <button id="quote_{main_posts.pid}_{main_posts.uid}" class="btn quote" type="button" title="Quote"><i class="icon-quote-left"></i></button>
<button class="btn btn-primary btn post_reply" type="button">Reply <i class="icon-reply"></i></button>
</div> </div>
</div> </div>
<div style="clear:both; margin-bottom: 10px;"></div> <div style="clear:both; margin-bottom: 10px;"></div>

@ -34,7 +34,8 @@ var express = require('express'),
var defaultMetaTags = [ var defaultMetaTags = [
{ name: 'viewport', content: 'width=device-width, initial-scale=1.0' }, { name: 'viewport', content: 'width=device-width, initial-scale=1.0' },
{ name: 'content-type', content: 'text/html; charset=UTF-8' }, { name: 'content-type', content: 'text/html; charset=UTF-8' },
{ name: 'apple-mobile-web-app-capable', content: 'yes' } { name: 'apple-mobile-web-app-capable', content: 'yes' },
{ property: 'og:site_name', content: global.config.title || 'NodeBB' },
], ],
metaString = utils.buildMetaTags(defaultMetaTags.concat(options.metaTags || [])), metaString = utils.buildMetaTags(defaultMetaTags.concat(options.metaTags || [])),
templateValues = { templateValues = {
@ -175,7 +176,16 @@ var express = require('express'),
app.get('/', function(req, res) { app.get('/', function(req, res) {
async.parallel({ async.parallel({
"header": function(next) { "header": function(next) {
app.build_header({ req: req, res: res }, next); app.build_header({
req: req,
res: res,
metaTags: [
{ name: "title", content: global.config.title || 'NodeBB' },
{ name: "description", content: global.config.description || '' },
{ property: 'og:title', content: 'Index | ' + (global.config.title || 'NodeBB') },
{ property: "og:type", content: 'website' }
]
}, next);
}, },
"categories": function(next) { "categories": function(next) {
categories.getAllCategories(function(returnData) { categories.getAllCategories(function(returnData) {
@ -214,12 +224,27 @@ var express = require('express'),
}); });
}, },
function(topicData, next) { function(topicData, next) {
var posts = topicData.posts.push(topicData.main_posts[0]),
lastMod = 0,
timestamp;
for(var x=0,numPosts=topicData.posts.length;x<numPosts;x++) {
timestamp = parseInt(topicData.posts[x].timestamp, 10);
if (timestamp > lastMod) lastMod = timestamp;
}
app.build_header({ app.build_header({
req: req, req: req,
res: res, res: res,
title: topicData.topic_name, title: topicData.topic_name,
metaTags: [ metaTags: [
{ name: "title", content: topicData.topic_name } { name: "title", content: topicData.topic_name },
{ property: 'og:title', content: topicData.topic_name + ' | ' + (global.config.title || 'NodeBB') },
{ property: "og:type", content: 'article' },
{ property: "og:url", content: global.nconf.get('url') + 'topic/' + topicData.slug },
{ property: 'og:image', content: topicData.main_posts[0].picture },
{ property: "article:published_time", content: new Date(parseInt(topicData.main_posts[0].timestamp, 10)).toISOString() },
{ property: 'article:modified_time', content: new Date(lastMod).toISOString() },
{ property: 'article:section', content: topicData.category_name }
] ]
}, function(err, header) { }, function(err, header) {
next(err, { next(err, {
@ -269,7 +294,8 @@ var express = require('express'),
title: categoryData.category_name, title: categoryData.category_name,
metaTags: [ metaTags: [
{ name: 'title', content: categoryData.category_name }, { name: 'title', content: categoryData.category_name },
{ name: 'description', content: categoryData.category_description } { name: 'description', content: categoryData.category_description },
{ property: "og:type", content: 'website' }
] ]
}, function(err, header) { }, function(err, header) {
next(err, { next(err, {

Loading…
Cancel
Save