Skip to content

Scaffold new blog post for Astro-based blog using theme Astro Paper.

License

Notifications You must be signed in to change notification settings

janik6n/astro-paper-new-article

Folders and files

NameName
Last commit message
Last commit date
Apr 5, 2023
Apr 8, 2023
Jan 28, 2024
Apr 5, 2023
Jan 28, 2024
Jan 28, 2024
Jan 28, 2024
Jan 28, 2024

Repository files navigation

astro-paper-new-article

Scaffold new blog post for Astro-based blog using theme Astro Paper.

Installation

In your blog project, install package using npm:

npm install astro-paper-new-article --save-dev

Configuration

Scaffolding uses custom configuration in root-level package.json. Add the following configuration block:

"astroNewArticle": {
  "blogPath": "src/content/blog",
  "contentPath": "src/assets",
  "contentSubDirectory": "slug",
  "author": "Demo Writer",
  "defaultOgImage": "http://[domain-here]/demo.jpg",
  "proposedTags": [
    "Azure",
    "AWS",
    "Node.js",
    "Python",
    "serverless"
  ]
}

Parameters:

  • blogPath: Path to markdown files for blog (this should not require changes).
  • contentPath: Path to local images etc. for blog articles (this should not require changes). Scaffolding will create a directory in here, defaulting to date (see below parameter)
  • contentSubDirectory: date or slug. Option date will create 2023-04-08 and slug will use the article name slug as directory name (e.g. "Demo article" > demo-article).
  • author: Author's name.
  • defaultOgImage: Default OG image to be used.
  • proposedTags: Which tags are selectable while scaffolding.

Most of these will affect to generated frontmatter.

Usage

After installing the package and adding the required configuration, on the project root-level run & follow the prompt:

npx new-article

Optionally you can add this also to scripts in package.json, for example "new": "new-article". Then you can run npm run new.

Changelog

CHANGELOG

MIT License. Copyright janik6n.

About

Scaffold new blog post for Astro-based blog using theme Astro Paper.

Resources

License

Stars

Watchers

Forks