// .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>
我在扩展我的 Eleventy 基本模板时遇到问题,当我尝试在同一目录中的多个页面(即 index.html、about.html)上使用它时,标记内容被复制,但我链接的 css 以及其他依赖项没有不出现。有什么我想念的吗?
在它们出现之前,我不得不手动将一些文件复制到输出文件夹。