In an existing Angular app, first install scully by using the CLI:
ng add @herodevs/scully-generate --blog
When that is done, the following things will have happened.
- We installed all the dependencies most of those are only developer dependencies.
- We added a
scully.json
sample configuration.
The --blog
is optional and will add the below in one step.
- add a folder
./blog
to the project root. - add a lazy loaded blog module to your app.
- put in a sample route to this module
- added a blog component, that shows how to sue the
<scully-content>
component - put in a sample mardown first blog entry in the folder
You can do this later on by using:
ng generate @herodevs/scully-generate:blog
To add a page to the blog you can use:
ng g @herodevs/scully-generate:post --title=MyBeautifulWebApp
This will create a new MD file in the ./blog
folder. if you provided the optional --title
option, it will use the name given, otherwise it will create a file named blogxxx.md
where xxx is a number. it warns when the file already exists.
A blog file will start with an header. We are using the standard front-matter to extract this header.
The meta-data available in there will be available to you by injecting the ScullyRoutesService
Now you are ready run the scully you can do this by:
npm run scully:generate
When are done with this, inside your dist folder is a static folder, with all pages generated.
To be able to test you app you can run
TBD