Merge pull request #1176 from MageJohn/main

This commit is contained in:
SleeplessOne1917 2023-06-12 08:50:16 +00:00 committed by GitHub
commit d56addf7d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -346,7 +346,7 @@ async function createSsrHtml(root: string, isoData: IsoDataOptionalSite) {
return ` return `
<!DOCTYPE html> <!DOCTYPE html>
<html ${helmet.htmlAttributes.toString()} lang="en"> <html ${helmet.htmlAttributes.toString()}>
<head> <head>
<script>window.isoData = ${sanitize(JSON.stringify(isoData))}</script> <script>window.isoData = ${sanitize(JSON.stringify(isoData))}</script>
<script>window.lemmyConfig = ${serialize(config)}</script> <script>window.lemmyConfig = ${serialize(config)}</script>

View file

@ -2,7 +2,7 @@ import { htmlToText } from "html-to-text";
import { Component } from "inferno"; import { Component } from "inferno";
import { Helmet } from "inferno-helmet"; import { Helmet } from "inferno-helmet";
import { httpExternalPath } from "../../env"; import { httpExternalPath } from "../../env";
import { md } from "../../utils"; import { getLanguages, md } from "../../utils";
interface HtmlTagsProps { interface HtmlTagsProps {
title: string; title: string;
@ -17,9 +17,12 @@ export class HtmlTags extends Component<HtmlTagsProps, any> {
const url = httpExternalPath(this.props.path); const url = httpExternalPath(this.props.path);
const desc = this.props.description; const desc = this.props.description;
const image = this.props.image; const image = this.props.image;
const lang = getLanguages()[0];
return ( return (
<Helmet title={this.props.title}> <Helmet title={this.props.title}>
<html lang={lang == "browser" ? "en" : lang} />
{["title", "og:title", "twitter:title"].map(t => ( {["title", "og:title", "twitter:title"].map(t => (
<meta key={t} property={t} content={this.props.title} /> <meta key={t} property={t} content={this.props.title} />
))} ))}