-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNew-Blog.ps1
More file actions
40 lines (31 loc) · 753 Bytes
/
New-Blog.ps1
File metadata and controls
40 lines (31 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[string]
$Title,
[Parameter()]
[string[]]
$Category = @(,'PowerShell')
)
$created = Get-Date
$folder = Join-Path $PSScriptRoot "docs/blog/posts/$($created.ToString('yyyy-MM-dd'))-$($Title -replace '\s', '-')"
$null = New-Item -Path $folder -ItemType Directory -Force
@"
---
draft: true
date:
created: $($created.ToString('yyyy-MM-dd'))
authors:
- joshooaj@gmail.com
categories:
$($Category | ForEach-Object { " - $($_)`n" })
links:
- Text: https://link
---
# $Title
{{ Attention-grabbing introduction before the fold }}
<!-- more -->

{{ The rest of the post }}
--8<-- "abbreviations.md"
"@ | Set-Content -Path (Join-Path $folder 'index.md')