5 script_path="$( cd -P "$( dirname "$(readlink -f "${0}")" )" && pwd )"
7 [[ -z "${1-""}" ]] && echo "Set English short title for argument" >&2 && exit 1
9 cd "${script_path}" || return 0
10 filename="posts/$(date +%Y%m%d)/${1}/index.md"
11 [[ ! -f "${script_path}/${filename}" ]] && hugo new "${filename}"
12 type code 1>/dev/null 2>&1 && code "${script_path}/src/content/${filename}"