Skip to content

Commit 0d7a59d

Browse files
dianjuarJohannesHoppe
authored andcommitted
docs: write down configuration file instructions
1 parent eb782e5 commit 0d7a59d

File tree

1 file changed

+47
-16
lines changed

1 file changed

+47
-16
lines changed

README.md

Lines changed: 47 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
![Screenshot](docs/angular-cli-ghpages-deploy.gif)
99

10-
**Table of contents:**
10+
**Table of contents:**
1111

1212
1. [📖 Changelog](#changelog)
1313
2. [⚠️ Prerequisites](#prerequisites)
@@ -24,8 +24,9 @@
2424
- [--no-dotfiles](#no-dotfiles)
2525
- [--cname](#cname)
2626
- [--dry-run](#dry-run)
27-
6. [🏁 Next milestones](#milestones)
28-
7. [⁉️ FAQ](#faq)
27+
6. [📁 Configuration File](#configuration-file)
28+
7. [🏁 Next milestones](#milestones)
29+
8. [⁉️ FAQ](#faq)
2930

3031

3132

@@ -66,18 +67,18 @@ If you already have an existing Angular project on GitHub, skip step 1 and 2.
6667
cd your-angular-project
6768
```
6869

69-
2. By default the Angular CLI initializes a Git repository for you.
70+
2. By default the Angular CLI initializes a Git repository for you.
7071
To add a new remote for GitHub, use the `git remote add` command:
7172

7273
```sh
7374
git remote add origin https://github.com/<username>/<repositoryname>.git
7475
```
7576

76-
Hints:
77+
Hints:
7778
* Create a new empty GitHub repository first.
78-
* Replace `<username>` and `<repositoryname>` with your username from GitHub and the name of your new repository.
79-
* Please enter the URL `https://github.com/<username>/<repositoryname>.git` into your browser – you should see your existing repository on GitHub.
80-
* Please double-check that you have the necessary rights to make changes to the given project!
79+
* Replace `<username>` and `<repositoryname>` with your username from GitHub and the name of your new repository.
80+
* Please enter the URL `https://github.com/<username>/<repositoryname>.git` into your browser – you should see your existing repository on GitHub.
81+
* Please double-check that you have the necessary rights to make changes to the given project!
8182

8283
3. Add `angular-cli-ghpages` to your project.
8384

@@ -98,7 +99,7 @@ If you already have an existing Angular project on GitHub, skip step 1 and 2.
9899
ng run your-angular-project:deploy
99100
```
100101

101-
5. Your project should be available at `https://<username>.github.io/<repositoryname>`.
102+
5. Your project should be available at `https://<username>.github.io/<repositoryname>`.
102103
Learn more about GitHub pages on the [official website](https://pages.github.com/).
103104

104105

@@ -194,7 +195,7 @@ Same as `ng build --configuration=XXX`.
194195
* Default: `Auto-generated commit` (string)
195196
* Example: `ng deploy --message="What could possibly go wrong?"`
196197

197-
The commit message __must be wrapped in quotes__ if there are any spaces in the text.
198+
The commit message __must be wrapped in quotes__ if there are any spaces in the text.
198199
Some handy additional text is always added,
199200
if the environment variable `TRAVIS` exists (for Travis CI) or
200201
if the environment variable `CIRCLECI` exists (for Circle CI).
@@ -204,7 +205,7 @@ if the environment variable `CIRCLECI` exists (for Circle CI).
204205
* __optional__
205206
* Default: `gh-pages` (string)
206207
* Example: `ng deploy --branch=master`
207-
208+
208209
The name of the branch you'll be pushing to.
209210
The default uses GitHub's `gh-pages` branch,
210211
but this can be configured to push to any branch on any remote.
@@ -264,7 +265,7 @@ This should only be necessary if your site uses files or directories that start
264265
* `ng deploy --cname=example.com`
265266

266267
A CNAME file will be created enabling you to use a custom domain.
267-
[More information on GitHub Pages using a custom domain](https://help.github.com/articles/using-a-custom-domain-with-github-pages/).
268+
[More information on GitHub Pages using a custom domain](https://help.github.com/articles/using-a-custom-domain-with-github-pages/).
268269

269270

270271
#### --dry-run <a name="dry-run"></a>
@@ -277,15 +278,45 @@ A CNAME file will be created enabling you to use a custom domain.
277278
Run through without making any changes.
278279
This can be very useful because it outputs what would happen without doing anything.
279280

281+
## 📁 Configuration File <a name="configuration-file"></a>
282+
283+
To avoid all these command-line cmd options, you can write down your configuration in the `angular.json` file in the `options` attribute of your deploy project's architect. Just change the kebab-case<sup id="configuration-file-mark-1">[1](#configuration-file-def-1)</sup> to lower camel case<sup id="configuration-file-mark-2">[2](#configuration-file-def-2)</sup>
284+
285+
Example:
286+
287+
```sh
288+
ng deploy your-project-name --base-href=https://angular-schule.github.io/angular-cli-ghpages/ --name=angular [email protected]
289+
```
290+
291+
becomes
292+
293+
```json
294+
"deploy": {
295+
"builder": "angular-cli-ghpages:deploy",
296+
"options": {
297+
"baseHref": "https://angular-schule.github.io/angular-cli-ghpages/",
298+
"name": "angular",
299+
"email": "[email protected]"
300+
}
301+
}
302+
```
303+
304+
And just run `ng deploy your-project-name` 😄.
305+
306+
###### You can always use the [--dry-run](#dry-run) option to verify if your configuration is right.
307+
308+
---
309+
310+
<a id="configuration-file-def-1">1.</a> In kebab case, all letters are written in lower case and the words are separated by a hyphen or minus sign. "Kebab Case" becomes "kebab-case". [](#configuration-file-mark-1)
280311

312+
<a id="configuration-file-def-2">2.</a> Lower camel case (part of CamelCase) is a naming convention in which a name is formed of multiple words that are joined together as a single word with the first letter of each of the multiple words (except the first one) capitalized within the new word that forms the name. "Lower Camel Case" becomes "lowerCamelCase" [](#configuration-file-mark-2)
281313

282314
## 🏁 Next milestones <a name="milestones"></a>
283315

284316
We are glad that we have an integration into the CLI again.
285317
However, we are looking forward to the following features:
286318

287-
* an interactive command-line prompt that guides you through the available options
288-
* a configuration file (`angular-cli-ghpages.json`) to avoid all these command-line cmd options
319+
* an interactive command-line prompt that guides you through the available options
289320
* your feature that's not on the list yet?
290321

291322
We look forward to any help. PRs are welcome! 😃
@@ -303,11 +334,11 @@ Code released under the [MIT license](LICENSE).
303334

304335
<hr>
305336

306-
<img src="https://assets.angular.schule/logo-angular-schule.png" height="60">
337+
<img src="https://assets.angular.schule/logo-angular-schule.png" height="60">
307338

308339
### &copy; 2019 https://angular.schule
309340

310-
This project is made on top of [tschaub/gh-pages](https://github.com/tschaub/gh-pages).
341+
This project is made on top of [tschaub/gh-pages](https://github.com/tschaub/gh-pages).
311342
Thank you very much for this great foundation!
312343

313344
[npm-url]: https://www.npmjs.com/package/angular-cli-ghpages

0 commit comments

Comments
 (0)