You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/dummy/app/pods/docs/deploying/template.md
+19-18
Original file line number
Diff line number
Diff line change
@@ -21,38 +21,39 @@ Now take a look at the `gh-pages` branch either locally or on GitHub. You should
21
21
```sh
22
22
├── 404.html
23
23
├── index.html
24
-
├── [current-branch]
25
-
│ ├── assets
26
-
│ ├── index.html
27
-
│ └── ...
24
+
├── v
25
+
│ └── [current-branch]
26
+
│ ├── assets
27
+
│ ├── index.html
28
+
│ └── ...
28
29
└── versions.json
29
30
```
30
31
31
32
Let's break down what each of those items is doing.
32
-
-`index.html` simply redirects from the root of your gh-pages site to `/latest` (more details on that [below](#tag-deploys))
33
+
-`index.html` simply redirects from the root of your gh-pages site to `/v/latest` (more details on that [below](#tag-deploys))
33
34
-`404.html` contains [some smart redirect logic](https://github.com/rafrex/spa-github-pages) to keep you from having to use `locationType: 'hash'` in your dummy app
34
35
-`versions.json` contains a manifest of the available versions of your documentation
35
-
-`[current-branch]` contains all the files from your built docs app
36
+
-`v/[current-branch]` contains all the files from your built docs app
36
37
37
-
If you were to make a change to your dummy app and run `ember deploy production` again right now, the entry for `[current-branch]` in `version.json` and the entire contents of the `[current-branch]` directory would be replaced with the updated version of your site. Next we'll talk about how to manage keeping published documentation around for multiple versions of your addon.
38
+
If you were to make a change to your dummy app and run `ember deploy production` again right now, the entry for `[current-branch]` in `version.json` and the entire contents of the `v/[current-branch]` directory would be replaced with the updated version of your site. Next we'll talk about how to manage keeping published documentation around for multiple versions of your addon.
38
39
39
40
## Versioning your content
40
41
41
42
Whenever you deploy your documentation site with Addon Docs, it places the compiled application in a subdirectory based on the current state of your git repository. All of this behavior [is customizable](#customizing-deploys), but we expect the out-of-the-box configuration should be a good place to get started.
42
43
43
44
### Tag deploys
44
45
45
-
When you run `ember deploy` at a commit that has a git tag associated with it, the app will wind up in a directory named after that tag. For example, if you've just published version 1.2.3 of your addon (creating tag `v1.2.3` in your git repository), your deployed site will be available at <u>https://**[user]**.github.io/**[repo]**/v1.2.3</u>.
46
+
When you run `ember deploy` at a commit that has a git tag associated with it, the app will wind up in a directory named after that tag. For example, if you've just published version 1.2.3 of your addon (creating tag `v1.2.3` in your git repository), your deployed site will be available at <u>https://**[user]**.github.io/**[repo]**/v/1.2.3</u>.
46
47
47
-
By default, deploying from a tagged commit also places a copy of your app under a special directory called `/latest`. As mentioned above, the `index.html` that Addon Docs sets up at the root redirects to `/latest`, so <u>https://**[user]**.github.io/**[repo]**</u> will always bring developers to the documentation for the most recent stable release of your addon.
48
+
By default, deploying from a tagged commit also places a copy of your app under a special directory called `/v/latest`. As mentioned above, the `index.html` that Addon Docs sets up at the root redirects to `/v/latest`, so <u>https://**[user]**.github.io/**[repo]**</u> will always bring developers to the documentation for the most recent stable release of your addon.
48
49
49
-
Note that this only applies to non-prerelease tags, so `v1.2.3` would update `/latest`, but `v2.0.0-beta.1` would not. Check out the documentation for [node-semver](https://github.com/npm/node-semver) for the exact details on what constitutes a prerelease version.
50
+
Note that this only applies to non-prerelease tags, so `v1.2.3` would update `/v/latest`, but `v2.0.0-beta.1` would not. Check out the documentation for [node-semver](https://github.com/npm/node-semver) for the exact details on what constitutes a prerelease version.
50
51
51
52
### Branch deploys
52
53
53
-
When you deploy from a commit at the head of a branch that _doesn't_ have a tag associated with it, the compiled app will land in a folder named after that branch, as in our "getting started" example above. Unlike tag deploys, branch deploys will never automatically update `/latest`.
54
+
When you deploy from a commit at the head of a branch that _doesn't_ have a tag associated with it, the compiled app will land in a folder named after that branch, as in our "getting started" example above. Unlike tag deploys, branch deploys will never automatically update `/v/latest`.
54
55
55
-
The main use case for branch deploys is tracking development work since your last stable release. If you run `ember deploy` after successful builds on `master`, you'll always have documentation available for the bleeding edge of your addon's features. Since branch deploys don't update `/latest`, though, developers looking at your docs will still hit your most recent stable tag by default, so there won't be any confusion about things that have drifted since the last release.
56
+
The main use case for branch deploys is tracking development work since your last stable release. If you run `ember deploy` after successful builds on `master`, you'll always have documentation available for the bleeding edge of your addon's features. Since branch deploys don't update `/v/latest`, though, developers looking at your docs will still hit your most recent stable tag by default, so there won't be any confusion about things that have drifted since the last release.
56
57
57
58
## Automating deploys
58
59
@@ -121,19 +122,19 @@ You can override methods on this class to customize deploy behavior.
121
122
122
123
### `getVersionPath()`
123
124
124
-
This method determines the location that a given version of your documentation will be written to on your deploy branch.
125
+
This method determines the location that a given version of your documentation will be written to within the `v` directory on your deploy branch.
125
126
126
-
By default, this method will use the current tag name (if any), or fall back to the current branch name as described above. Note that you can override this behavior by setting an `ADDON_DOCS_VERSION_PATH` environment variable.
127
+
By default, this method will use the current tag name (if any) stripped of its leading `v`, or fall back to the current branch name as described above. Note that you can override this behavior by setting an `ADDON_DOCS_VERSION_PATH` environment variable.
127
128
128
129
If this method returns a falsey value, the deploy will be aborted.
129
130
130
131
### `getVersionName()`
131
132
132
-
This method returns a name for a given version of your documentation. By default it just returns the same thing as `getVersionPath()`, but if, for instance, you wanted to set up named releases, you might override this method. You can also explicitly specify the version name by setting an `ADDON_DOCS_VERSION_NAME` environment variable.
133
+
This method returns a name for a given version of your documentation. By default it returns the current tag if any, or the current branch name otherwise. If, for instance, you wanted to set up named releases, you might override this method. You can also explicitly specify the version name by setting an `ADDON_DOCS_VERSION_NAME` environment variable.
133
134
134
135
### `shouldUpdateLatest()`
135
136
136
-
This method determines whether the `/latest` directory will also be updated with the current deploy. By default, this will return true for builds from a tagged commit where the tag is a [semver non-prerelease version](https://github.com/npm/node-semver), and false otherwise. You can explicitly set the `ADDON_DOCS_UPDATE_LATEST` environment variable to `true` or `false` to override this behavior.
137
+
This method determines whether the `/v/latest` directory will also be updated with the current deploy. By default, this will return true for builds from a tagged commit where the tag is a [semver non-prerelease version](https://github.com/npm/node-semver), and false otherwise. You can explicitly set the `ADDON_DOCS_UPDATE_LATEST` environment variable to `true` or `false` to override this behavior.
137
138
138
139
### `getRootURL()`
139
140
@@ -149,15 +150,15 @@ Deploying a version of your documentation does two things: it copies the `dist`
149
150
150
151
First, you can run `git checkout gh-pages` to switch to your deploy branch. You may see a message indicating that that branch has already been checked out somewhere else by `git worktree`—if that's the case, you can just `cd` to that directory instead.
151
152
152
-
Next, remove the item from `versions.json` for the version you want to get rid of, and delete the corresponding directory. For example, if you ran a deploy on a branch called `deploy-test` and wanted to remove the results of that after you finished testing it out, you could `git rm deploy-test` to remove the deployed app, and then find the `deploy-test` key in `versions.json` and remove it:
153
+
Next, remove the item from `versions.json` for the version you want to get rid of, and delete the corresponding directory. For example, if you ran a deploy on a branch called `deploy-test` and wanted to remove the results of that after you finished testing it out, you could `git rm v/deploy-test` to remove the deployed app, and then find the `deploy-test` key in `versions.json` and remove it:
0 commit comments