Merge pull request #435 from cjeller1592/lang-metadata

Add conditional for preserving lang metadata
This commit is contained in:
Matt Baer 2021-04-06 12:17:35 -04:00 committed by GitHub
commit e58e457b25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -194,8 +194,13 @@
body: post.content, body: post.content,
title: post.title, title: post.title,
font: font, font: font,
lang: lang {{ if or .Post.Slug .Post.Id }}
}; };
{{ else }}
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 }}