Improved script tools.

- Allows posts to be placed in subdirectories (#41, #87).
- Identify posts file with the suffix ‘.markdown’.

**Page creator**
- Pass the posts without any categories or tags.
- Omit the YAML comments for categories/tags.

**Lastmod**
- compatible with one-digit month or day post files.
This commit is contained in:
Cotes Chung
2020-07-14 20:55:43 +08:00
parent 733bb0fbfa
commit 5b0aaa5403
2 changed files with 59 additions and 59 deletions

View File

@@ -74,14 +74,12 @@ main() {
local _count=0
for _file in $(ls -r "$POST_DIR")
for _file in $(find ${POST_DIR} -type f \( -iname \*.md -o -iname \*.markdown \))
do
_filepath="$POST_DIR/$_file"
_filename="${_file%.*}" # jekyll cannot read the extension of a file, so omit it.
_filename=${_filename:11} # remove the date
_filename=$(basename $_file | sed 's/[0-9]\([0-9]*-\)//g;s/\..*//' ) # remove date and extension
if _has_changed "$_filepath"; then
_dump "$_filename" "$_filepath"
if _has_changed "$_file"; then
_dump "$_filename" "$_file"
((_count=_count+1))
fi