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:
parent
53ea85dc86
commit
391844fab9
1 changed files with 7 additions and 2 deletions
|
@ -194,8 +194,13 @@
|
||||||
body: post.content,
|
body: post.content,
|
||||||
title: post.title,
|
title: post.title,
|
||||||
font: font,
|
font: font,
|
||||||
|
{{ if or .Post.Slug .Post.Id }}
|
||||||
|
};
|
||||||
|
{{ else }}
|
||||||
lang: lang
|
lang: lang
|
||||||
};
|
};
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ if .Post.Slug }}
|
{{ if .Post.Slug }}
|
||||||
var url = "/api/collections/{{.EditCollection.Alias}}/posts/{{.Post.Id}}";
|
var url = "/api/collections/{{.EditCollection.Alias}}/posts/{{.Post.Id}}";
|
||||||
{{ else if .Post.Id }}
|
{{ else if .Post.Id }}
|
||||||
|
|
Loading…
Add table
Reference in a new issue