From 391844fab9001d95b6f122828decb284cfb2584e Mon Sep 17 00:00:00 2001 From: CJ Eller <45696734+cjeller1592@users.noreply.github.com> Date: Wed, 10 Feb 2021 18:01:32 -0500 Subject: [PATCH] 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. --- templates/pad.tmpl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/templates/pad.tmpl b/templates/pad.tmpl index cef69b5..049ac27 100644 --- a/templates/pad.tmpl +++ b/templates/pad.tmpl @@ -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 }}