From 6ef861ed79330e6062815517931f8d36700dd145 Mon Sep 17 00:00:00 2001 From: Swaagie Date: Wed, 20 Mar 2013 16:38:22 +0100 Subject: [PATCH] [major] add trailing slashes to urls to please google --- content/a-quickstart/faq.md | 2 +- content/a-quickstart/index.md | 4 ++-- content/appendix/index.md | 8 ++++---- content/appendix/package-json.md | 4 ++-- content/features/business.md | 6 +++--- content/features/index.md | 13 +++++++------ content/features/jitsu.md | 2 +- content/features/webhooks.md | 4 ++-- content/features/webops.md | 4 ++-- content/index.md | 8 ++++---- index.js | 7 +++++-- package.json | 2 +- 12 files changed, 34 insertions(+), 30 deletions(-) diff --git a/content/a-quickstart/faq.md b/content/a-quickstart/faq.md index 1c032b8..3516417 100644 --- a/content/a-quickstart/faq.md +++ b/content/a-quickstart/faq.md @@ -244,7 +244,7 @@ their datacenter. Nodejitsu's cloud services watch your programs for you! You shouldn't have to do anything special to keep your apps running. If you need to scale your app, we -offer the simple way of "[drones](/features#feature/drones)", where you can add +offer the simple way of "[drones](/features/#feature/drones)", where you can add more drones to fit your needs. --- diff --git a/content/a-quickstart/index.md b/content/a-quickstart/index.md index 5425d7b..0412924 100644 --- a/content/a-quickstart/index.md +++ b/content/a-quickstart/index.md @@ -1,4 +1,4 @@ -* [FAQ](/a-quickstart/faq) -* [Hello World!](/a-quickstart/hello-world) +* [FAQ](/a-quickstart/faq/) +* [Hello World!](/a-quickstart/hello-world/) [meta:title]: <> (Quickstart) diff --git a/content/appendix/index.md b/content/appendix/index.md index 80f8297..bd30e63 100644 --- a/content/appendix/index.md +++ b/content/appendix/index.md @@ -1,6 +1,6 @@ -* [More Resources](/appendix/resources) -* [Open Source Projects](/appendix/open-source) -* [Run it yourself with Haibu](/appendix/haibu) -* [Understanding package.json](/appendix/package-json) +* [More Resources](/appendix/resources/) +* [Open Source Projects](/appendix/open-source/) +* [Run it yourself with Haibu](/appendix/haibu/) +* [Understanding package.json](/appendix/package-json/) [meta:title]: <> (Appendix) diff --git a/content/appendix/package-json.md b/content/appendix/package-json.md index 5a60fbf..26c397d 100644 --- a/content/appendix/package-json.md +++ b/content/appendix/package-json.md @@ -40,7 +40,7 @@ that will get called when your application is started. Usage is compatible with `npm start`. And what about that "engines" property? Nodejitsu supports -[multiple versions of node](/documentation/features#feature/multi-node) +[multiple versions of node](/documentation/features/#feature/multi-node) --- @@ -96,7 +96,7 @@ A few package.json properties have special behavior on the Nodejitsu platform: * *analyze*: Set this to "false" to force jitsu to not analyze for the app's dependencies. * *engine*: On Nodejitsu you can choose between different available node.js versions. - [Read more](/documentation/features#feature/multi-node) + [Read more](/documentation/features/#feature/multi-node) [meta:title]: <> (Get into package.json) [meta:description]: <> (package.json.jit.su is an interactive package explorer, it will get you started quickly and is highly helpful) diff --git a/content/features/business.md b/content/features/business.md index d92e458..bf3db16 100644 --- a/content/features/business.md +++ b/content/features/business.md @@ -1,6 +1,6 @@ # Business plan features -If you're one of our **[Business Plan](http://nodejitsu.com/paas/pricing)** +If you're one of our **[Business Plan](https://nodejitsu.com/paas/pricing/)** customers, you have access to special features which give you more selection and reliability. @@ -83,7 +83,7 @@ info: Nodejitsu ok ### Available Datacenters You can deploy to any of the following -[datacenters](http://nodejitsu.com/paas/datacenters): +[datacenters](https://nodejitsu.com/paas/datacenters/): #### Joyent @@ -118,7 +118,7 @@ info: Nodejitsu ok ## Setting up your DNS To setup your custom DNS domain with the correct datacenter you can follow the -[DNS configuration instructions](/documentation/features/dns) from this handbook. +[DNS configuration instructions](/documentation/features/dns/) from this handbook. --- diff --git a/content/features/index.md b/content/features/index.md index d873d55..f67d19f 100644 --- a/content/features/index.md +++ b/content/features/index.md @@ -5,10 +5,10 @@ more! There are three main tools for deploying and managing applications to Nodejitsu: -* [`jitsu`](/features/jitsu), the Nodejitsu command line tool -* The Webops [Web Application](/features/webops), an easy to use web interface +* [`jitsu`](/features/jitsu/), the Nodejitsu command line tool +* The Webops [Web Application](/features/webops/), an easy to use web interface for managing your applications -* Nodejitsu's JSON [API](/api) +* Nodejitsu's JSON [API](/api/) Each of these tools allow developers to access the same functionality. @@ -116,8 +116,8 @@ speak directly to them about your database needs. ### Creating new Databases If you require database hosting you can create a new database instance of any of -our supported databases using [jitsu](/features/jitsu) or Nodejitsu's -[API](/api). Cloud database hosting is currently provided by +our supported databases using [jitsu](/features/jitsu/) or Nodejitsu's +[API](/api/). Cloud database hosting is currently provided by [IrisCouch](http://www.iriscouch.com), [RedisToGo](http://redistogo.com) and [MongoLab](https://www.mongolab.com). @@ -326,7 +326,8 @@ through the balancers. We allow users to host their applications on custom domains by specifying their app's domains in their `package.json` and then properly configuring their DNS. -If you'd like to know how, just read the instructions at [our DNS section](http://handbook.jitsu.com/features/dns)! +If you'd like to know how, just read the instructions at [our DNS +section](/features/dns/)! ### SSL Certificates for Custom Domains diff --git a/content/features/jitsu.md b/content/features/jitsu.md index 8ab5043..6defa6f 100644 --- a/content/features/jitsu.md +++ b/content/features/jitsu.md @@ -30,7 +30,7 @@ action. ### jitsu deploy (jitsu apps deploy) `jitsu deploy` will attempt to deploy the application in the current directory -to [Nodejitsu](http://nodejitsu.com). It deploys your application using the +to [Nodejitsu](https://nodejitsu.com). It deploys your application using the following steps: 1. Creates the application (if necessary) diff --git a/content/features/webhooks.md b/content/features/webhooks.md index 4d53b63..fe7f900 100644 --- a/content/features/webhooks.md +++ b/content/features/webhooks.md @@ -8,7 +8,7 @@ four fields: * Username, which defaults to your Github username * Password, your password or a valid [Nodejitsu API authentication -token](https://handbook.nodejitsu.com/api#create-an-api-token) (`jitsu tokens create github`) +token](/api/#create-an-api-token) (`jitsu tokens create github`) * Branch, where you can define the branch you wish to deploy and defaults to master * Endpoint, which defaults to https://webhooks.nodejitsu.com @@ -128,7 +128,7 @@ curl -X POST https://webhooks.nodejitsu.com/1/auth/github -H "Content-type: appl Don't worry, you can use `jitsu set env` to set environment variables that you can access with `process.env`. Check our -[handbook](https://handbook.nodejitsu.com/features#feature/envvars) for more +[handbook](/features/#feature/envvars) for more information. Environment variables set this way persist across deployments and are also available in our [webops](https://webops.nodejitsu.com) application. diff --git a/content/features/webops.md b/content/features/webops.md index d29f870..671d096 100644 --- a/content/features/webops.md +++ b/content/features/webops.md @@ -2,8 +2,8 @@ The Nodejitsu WebOps interface allows developers to administrate their application through a web interface. This web interface offers the same -functionality that can be found in [jitsu](/features/jitsu) CLI or our -[RESTful API](/api). +functionality that can be found in [jitsu](/features/jitsu/) CLI or our +[RESTful API](/api/). In addition to having feature parity with `jitsu` it also allows you to subscribe to our different payed plans. The WebOps interface be found at diff --git a/content/index.md b/content/index.md index e40dd0b..9db11a3 100644 --- a/content/index.md +++ b/content/index.md @@ -44,15 +44,15 @@ three things to get started: fault-tolerant cloud hosting for your Node.js apps - and we're the best you'll find. * Getting started with [your first app][hello-world] is simple with our - [jitsu](/features/jitsu) command-line interface - we'll + [jitsu](/features/jitsu/) command-line interface - we'll [show you how][hello-world]. * Most of our stack is [open source](http://github.com/nodejitsu) and you can - [use our tools](/appendix/open-source) anywhere else you'd like to. + [use our tools](/appendix/open-source/) anywhere else you'd like to. The Nodejitsu Handbook also contains information on [other ways to deploy your applications](/features/jitsu#using-the-jitsu-cli-usage-jitsu-deploy-jitsu-apps-deploy) -and where to [find support](/support). +and where to [find support](/support/). -[hello-world]: /a-quickstart/hello-world +[hello-world]: /a-quickstart/hello-world/ [meta:title]: <> (Handbook) diff --git a/index.js b/index.js index 5785196..005da0d 100644 --- a/index.js +++ b/index.js @@ -36,6 +36,9 @@ function scrape(content, key, n) { function normalize(file) { if (!file) file = 'index.md'; + // Remove trailing slashes from paths + if (file[file.length - 1] === '/') file = file.slice(0, -1); + return ~file.indexOf('.md') ? file : file + '.md'; } @@ -164,7 +167,7 @@ function walk(dir, callback, result, sub) { // Get the tile of the file. read(file, function getFile(err, file) { result[current][ref] = { - href: sub ? name.join('/') : '', + href: sub ? name.join('/') + '/' : '/', title: file.title, description: file.description, path: dir @@ -216,7 +219,7 @@ function walkSync(dir, result, sub) { // Append file information to current container. file = read(file); result[current][ref] = { - href: sub ? name.join('/') : '', + href: sub ? name.join('/') + '/' : '/', title: file.title, description: file.description, path: dir diff --git a/package.json b/package.json index 04968ac..bc4cbe2 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Nodejitsu (http://nodejitsu.com)", "name": "handbook", "description": "A gentle introduction to the art of nodejitsu", - "version": "0.4.1", + "version": "0.4.2", "subdomain": "handbook", "homepage": "http://www.nodejitsu.com/docs", "repository": {