Add conditional for preserving lang metadata

This makes it so that if a post is updated, it will retain the language metadata rather than revert back.
This commit is contained in:
CJ Eller 2021-02-10 18:01:32 -05:00 committed by GitHub
parent 53ea85dc86
commit 391844fab9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -194,8 +194,13 @@
body: post.content,
title: post.title,
font: font,
lang: lang
};
{{ if or .Post.Slug .Post.Id }}
};
{{ else }}
lang: lang
};
{{ end }}
{{ if .Post.Slug }}
var url = "/api/collections/{{.EditCollection.Alias}}/posts/{{.Post.Id}}";
{{ else if .Post.Id }}