mirror of
https://github.com/edu4rdshl/linuxscripts.git
synced 2026-07-17 23:24:52 +00:00
Update
This commit is contained in:
parent
74ffbc116b
commit
afd8e609b3
1 changed files with 2 additions and 2 deletions
|
|
@ -3,12 +3,12 @@ if [ $# -gt 0 ]; then
|
||||||
filename=_posts/$(date +%Y-%m-%d-)
|
filename=_posts/$(date +%Y-%m-%d-)
|
||||||
# Replace all the special characters with a hyphen
|
# Replace all the special characters with a hyphen
|
||||||
filename+=${*//[^a-zA-Z0-9_]/-}.md
|
filename+=${*//[^a-zA-Z0-9_]/-}.md
|
||||||
filename=$(echo "$filename" | tr '[:upper:]' '[:lower:]' | sed 's/-\{2,\}/-/g')
|
filename=$(echo "$filename" | tr '[:upper:]' '[:lower:]' | sed 's/-\{2,\}/-/g' | sed 's/-\.md$/.md/')
|
||||||
if [ ! -f "$filename" ]; then
|
if [ ! -f "$filename" ]; then
|
||||||
cat >"$filename" <<EOF
|
cat >"$filename" <<EOF
|
||||||
---
|
---
|
||||||
layout: post
|
layout: post
|
||||||
title: '$*'
|
title: '${*//\'/\'\'}'
|
||||||
date: $(date +"%Y-%m-%d %H:%M %z")
|
date: $(date +"%Y-%m-%d %H:%M %z")
|
||||||
categories: ["tag"]
|
categories: ["tag"]
|
||||||
tags: ["tag"]
|
tags: ["tag"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue