Compare commits

...

2 commits

Author SHA1 Message Date
0b7680f38f basic header styles 2024-09-15 14:58:59 +02:00
e173a4aa6d add eleventy-plugin-bundle 2024-09-15 13:18:05 +02:00
5 changed files with 62 additions and 6 deletions

View file

@ -1,6 +1,33 @@
<header>
<a href="{{ "/" | locale_url }}" title="home">ESE Logo</a>
<nav>
{{ collections.mainNav | pageLang | eleventyNavigation | eleventyNavigationToHtml | safe }}
</nav>
<div class="header-container">
<a href="{{ "/" | locale_url }}" title="home">ESE Logo</a>
<nav id="mainNav">
{{ collections.mainNav | pageLang | eleventyNavigation | eleventyNavigationToHtml | safe }}
</nav>
</div>
</header>
{% css %}
header {
position: sticky;
backdrop-filter: blur(5px);
background-color: #ffffffcc;
top: 0;
padding: 2rem 0;
}
.header-container {
max-width: 75rem;
margin-left: auto;
margin-right: auto;
display: flex;
justify-content: space-between;
align-items: center;
}
#mainNav ul {
margin: 0;
padding: 0;
}
#mainNav li {
display: inline;
}
{% endcss %}

View file

@ -9,6 +9,7 @@ eleventyComputed:
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% if title %}{{ title }} | {% endif %}ESE {{ year }}</title>
<link rel="stylesheet" href="{% getBundleFileUrl "css" %}">
</head>
<body>
{% include 'header.njk' %}
@ -20,3 +21,10 @@ eleventyComputed:
{% include 'footer.njk' %}
</body>
</html>
{% css %}
body {
font-family: sans-serif;
margin: 0;
}
{% endcss %}

View file

@ -1,5 +1,6 @@
const { EleventyHtmlBasePlugin, EleventyI18nPlugin } = require("@11ty/eleventy");
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
const bundlerPlugin = require("@11ty/eleventy-plugin-bundle");
const fs = require('fs');
// update this :)
@ -11,6 +12,7 @@ module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(EleventyI18nPlugin, {
defaultLanguage: "de",
});
eleventyConfig.addPlugin(bundlerPlugin);
eleventyConfig.addGlobalData("year", year);

20
package-lock.json generated
View file

@ -10,7 +10,8 @@
"license": "MIT",
"devDependencies": {
"@11ty/eleventy": "^2.0.1",
"@11ty/eleventy-navigation": "^0.3.5"
"@11ty/eleventy-navigation": "^0.3.5",
"@11ty/eleventy-plugin-bundle": "^1.0.5"
}
},
"node_modules/@11ty/dependency-tree": {
@ -121,6 +122,23 @@
"url": "https://opencollective.com/11ty"
}
},
"node_modules/@11ty/eleventy-plugin-bundle": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@11ty/eleventy-plugin-bundle/-/eleventy-plugin-bundle-1.0.5.tgz",
"integrity": "sha512-Esv97j+mOo/yfxjaWl4j8CyszOBsRjU/DOUWOBqVnnDLM8VDXeus2LTJUxF70nAU0g+z+b6fRn8fKnm6b2a/UQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"debug": "^4.3.4"
},
"engines": {
"node": ">=14"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/11ty"
}
},
"node_modules/@11ty/eleventy-utils": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@11ty/eleventy-utils/-/eleventy-utils-1.0.3.tgz",

View file

@ -11,6 +11,7 @@
"license": "MIT",
"devDependencies": {
"@11ty/eleventy": "^2.0.1",
"@11ty/eleventy-navigation": "^0.3.5"
"@11ty/eleventy-navigation": "^0.3.5",
"@11ty/eleventy-plugin-bundle": "^1.0.5"
}
}