feat(v2): add version to page's generated meta tags (#2438)

This commit is contained in:
Alexey Pyltsyn 2020-03-22 05:08:53 +03:00 committed by GitHub
parent b3d14816bb
commit 93da7fe576
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -17,6 +17,7 @@ import {minify} from 'html-minifier-terser';
import path from 'path'; import path from 'path';
import fs from 'fs-extra'; import fs from 'fs-extra';
import routes from '@generated/routes'; import routes from '@generated/routes';
import packageJson from '../../package.json';
import preload from './preload'; import preload from './preload';
import App from './App'; import App from './App';
import ssrTemplate from './templates/ssr.html.template'; import ssrTemplate from './templates/ssr.html.template';
@ -71,6 +72,7 @@ export default async function render(locals) {
metaAttributes, metaAttributes,
scripts, scripts,
stylesheets, stylesheets,
version: packageJson.version,
}, },
{ {
rmWhitespace: true, rmWhitespace: true,

View file

@ -11,7 +11,7 @@ module.exports = `
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width"> <meta name="viewport" content="width=device-width">
<meta name="generator" content="Docusaurus"> <meta name="generator" content="Docusaurus v<%= version %>">
<%- headTags %> <%- headTags %>
<% metaAttributes.forEach((metaAttribute) => { %> <% metaAttributes.forEach((metaAttribute) => { %>
<%- metaAttribute %> <%- metaAttribute %>