0

// .eleventy.js configuration file



module.exports = function(eleventyConfig) {

    eleventyConfig.addPassthroughCopy("_src/assets");

    return {
        dir: {
            includes: "_templates",
            input: "_src",
            output: "_site"
        }
    };

};
// Base Template

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> {{ title }} </title>
    <link href="https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;400;700&family=Poiret+One&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/uikit@3.5.5/dist/css/uikit.min.css" />               // omitted in _site
    <link href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700;900&display=swap" rel="stylesheet"> // omitted in _site
    <link rel="stylesheet" href="assets/css/main.css">      // omitted in _site
    <link rel="stylesheet" href="assets/css/query.css">     // omitted in _site
    <script src="uikit/dist/js/uikit-icons.min.js"></script>// omitted in _site
</head>

<body>

      nav



    <div class="uk-container">
        {{ content | safe }}
    </div>



    footer


    <script src="https://cdn.jsdelivr.net/npm/uikit@3.5.5/dist/js/uikit.min.js"></script>          // omitted in _site
    <script src="https://cdn.jsdelivr.net/npm/uikit@3.5.5/dist/js/uikit-icons.min.js"></script>    // omitted in _site
    <script src="assets/js/main.js"></script>                                                      // omitted in _site

</body>

</html>

I have a problem extending my Eleventy Base Template, when I try using it on multiple pages in the same directory(i.e. index.html, about.html), the markup content gets copied, but my linked css as well as other dependencies don't show up. Is there something i'm missing?

I've had to manually had to copy some files to the output folder before they show up.

  • Can you please share some code? It sounds like you are using 2 layout, one that calls another. Can we see that code? You can trim stuff out to make it shorter. – Raymond Camden Jul 28 '20 at 17:52
  • Does that `addPassthroughCopy` coy the files into `_site`? Could you post a screenshot of what that directory tree looks like? It may be that it is copying it through with a different folder name from what you are expecting in your `link` tags – Luke Storry Aug 24 '20 at 13:11

0 Answers0