From d47f174848bd7c369da20126772b14c31e86f116 Mon Sep 17 00:00:00 2001 From: Andrew Miner Date: Tue, 5 Apr 2016 21:41:47 -0700 Subject: [PATCH] Add meta descriptions for new pages --- .gitignore | 1 + .../browse_page/browse_page_controller.coffee | 3 +++ .../news_page/news_page_controller.coffee | 3 +++ .../tutorial_page_controller.coffee | 8 ++++++++ src/common/constants.coffee | 19 ++++++++++--------- 5 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index fcc975a62..e9f58ddb4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.log .DS_Store .sass-cache +.tm_properties aws.config build deploy diff --git a/src/client/site/browse_page/browse_page_controller.coffee b/src/client/site/browse_page/browse_page_controller.coffee index 7791c7c44..ac95f7bce 100644 --- a/src/client/site/browse_page/browse_page_controller.coffee +++ b/src/client/site/browse_page/browse_page_controller.coffee @@ -23,6 +23,9 @@ module.exports = class BrowsePageController extends PageController # PageController Overrides ##################################################################### + getMetaDescription: -> + return c.text.browseDescription() + getTitle: -> return "Browse" diff --git a/src/client/site/news_page/news_page_controller.coffee b/src/client/site/news_page/news_page_controller.coffee index 170af6c5f..51490acd6 100644 --- a/src/client/site/news_page/news_page_controller.coffee +++ b/src/client/site/news_page/news_page_controller.coffee @@ -18,6 +18,9 @@ module.exports = class NewsPageController extends PageController # PageController Overrides ##################################################################### + getMetaDescription: -> + return c.text.newsDescription() + getTitle: -> return "News" diff --git a/src/client/site/tutorial_page/tutorial_page_controller.coffee b/src/client/site/tutorial_page/tutorial_page_controller.coffee index 0f37b4452..bf572d51f 100644 --- a/src/client/site/tutorial_page/tutorial_page_controller.coffee +++ b/src/client/site/tutorial_page/tutorial_page_controller.coffee @@ -34,6 +34,14 @@ module.exports = class TutorialPageController extends PageController # PageController Overrides ##################################################################### + getMetaDescription: -> + return unless @_model? + + mod = @_modPack.getMod @_model.modSlug + return unless mod? + + return c.text.tutorialDescription name:@_model.name, mod:mod.name + getTitle: -> return null unless @model? return @model.name diff --git a/src/common/constants.coffee b/src/common/constants.coffee index d5e035ec7..4f831938e 100644 --- a/src/common/constants.coffee +++ b/src/common/constants.coffee @@ -112,15 +112,16 @@ exports.requiredMods = [ 'minecraft' ] exports.server = {} exports.server.defaultPort = 8080 -exports.text = text = {} -text.browseDescription = _.template 'Browse through complete item listings for over a dozen top mods and use the interactive crafting planner for step-by-step instructions' -text.configDescription = _.template 'Configure the interactive crafting planner for your exact modpack and get step-by-step instructions for any item in your world' -text.craftDescription = _.template 'Build anything in your Minecraft mod pack with a full list of materials and step-by-step instructions using our interactive crafting planner' -text.homeDescription = _.template 'Find everything you need to know about your Minecraft mod pack and use the interactive crafting planner for step-by-step instructions and full lists of materials' -text.itemDescription = _.template 'Make <%= itemName %> and the rest of <%= modName %> easy and use the interactive crafting planner for step-by-step instructions' -text.modDescription = _.template 'Make <%= modName %> easy with tutorials, videos, and a full item listing along with an interactive crafting planner for step-by-step instructions' -text.title = _.template 'Minecraft Crafting Guide' -text.titleWithText = _.template '<%= text %> | Minecraft Crafting Guide' +exports.text = text = {} +text.browseDescription = _.template 'Browse through complete item listings for over a dozen top mods and use the interactive crafting planner for step-by-step instructions' +text.configDescription = _.template 'Configure the interactive crafting planner for your exact modpack and get step-by-step instructions for any item in your world' +text.craftDescription = _.template 'Build anything in your Minecraft mod pack with a full list of materials and step-by-step instructions using our interactive crafting planner' +text.newsDescription = _.template 'Find everything you need to know about your Minecraft mod pack and use the interactive crafting planner for step-by-step instructions and full lists of materials' +text.itemDescription = _.template 'Make <%= itemName %> and the rest of <%= modName %> easy and use the interactive crafting planner for step-by-step instructions' +text.modDescription = _.template 'Make <%= modName %> easy with tutorials, videos, and a full item listing along with an interactive crafting planner for step-by-step instructions' +text.title = _.template 'Minecraft Crafting Guide' +text.titleWithText = _.template '<%= text %> | Minecraft Crafting Guide' +text.tutorialDescription = _.template 'Learn about <%= name %> in <%= mod %> and use the interactive crafting planner to get ready for your build!' exports.url = url = {} url.crafting = _.template "/craft/<%= inventoryText %>"