Improve SEO by pre-rendering all HTML pages

* Change all internal links to use URLs ending in `/`
* Add the prerender script which uses PhantomJS to pre-render the
  HTML for all possible pages in the system
* Change the build process to incorporate the pre-rendered files
* Update the sitemap script to generate the new URLs
This commit is contained in:
Andrew Miner
2015-03-06 22:31:39 -08:00
parent a9dc4e3a26
commit 6c7274c38c
2121 changed files with 195933 additions and 3118 deletions
+1 -1
View File
@@ -32,5 +32,5 @@
.action
iframe(src="http://ghbtns.com/github-btn.html?user=andrewminer&repo=crafting-guide&type=fork&size=large",
allowtransparency="true", frameborder="0", scrolling="0", width="100", height="32")
a(href="/test.html")
a(href="/test.html", rel="nofollow")
.divider.bottom
+3 -3
View File
@@ -17,12 +17,12 @@
a(data-page="home", href="/")
p Home
.dot
a(data-page="configure", href="/configure")
a(data-page="configure", href="/configure/")
p Configure
.dot
a(data-page="browse", href="/browse")
a(data-page="browse", href="/browse/")
p Browse
.dot
a(data-page="craft", href="/craft")
a(data-page="craft", href="/craft/")
p Craft
.dot
+2096 -2096
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -58,8 +58,8 @@ Text.title = 'Crafting Guide for Minecraft | The Ultimate Step-by-Step Tutorial
exports.Url = Url = {}
Url.crafting = _.template "/craft/<%= inventoryText %>"
Url.itemIcon = _.template "/data/<%= modSlug %>/<%= modVersion %>/images/<%= itemSlug %>.png"
Url.item = _.template "/browse/<%= modSlug %>/<%= itemSlug %>"
Url.mod = _.template "/browse/<%= modSlug %>"
Url.item = _.template "/browse/<%= modSlug %>/<%= itemSlug %>/"
Url.mod = _.template "/browse/<%= modSlug %>/"
Url.modData = _.template "/data/<%= modSlug %>/mod.cg"
Url.modLogo = _.template "/data/<%= modSlug %>/logo.png"
Url.modVersion = _.template "/data/<%= modSlug %>/<%= modVersion %>/mod-version.cg"
@@ -43,6 +43,8 @@ module.exports = class ImageLoader
return data.isLoaded
load: (imageUrl, $el)->
return if not $el
data = @preload imageUrl
if $el.attr('src')?
return if $el.attr('src').indexOf(imageUrl) isnt -1
+7 -10
View File
@@ -64,16 +64,13 @@ module.exports = class CraftingGuideRouter extends Backbone.Router
@_recordPageView()
routes:
'': 'route__home'
'browse': 'route__browse'
'browse/': 'route__browse'
'browse/:modSlug': 'route__browseMod'
'browse/:modSlug/:itemSlug': 'route__browseModItem'
'configure': 'route__configure'
'configure/': 'route__configure'
'craft': 'route__craft'
'craft/': 'route__craft'
'craft/:text': 'route__craft'
'(/)': 'route__home'
'browse(/)': 'route__browse'
'browse/:modSlug(/)': 'route__browseMod'
'browse/:modSlug/:itemSlug(/)': 'route__browseModItem'
'configure(/)': 'route__configure'
'craft(/)': 'route__craft'
'craft/:text': 'route__craft'
'item/:itemSlug': 'deprecated__item'
'crafting/(:text)': 'deprecated__crafting'
+7 -7
View File
@@ -7,13 +7,13 @@
.view__home_page
.sidebar
.titleImage <a href="/browse/minecraft"><img src="/data/minecraft/logo.png"></a>
.titleImage <a href="/browse/buildcraft"><img src="/data/buildcraft/logo.png"></a>
.titleImage <a href="/browse/industrial_craft_2"><img src="/data/industrial_craft_2/logo.png"></a>
.titleImage <a href="/browse/applied_energistics_2"><img src="/data/applied_energistics_2/logo.png"></a>
.titleImage <a href="/browse/thermal_expansion"><img src="/data/thermal_expansion/logo.png"></a>
.titleImage <a href="/browse/enderio"><img src="/data/enderio/logo.png"></a>
.titleImage <a href="/browse/railcraft"><img src="/data/railcraft/logo.png"></a>
.titleImage <a href="/browse/minecraft/"><img src="/data/minecraft/logo.png"></a>
.titleImage <a href="/browse/buildcraft/"><img src="/data/buildcraft/logo.png"></a>
.titleImage <a href="/browse/industrial_craft_2/"><img src="/data/industrial_craft_2/logo.png"></a>
.titleImage <a href="/browse/applied_energistics_2/"><img src="/data/applied_energistics_2/logo.png"></a>
.titleImage <a href="/browse/thermal_expansion/"><img src="/data/thermal_expansion/logo.png"></a>
.titleImage <a href="/browse/enderio/"><img src="/data/enderio/logo.png"></a>
.titleImage <a href="/browse/railcraft/"><img src="/data/railcraft/logo.png"></a>
.mainBody
.section