mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-07 18:04:56 -04:00
Merge pull request #437 from codimd/enhancement/lang-attr-published
This commit is contained in:
commit
88b292fbe0
3 changed files with 3 additions and 1 deletions
|
@ -406,6 +406,7 @@ module.exports = function (sequelize, DataTypes) {
|
||||||
if (meta.title && (typeof meta.title === 'string' || typeof meta.title === 'number')) { _meta.title = meta.title }
|
if (meta.title && (typeof meta.title === 'string' || typeof meta.title === 'number')) { _meta.title = meta.title }
|
||||||
if (meta.description && (typeof meta.description === 'string' || typeof meta.description === 'number')) { _meta.description = meta.description }
|
if (meta.description && (typeof meta.description === 'string' || typeof meta.description === 'number')) { _meta.description = meta.description }
|
||||||
if (meta.robots && (typeof meta.robots === 'string' || typeof meta.robots === 'number')) { _meta.robots = meta.robots }
|
if (meta.robots && (typeof meta.robots === 'string' || typeof meta.robots === 'number')) { _meta.robots = meta.robots }
|
||||||
|
if (meta.lang && (typeof meta.lang === 'string')) { _meta.lang = meta.lang }
|
||||||
if (meta.GA && (typeof meta.GA === 'string' || typeof meta.GA === 'number')) { _meta.GA = meta.GA }
|
if (meta.GA && (typeof meta.GA === 'string' || typeof meta.GA === 'number')) { _meta.GA = meta.GA }
|
||||||
if (meta.disqus && (typeof meta.disqus === 'string' || typeof meta.disqus === 'number')) { _meta.disqus = meta.disqus }
|
if (meta.disqus && (typeof meta.disqus === 'string' || typeof meta.disqus === 'number')) { _meta.disqus = meta.disqus }
|
||||||
if (meta.slideOptions && (typeof meta.slideOptions === 'object')) { _meta.slideOptions = meta.slideOptions }
|
if (meta.slideOptions && (typeof meta.slideOptions === 'object')) { _meta.slideOptions = meta.slideOptions }
|
||||||
|
|
|
@ -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…
Add table
Add a link
Reference in a new issue