feat: reworked the layout system

feat: css now inline to improve performance
feat: now using 11ty 1.0.0-beta to use addGlobalData
This commit is contained in:
Laureηt 2021-10-10 18:29:22 +02:00
parent 0c434960b5
commit fa485e220d
No known key found for this signature in database
GPG key ID: D88C6B294FD40994
12 changed files with 503 additions and 612 deletions

View file

@ -11,6 +11,7 @@ const markdownLib = markdownIt(options).use(markdownItAttrs);
module.exports = function (eleventyConfig) {
eleventyConfig.addGlobalData("username", "Laureηt");
eleventyConfig.addPlugin(pluginNavigation);
eleventyConfig.setLibrary("md", markdownLib);
eleventyConfig.addWatchTarget("./src/scss/");

2
.gitignore vendored
View file

@ -1,5 +1,7 @@
node_modules/
_site/
content/
src/_includes/css
*.log

View file

@ -4,15 +4,15 @@
"author": "Laureηt <laurentfainsin@protonmail.com>",
"license": "MIT",
"scripts": {
"watch:sass": "sass --no-source-map --watch src/scss:_site/css",
"watch:sass": "sass --no-source-map --watch src/scss:src/_includes/css",
"watch:eleventy": "eleventy --serve",
"build:sass": "sass --no-source-map --style compressed src/scss:_site/css",
"build:sass": "sass --no-source-map --style compressed src/scss:src/_includes/css",
"build:eleventy": "ELEVENTY_ENV=prod eleventy",
"start": "npm-run-all build:sass --parallel watch:*",
"build": "npm-run-all build:sass build:eleventy"
},
"dependencies": {
"@11ty/eleventy": "^0.12.1",
"@11ty/eleventy": "^1.0.0-beta.2",
"@11ty/eleventy-navigation": "^0.2.0",
"chaffle": "^2.1.0",
"html-minifier": "^4.0.0",

View file

@ -1,25 +0,0 @@
<script>
var elm_mouseover = document.querySelectorAll('[data-chaffle]');
var elm_onload = document.querySelectorAll('[data-chaffle-onLoad]');
Array
.prototype
.forEach
.call(elm_mouseover, function (el) {
var chaffle = new Chaffle(el)
el.addEventListener('mouseover', function () {
chaffle.init();
});
});
Array
.prototype
.forEach
.call(elm_onload, function (el) {
var chaffle = new Chaffle(el)
chaffle.init();
setInterval(function () {
chaffle.init();
}, 10000)
});
</script>

View file

@ -1,10 +1,8 @@
---
layout: layout.njk
---
{% extends "layout.njk" %}
{% block head %}
<link rel="stylesheet" href="{{ '/css/eportfolio.css' | url }}">
{% endblock head %}
{% block style %}
{% include "css/eportfolio.css" %}
{% endblock style %}
{% block precontent %}
<nav class="11ty-nav" role="navigation">

View file

@ -1,4 +0,0 @@
<footer role="contentinfo">
&copy; {% year %}
{{ username }}
</footer>

View file

@ -1,7 +0,0 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ username }}</title>
<link rel="stylesheet" href="{{ '/css/style.css' | url }}">
<link rel="stylesheet" href="{{ '/css/anim.css' | url }}">
<link rel="shortcut icon" type="image/x-icon" href="{{ '/favicon.png' | url }}">
<script src="{{ '/javascript/chaffle.min.js' | url }}"></script>

View file

@ -1,4 +0,0 @@
<header role="banner">
<span data-chaffle-onload="" data-chaffle="en">{{ username }}</span>
<i class="blink">_</i>
</header>

View file

@ -1,26 +1,69 @@
---
username: Laureηt
---
<!DOCTYPE html>
<html lang="en">
<head>
{% include "head.njk" %}
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/x-icon" href="{{ '/favicon.png' | url }}">
<script src="{{ '/javascript/chaffle.min.js' | url }}"></script>
<title>{{ username }}</title>
{% block head %}{% endblock head %}
<style>
{% include "css/style.css" %}
{% include "css/anim.css" %}
{% block style %}
{% endblock style %}
</style>
</head>
<body>
{% include "header.njk" %}
<header role="banner">
<div id="username">
<span data-chaffle-onload="" data-chaffle="en">{{ username }}</span>
<i class="blink">_</i>
</div>
{% block header %}{% endblock header %}
</header>
{% block precontent %}{% endblock precontent %}
<main role="main">
{% block content %}{% endblock content %}
{{ content | safe }}
</main>
{% block postcontent %}{% endblock postcontent %}
{% include "footer.njk" %}
<footer role="contentinfo">
&copy; {% year %}
{{ username }}
</footer>
{% block foot %}{% endblock foot %}
{% include "chaffle.njk" %}
<script>
var elm_mouseover = document.querySelectorAll('[data-chaffle]');
var elm_onload = document.querySelectorAll('[data-chaffle-onLoad]');
Array
.prototype
.forEach
.call(elm_mouseover, function (el) {
var chaffle = new Chaffle(el)
el.addEventListener('mouseover', function () {
chaffle.init();
});
});
Array
.prototype
.forEach
.call(elm_onload, function (el) {
var chaffle = new Chaffle(el)
chaffle.init();
setInterval(function () {
chaffle.init();
}, 10000)
});
</script>
</body>
</html>

View file

@ -1,5 +1,4 @@
---
username: Laureηt
pagination:
data: resumes
size: 1
@ -8,39 +7,30 @@ pagination:
permalink: "resume/{{ resume.locale }}/index.html"
---
<!DOCTYPE html>
<html lang="{{ resume.locale }}">
{% extends "layout.njk" %}
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ username }}</title>
<link rel="stylesheet" href="{{ '/css/style.css' | url }}">
<link rel="stylesheet" href="{{ '/css/resume.css' | url }}">
<link rel="stylesheet" href="{{ '/css/anim.css' | url }}">
<link rel="shortcut icon" type="image/x-icon" href="{{ '/favicon.png' | url }}">
<script src="{{ '/javascript/chaffle.min.js' | url }}"></script>
{% block head %}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fork-awesome@1.1.7/css/fork-awesome.min.css" integrity="sha256-gsmEoJAws/Kd3CjuOQzLie5Q3yshhvmo7YNtBG7aaEY=" crossorigin="anonymous">
<link href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/css/flag-icon.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/devicon/2.6/devicon.min.css" rel="stylesheet">
<base target="_blank">
</head>
{% endblock head %}
<body>
<header style="position: relative;">
<span data-chaffle-onload="" data-chaffle="en">{{ username }}</span>
<span class="blink" style="display:inline;">_</span>
{% block style %}
{% include "css/resume.css" %}
{% endblock style %}
{% block header %}
{% for pageKey in pagination.pages %}
{% if pageKey.locale != resume.locale %}
<a style="right: 0px; position: absolute;" href="{{ pagination.hrefs[loop.index-1] | url }}" target="_self">
<a href="{{ pagination.hrefs[loop.index-1] | url }}" target="_self">
<span class="{{ pageKey.flag_icon }}"></span><span style="text-transform:uppercase;">{{ pageKey.locale }}</span>
</a>
{% endif %}
{% endfor %}
</header>
{% endblock header %}
{% block content %}
<div class="row">
<div class="col-1">
@ -199,42 +189,11 @@ permalink: "resume/{{ resume.locale }}/index.html"
</div>
</div>
{% endblock content %}
<div class="btn-back">
<span>&laquo;</span>
<a href="{{ '/' | url }}" target="_self">{{ resume.go_back }}</a>
</div>
<footer>
&copy; {% year %}
{{ username }}
</footer>
<script>
var elm_mouseover = document.querySelectorAll('[data-chaffle]');
var elm_onload = document.querySelectorAll('[data-chaffle-onLoad]');
Array
.prototype
.forEach
.call(elm_mouseover, function (el) {
var chaffle = new Chaffle(el)
el.addEventListener('mouseover', function () {
chaffle.init();
});
});
Array
.prototype
.forEach
.call(elm_onload, function (el) {
var chaffle = new Chaffle(el)
chaffle.init();
setInterval(function () {
chaffle.init();
}, 10000)
});
</script>
</body>
</html>
{% block postcontent %}
<nav id="btn-back" role="navigation">
<i>&laquo;</i>
<a href="{{ '/' | url }}">Go back</a>
</nav>
{% endblock postcontent %}

View file

@ -3,6 +3,11 @@ body {
width: 80rem;
}
header {
display: flex;
justify-content: space-between;
}
h1,
h2 {
height: auto;

619
yarn.lock

File diff suppressed because it is too large Load diff