Options for @scullyio/init:markdown and @scullyio/init:blog
See original GitHub issueš§© Feature request
When generating a new blog it would be great to have some more Options:
ng g @scullyio/init:blog <options>
Description
I think it would be good to have at least three more configuration options when creating a blog, to define the basic module name, the source directory for the blog content files and the route for availability of the static pages.
Describe the solution youād like
baseName
- The basic Name and prefix thatās used for theBlogModule
andBlogComponent
, etc. This should be set toblog
by default (with this it wouldnāt break the current behavior)sourceDir
- This parameter should define the source directory for the blog files (*.md
). It should be set toblog
by default (with this it wouldnāt break the current behavior)route
- This parameter should define the route under which the blog sites are available. It should be set toblog/:slug
by default (with this it wouldnāt break the current behavior)
A further benefit is that it would allow one to create multiple different blog areas:
ng g @scullyio/init:blog
ng g @scullyio/init:blog --baseName=āprojectā --sourceDir=āprojectsā --route=āproject/:slugā
This functionality would also affect the generation of new entries:
ng g @scullyio/init:post --name="This is a new blog post" # use `blog` by default, no breaking change
ng g @scullyio/init:post --name="This is a new project description" --target="project" # matches with `sourceDir`
What do you think?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:15 (13 by maintainers)
Top Results From Across the Web
Adding blog support - Scully.io
Scully is the best option for moving a blog to Angular! It provides a schematic that enables Angular applications to use markdown files...
Read more >scullyio/community - Gitter
It's like the markdown isn't getting generated and I don't know if it has to do with the error when I npm run...
Read more >@scullyio/init - npm
Start using @scullyio/init in your project by running `npm i @scullyio/init`. ... node_modules\@scullyio\init\src\collection.json:markdown ...
Read more >Creating an Angular Blog With Scully and Deploying on Netlify
The name option takes the name of your post. ng generate @scullyio/init:post --name="Post 1". This creates a markdown file in the blogĀ ...
Read more >Dig deeper into static site generation with Scully and ... - k9n.dev
Good to know: Under the hood the @scullyio/init:blog schematic just calls @scullyio/init:markdown with default options set.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I like the idea of having a ādefaultā, However, it should be just a string (can be a multiline string) In there the app-owner can set his favorite defaults, and what he needs. as @d-koppenhagen stated, the blog user needs to touch the file anyway, they want to put in their content, otherwise, there is no point to the whole exercise, to begin with. By keeping the setting a string, it will not be that complex to handle.
Hmm, come to think about it. I think it would make sense to create a file with defaults. something like:
defaultBlogHeader.yaml
:Then the schematic can just read this as a string and inject it in the result.
I still donāt know about those flags. The validation of such an option with complex configuration seems to be tricky to me and not really handy. As I wrote before: donāt you have to adjust the post anyway after setting it up? So is it really worth it to remember the syntax passing a KVP into the option and writing it on the command line easier/better compared to setting it up using the default meta config and just adjusting it as you will adjust the post file anyway and fill it with content?