An open API service indexing awesome lists of open source software.

https://github.com/devidw/hashnode-gh-src-new

Bash Script to automatically create new hashnode .md article files with frontmatter
https://github.com/devidw/hashnode-gh-src-new

article articles bash bash-script bash-scripting cli hashnode makdown

Last synced: about 1 year ago
JSON representation

Bash Script to automatically create new hashnode .md article files with frontmatter

Awesome Lists containing this project

README

          

= Bash Script to automatically create new hashnode `.md` article files with frontmatter

You can use the shell script `new` to auto generate boilterplate article `.md` files, when you publish on hashnode from a GitHub source.

== Installation
. Download the `new` script
. Make it executable
[source, bash]
----
chmod +x ./new
----

== Configuration
Configuration is doen by changing variable values inside `new`.

=== Domain
Specify your hashnode domain (custom domain or hashnode subdomain)
[source, bash]
----
domain="xn--david-9u04d.to"
----

=== Cover
Specify a default cover image URL
[source, bash]
----
cover="https://david.wolf.gdn/media/cover.png"
----

== Usage
Simply run the script, this will gnerate a new `.md` file with frontmatter in the directory the script is located.

[source, bash]
----
./new
----

The file name will follow the format of `YYYY-MM-DD_.md`. For example: `2021-12-31_.md`.

NOTE: Spaces are not allowed in hashnode source files, when you are publishing from a GitHub source on Hashnode, use underscores instead.

You can optionaly pass a date to the script by passing it as argument:
[source, bash]
----
./new 2021-11-28
----