diff --git a/.eleventy.js b/.eleventy.js index b3d0235..8a94bc8 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,9 +1,17 @@ // const eleventyVue = require("@11ty/eleventy-plugin-vue"); - +import nuxtConfig from './nuxt.config' module.exports = function ( eleventyConfig ) { // eleventyConfig.addPlugin(eleventyVue) + // console.log('eleventyConfig', eleventyConfig) + + eleventyConfig.addJavaScriptFunction('getNuxt', function () { + return nuxtConfig + }) + // eleventyConfig.addGlobalData('nuxt', () => nuxtConfig) + + return { dir: { diff --git a/layouts-eleventy/default.11ty.js b/layouts-eleventy/default.11ty.js index 1683c23..d5d266b 100644 --- a/layouts-eleventy/default.11ty.js +++ b/layouts-eleventy/default.11ty.js @@ -1,6 +1,6 @@ import config from '../nuxt.config' - +const year = new Date().getFullYear() const makeTag = ( tag, tagName = 'meta') => { @@ -72,9 +72,9 @@ class DefaultLayout { }) { return /* html */` - + - ${ title || config.head.title } + ${ title || this.getNuxt().head.title } ${ this.generateMetaTags() } @@ -145,7 +145,7 @@ class DefaultLayout { -

© 2020 Does it ARM All rights reserved.

+

© ${ year } ${ this.getNuxt().head.title } All rights reserved.