mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-30 02:37:59 +02:00
feat(v2): add version to page's generated meta tags (#2438)
This commit is contained in:
parent
b3d14816bb
commit
93da7fe576
2 changed files with 3 additions and 1 deletions
|
@ -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,
|
||||||
|
|
|
@ -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 %>
|
||||||
|
|
Loading…
Add table
Reference in a new issue