Added dynamic lang-attr to pretty.ejs
CodiMD currently only uses the 'lang' attribute in YAML-metadata of a note for setting certain js-elements of the markdown-renderer. This commit adds the chosen lang into the published version of a note. Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
3cc957a88b
commit
ee4210a511
@ -81,6 +81,7 @@ exports.getPublishData = function (req, res, note, callback) {
|
|||||||
const data = {
|
const data = {
|
||||||
title: title,
|
title: title,
|
||||||
description: meta.description || (markdown ? models.Note.generateDescription(markdown) : null),
|
description: meta.description || (markdown ? models.Note.generateDescription(markdown) : null),
|
||||||
|
lang: meta.lang || null
|
||||||
viewcount: note.viewcount,
|
viewcount: note.viewcount,
|
||||||
createtime: createtime,
|
createtime: createtime,
|
||||||
updatetime: updatetime,
|
updatetime: updatetime,
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="<%= lang || "en" %>">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user