mirror of https://github.com/dyne/webnomad.git
always use .html extension for files while local testing (fix browser preview)
This commit is contained in:
parent
b2a0c6d98a
commit
132da54dc7
15
render
15
render
|
|
@ -346,12 +346,19 @@ read_meta() {
|
|||
|
||||
# calculate the destination path for a file or folder to render from views
|
||||
calc_dest() {
|
||||
{ test -r "$1" } || {
|
||||
[[ "$1" ]] || {
|
||||
error "error calculating destination: cannot read $1"
|
||||
return 0 }
|
||||
# optional 2nd arg: extension
|
||||
ext="$2"
|
||||
{ test "$ext" = "" } && { ext="$EXTENSION" }
|
||||
|
||||
if [[ "$CMD" = "test" ]]; then
|
||||
# when in test mode force .html as an extension
|
||||
# since that will make the local preview in browsers work
|
||||
ext=".html"
|
||||
else
|
||||
# optional 2nd arg: extension
|
||||
ext="$2"
|
||||
[[ "$ext" = "" ]] && { ext="$EXTENSION" }
|
||||
fi
|
||||
|
||||
func "calc_dest \"$1\" \"$2\""
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue