question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 the BlogModule and BlogComponent, etc. This should be set to blog 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 to blog 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 to blog/: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:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:15 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
SanderEliascommented, Jan 7, 2020

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:

title: my-blog-post
thumbnail: assets/images/default.jpg
author: John Doe
mail: John.Doe@example.com
keywords:
  - angular
  - scully
language: en

Then the schematic can just read this as a string and inject it in the result.

ng g @scullyio/init:post --metaDataFile='defaultBlogHeader.yaml" title="whatEver"
1reaction
d-koppenhagencommented, Jan 7, 2020

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found