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: docs/getting-started.md
+41-75Lines changed: 41 additions & 75 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,48 +3,29 @@ title: Getting Started
3
3
order: 200
4
4
---
5
5
6
-
# Scully - Getting Started
6
+
# Getting Started with Scully
7
7
8
-
[Español](getting-started_es.md)
8
+
Welcome to Scully!
9
9
10
-
## Prerequisites
10
+
Before getting started, please read the [Prerequisites](pre-requisites.md).
11
11
12
-
The first thing you need to get started with Scully is a working Angular app using **Angular 8.x.x** or **9.x.x** and **Node 12.x.x**
13
-
14
-
You can create a new Angular 9 app using the following command:
15
-
16
-
```bash
17
-
npx -p @angular/cli ng new my-scully-app
18
-
```
19
-
20
-
If that fails, you can install the Angular CLI globally and create a new app with that version.
21
-
22
-
```
23
-
npm install -g @angular/cli
24
-
ng new my-scully-app
25
-
```
26
-
27
-
Find more info here [👉 angular.io/cli](https://angular.io/cli)
28
-
29
-
**NOTE:** Scully will use Chromium. Make sure your Operating System (and its restrictions by your administrator) allow installing and executing Chromium.
30
-
31
-
This getting started doc covers the three steps to adding Scully into your project.
12
+
This getting started guide covers three topics:
32
13
33
14
1.[Installation](#installation)
34
-
2.[Build](#build)
35
-
3.[Test](#test)
15
+
2.[Building](#build)
16
+
3.[Testing](#test)
36
17
37
18
## Installation
38
19
39
-
To install Scully, execute the following command from the root directory of your Angular project (in a terminal window):
20
+
First, open your Angular application. Inside the project's root directory run the following command:
40
21
41
22
```bash
42
23
ng add @scullyio/init
43
24
```
44
25
45
-
The command above installs dependencies and configures the files needed to start building with Scully (_we will further elaborate on this in upcoming releases_).
26
+
This command installs dependencies and configures the files needed by Scully.
46
27
47
-
If the installation was successful a message similar to this one will be displayed:
28
+
Once the installation finishes the following message will be displayed:
#### IMPORTANT: _Scully requires the router to be present in your application, don't forget to add it._
63
-
64
-
#### IMPORTANT: _Scully requires the distribution files to be in a subfolder of `./dist`_
65
-
66
-
If you have an angular app, that outputs the distribution files directly into the root of `./dist` Scully can't copy all of the dist files. This is an OS file-system issue. We can't copy recursively into a subfolder of dist. The solution is to set the option `architect->build->options->outputPath` to a subfolder.
43
+
## ng generate @scullyio/init:blog
67
44
68
-
## ng g @scullyio/init:blog
45
+
This command will generate a blog module. [more info here](blog.md)
69
46
70
-
This command will generate a blog module. [more info here](https://github.com/scullyio/scully/blob/master/docs/blog.md)
71
-
72
-
Once it's generated you can open the default `app.component.html` created by angular-cli and remove the whole placeholder leaving only the router outlet tag `<router-outlet></router-outlet>`
47
+
Once it is generated remove all the content in the `app.component.html` file, and add only the router outlet tag `<router-outlet></router-outlet>`.
73
48
74
49
### Home page
75
50
76
-
Since the default template from angular-cli doesn't ship an entry point for route, it might be confusing to get Scully working on the very first shot.
51
+
It is necessary to create a _route entry point_ because the Angular CLI does not create one by default.
52
+
53
+
Create a _Home Module_ with a _Home Component_ and its routes already configured with the following command:
@@ -119,7 +94,7 @@ export class HomeComponent implements OnInit {
119
94
}
120
95
```
121
96
122
-
and then loop inside `home.component.html`
97
+
Now, it is possible to loop through the links inside the template by opening the `home.component.html` file and adding the following code:
123
98
124
99
```html
125
100
<p>home works!</p>
@@ -129,46 +104,37 @@ and then loop inside `home.component.html`
129
104
</ul>
130
105
```
131
106
132
-
## Build
133
-
134
-
By now you should have your Angular project with Scully successfully installed, so let us run a Scully build and turn your site into a
135
-
pre-rendered Angular app.
136
-
137
-
Since Scully runs based on a build of your app, the first step is to build your Angular project (with added routes), subsequently running the Scully build.
107
+
**NOTE:** If you don't add any route, scully will pre-render 0 pages.
138
108
139
-
```bash
140
-
ng build
141
-
npm run scully
142
-
```
109
+
## Build
143
110
144
-
That's it, you're done! In your project directory, you should now have a `/dist/static` folder containing the built version
145
-
of your app.
111
+
At this point, you have your Angular project with Scully successfully installed.
146
112
147
-
**NOTE:** If you had any errors or warnings during the build phase, please follow the instructions in the errors/warnings
148
-
(if applicable) or [submit an issue](https://github.com/scullyio/scully/issues/new/choose).
113
+
#### IMPORTANT: _Scully requires the distribution files in the `./dist/my-scully-app` folder._
149
114
150
-
**NOTE:** If you don't add any route, scully will pre-render 0 pages.
115
+
**NOTE:** If the angular application outputs the distribution files directly into the root folder `./dist`. Scully is not able to copy all files. This is an OS file-system issue.
151
116
152
-
## Test
117
+
Build the application in order to generate the distribution files:
153
118
154
-
Now that your project has been pre-rendered, you can validate the build by either:
119
+
```
120
+
ng build
121
+
```
155
122
156
-
#### Serving the contents
123
+
Now, lets build Scully and turn your Angular app into a pre-rendered static site.
157
124
158
-
By utilizing something like [http-server](https://www.npmjs.com/package/http-server) you can serve the contents of your
159
-
`dist/static` folder. All of the routes in your non-pre-rendered Angular app should still work. Not all apps are
160
-
capable of running without.
125
+
```bash
126
+
npm run scully
127
+
```
161
128
162
-
[//]: #'Missing text for the line above'
129
+
Congratulations! You have turned your Angular application into a wicked fast pre-rendered one thanks to Scully.
163
130
164
-
**Extra Credit**: While serving your app, [disable JavaScript](https://developers.google.com/web/tools/chrome-devtools/javascript/disable)
165
-
and make sure that it still works. This is the goal for your app, to run with JavaScript disabled. Most parts of your app should still work without JS enabled.
131
+
The built version is in the `./dist/static` folder. This folder contains ol the pages in the site.
166
132
167
-
#### Browsing the contents
133
+
**NOTE:** In case of any errors or warnings during the build process, please follow the instructions in the errors/warnings section (_Coming soon_) or [submit an issue](https://github.com/scullyio/scully/issues/new/choose).
168
134
169
-
Browse the contents of your `dist/static` directory and make sure that all of your pages were pre-rendered and saved to
170
-
HTML correctly.
135
+
#### Serving the content
171
136
172
-
---
137
+
Use [http-server](https://www.npmjs.com/package/http-server) to serve the `dist/static` folder's content.
173
138
174
-
[Full Documentation ➡️](scully.md)
139
+
**Extra Credit**: While serving the static app, [disable JavaScript](https://developers.google.com/web/tools/chrome-devtools/javascript/disable)
140
+
and make sure that the site's navigation still works and most parts of it should still work without JS enabled.
To create a bug report go to [Scully Bug template](https://github.com/scullyio/scully/issues/new?assignees=&labels=bug&template=---bug-report.md&title=).
4
9
5
10
To propose a new feature go to [Scully Feature request](https://github.com/scullyio/scully/issues/new?assignees=&labels=enhancement&template=---feature-request.md&title=)
6
11
7
-
We are working on better documentation for creating issues.
8
-
9
-
[Full Documentation ➡️](scully.md)
12
+
The Scully team is working on better documentation for creating issues.
0 commit comments