fix(core): update

This commit is contained in:
2019-03-27 14:38:24 +01:00
parent 56bcfcdae4
commit eb4a4288ed
5 changed files with 48 additions and 4 deletions

18
ts/meta/index.ts Normal file
View File

@ -0,0 +1,18 @@
export interface IMetaObject {
title: string;
description: string;
}
export const setupMetaInformation = async (metaObjectArg: IMetaObject) => {
document.title = metaObjectArg.title;
addMetaTag('description', metaObjectArg.description);
addMetaTag('google', 'notranslate');
addMetaTag('revisited-after', '1 days');
};
const addMetaTag = async (linkNameArg: string, contentArg: string) => {
const metaElement = document.createElement('meta');
metaElement.name = linkNameArg;
metaElement.content = contentArg;
document.getElementsByTagName('head')[0].appendChild(metaElement);
};