Skip to content

Commit 0694957

Browse files
committed
Merge branch '0.4.0'
2 parents 347ece3 + fe5dfd1 commit 0694957

File tree

2 files changed

+29
-26
lines changed

2 files changed

+29
-26
lines changed

controllers/blog.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module.exports = function BlogModule(pb) {
2222

2323
//pb dependencies
2424
var util = pb.util;
25+
var config = pb.config;
2526
var PluginService = pb.PluginService;
2627
var TopMenu = pb.TopMenuService;
2728
var Comments = pb.CommentService;
@@ -48,13 +49,14 @@ module.exports = function BlogModule(pb) {
4849

4950
contentService.getSettings(function(err, contentSettings) {
5051
self.gatherData(function(err, data) {
51-
ArticleService.getMetaInfo(data.content[0], function(metaKeywords, metaDescription, metaTitle, metaThumbnail) {
52+
var articleService = new pb.ArticleService();
53+
articleService.getMetaInfo(data.content[0], function(metaKeywords, metaDescription, metaTitle, metaThumbnail) {
5254

5355
self.ts.reprocess = false;
5456
self.ts.registerLocal('meta_keywords', metaKeywords);
5557
self.ts.registerLocal('meta_desc', metaDescription);
5658
self.ts.registerLocal('meta_title', metaTitle);
57-
self.ts.registerLocal('meta_lang', localizationLanguage);
59+
self.ts.registerLocal('meta_lang', config.localization.defaultLocale);
5860
self.ts.registerLocal('meta_thumbnail', metaThumbnail);
5961
self.ts.registerLocal('current_url', self.req.url);
6062
self.ts.registerLocal('navigation', new pb.TemplateValue(data.nav.navigation, false));

controllers/index.js

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
11
module.exports = function IndexModule(pb) {
2+
23
/**
34
* Index - The home page controller of the portfolio theme.
45
*
56
* @author Blake Callens <[email protected]>
67
* @copyright 2014 PencilBlue, LLC. All Rights Reserved
78
*/
8-
99
function Index() {}
1010

11-
//dependencies
12-
var PluginService = pb.PluginService;
13-
var util = pb.util;
14-
var TopMenu = pb.TopMenuService;
15-
var Comments = pb.CommentService;
16-
var ArticleService = pb.ArticleService;
17-
var externalProfiles = PluginService.getService('external_profiles', 'devblog-pencilblue');
18-
var pluginService = new PluginService();
11+
//dependencies
12+
var util = pb.util;
13+
var config = pb.config;
14+
var PluginService = pb.PluginService;
15+
var TopMenu = pb.TopMenuService;
16+
var Comments = pb.CommentService;
17+
var ArticleService = pb.ArticleService;
18+
var externalProfiles = PluginService.getService('external_profiles', 'devblog-pencilblue');
19+
var pluginService = new PluginService();
1920

20-
//inheritance
21-
util.inherits(Index, pb.BaseController);
21+
//inheritance
22+
util.inherits(Index, pb.BaseController);
2223

23-
/**
24-
* This is the function that will be called by the system's RequestHandler. It
25-
* will map the incoming route to the ones below and then instantiate this
26-
* prototype. The request handler will then proceed to call this function.
27-
* Its callback should contain everything needed in order to provide a response.
28-
*
29-
* @param cb The callback. It does not require a an error parameter. All
30-
* errors should be handled by the controller and format the appropriate
31-
* response. The system will attempt to catch any catastrophic errors but
32-
* makes no guarantees.
33-
*/
34-
Index.prototype.render = function(cb) {
24+
/**
25+
* This is the function that will be called by the system's RequestHandler. It
26+
* will map the incoming route to the ones below and then instantiate this
27+
* prototype. The request handler will then proceed to call this function.
28+
* Its callback should contain everything needed in order to provide a response.
29+
*
30+
* @param cb The callback. It does not require a an error parameter. All
31+
* errors should be handled by the controller and format the appropriate
32+
* response. The system will attempt to catch any catastrophic errors but
33+
* makes no guarantees.
34+
*/
35+
Index.prototype.render = function(cb) {
3536
var self = this;
3637

3738
var content = {
@@ -70,7 +71,7 @@ module.exports = function IndexModule(pb) {
7071
self.ts.registerLocal('meta_keywords', homePageKeywords);
7172
self.ts.registerLocal('meta_desc', homePageDescription);
7273
self.ts.registerLocal('meta_title', pb.config.siteName);
73-
self.ts.registerLocal('meta_lang', localizationLanguage);
74+
self.ts.registerLocal('meta_lang', config.localization.defaultLocale);
7475
self.ts.registerLocal('current_url', self.req.url);
7576
self.ts.registerLocal('navigation', new pb.TemplateValue(navigation, false));
7677
self.ts.registerLocal('account_buttons', new pb.TemplateValue(accountButtons, false));

0 commit comments

Comments
 (0)