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,233 +7,193 @@ 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>
<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>
{% 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">
{% endblock head %}
<body>
{% block style %}
{% include "css/resume.css" %}
{% endblock style %}
<header style="position: relative;">
<span data-chaffle-onload="" data-chaffle="en">{{ username }}</span>
<span class="blink" style="display:inline;">_</span>
{% block header %}
{% for pageKey in pagination.pages %}
{% if pageKey.locale != resume.locale %}
<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 %}
{% endblock 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">
<span class="{{ pageKey.flag_icon }}"></span><span style="text-transform:uppercase;">{{ pageKey.locale }}</span>
</a>
{% endif %}
{% block content %}
<div class="row">
<div class="col-1">
<h1>{{ resume.name }}
<small>({{ resume.info.label }})</small>
</h1>
<p>{{ resume.info.about }}</p>
<hr>
<h2>{{ resume.school_projects_title }}</h2>
{% for project in resume.school_projects %}
<section>
<h3>{{ project.title }}</h3>
<p>{{ project.description }}</p>
<div class="project-links">
{% if project.pdf %}
<a class="fa fa-file-pdf-o" href="{{ project.pdf }}"></a>
{% endif %}
{% if project.repo %}
<a class="fa fa-git" href="{{ project.repo }}"></a>
{% endif %}
</div>
</section>
{% endfor %}
</header>
<div class="row">
<div class="col-1">
<hr>
<h1>{{ resume.name }}
<small>({{ resume.info.label }})</small>
</h1>
<p>{{ resume.info.about }}</p>
<h2>{{ resume.personnal_projects_title }}</h2>
{% for project in resume.personnal_projects %}
<section>
<h3>{{ project.title }}</h3>
<p>{{ project.description }}</p>
<div class="project-links">
{% if project.pdf %}
<a class="fa fa-file-pdf-o" href="{{ project.pdf }}"></a>
{% endif %}
{% if project.repo %}
<a class="fa fa-git" href="{{ project.repo }}"></a>
{% endif %}
</div>
</section>
{% endfor %}
<hr>
<hr>
<h2>{{ resume.school_projects_title }}</h2>
{% for project in resume.school_projects %}
<section>
<h3>{{ project.title }}</h3>
<p>{{ project.description }}</p>
<h2>{{ resume.reading_title }}</h2>
<ul>
{% for read in resume.reading %}
<li>
<a href="{{ read.url }}">{{ read.title | safe }}</a>
</li>
{% endfor %}
</ul>
<div class="project-links">
{% if project.pdf %}
<a class="fa fa-file-pdf-o" href="{{ project.pdf }}"></a>
{% endif %}
{% if project.repo %}
<a class="fa fa-git" href="{{ project.repo }}"></a>
{% endif %}
</div>
</section>
<hr>
<h2>{{ resume.interests_title }}</h2>
{% for interest in resume.interests %}
<section>
<h3>{{ interest.name }}</h3>
<p>{{ interest.summary }}</p>
<ul>
{% for tag in interest.tags %}
<li class="tag">{{ tag }}</li>
{% endfor %}
</ul>
</section>
{% endfor %}
</div>
<div class="col-2">
<h2>{{ resume.contacts_title }}</h2>
<ul>
{% for contact in resume.contacts %}
<li>
<span class="{{ contact.icon }}"></span>
<a href="{{ contact.url }}">{{ contact.contact }}</a>
</li>
{% endfor %}
</ul>
<hr>
<h2>{{ resume.socials_title }}</h2>
<ul>
{% for social in resume.socials %}
<li>
<span class="{{social.icon}}"></span>
<a href="{{social.url}}">{{social.network}}</a>
</li>
{% endfor %}
</ul>
<hr>
<h2>{{ resume.education_title }}</h2>
<ul class="timeline">
<span class="arrow-up"></span>
<li class="event"></li>
{% for edu in resume.education.history %}
{% if edu.end != resume.education.history[loop.index - 2].start %}
{% if loop.index != 1 %}
<li class="event"></li>
{% endif %}
<li class="year">{{ edu.end }}</li>
{% endif %}
<li class="event">
{{ edu.title }}<br>
<a href="{{ edu.url }}">{{ edu.institution }}</a>
<br>{{ edu.eqv }}
</li>
<li class="year">{{ edu.start }}</li>
{% endfor %}
<hr>
<li class="event"></li>
</ul>
<h2>{{ resume.personnal_projects_title }}</h2>
{% for project in resume.personnal_projects %}
<section>
<h3>{{ project.title }}</h3>
<p>{{ project.description }}</p>
<div class="project-links">
{% if project.pdf %}
<a class="fa fa-file-pdf-o" href="{{ project.pdf }}"></a>
{% endif %}
{% if project.repo %}
<a class="fa fa-git" href="{{ project.repo }}"></a>
{% endif %}
</div>
</section>
{% endfor %}
<hr>
<hr>
<h2>{{ resume.reading_title }}</h2>
<ul>
{% for read in resume.reading %}
<li>
<a href="{{ read.url }}">{{ read.title | safe }}</a>
</li>
{% endfor %}
</ul>
<hr>
<h2>{{ resume.interests_title }}</h2>
{% for interest in resume.interests %}
<section>
<h3>{{ interest.name }}</h3>
<p>{{ interest.summary }}</p>
<h2>{{ resume.skills_title }}</h2>
<ul>
{% for skill in resume.skills %}
<li>
{{ skill.name }}
{% if skill.level %}
<small> ({{ skill.level }}) </small>
{% endif %}
<ul>
{% for tag in interest.tags %}
{% for tag in skill.tags %}
<li class="tag">{{ tag }}</li>
{% endfor %}
</ul>
</section>
</li>
{% endfor %}
</ul>
</div>
<hr>
<div class="col-2">
<h2>{{ resume.languages_title }}</h2>
<ul>
{% for lang in resume.languages %}
<li>
<span class="{{ lang.icon }}"></span>
{{ lang.language }}
<small>({{ lang.level }})</small>
</li>
{% endfor %}
</ul>
<h2>{{ resume.contacts_title }}</h2>
<ul>
{% for contact in resume.contacts %}
<li>
<span class="{{ contact.icon }}"></span>
<a href="{{ contact.url }}">{{ contact.contact }}</a>
</li>
{% endfor %}
</ul>
<hr>
<h2>{{ resume.socials_title }}</h2>
<ul>
{% for social in resume.socials %}
<li>
<span class="{{social.icon}}"></span>
<a href="{{social.url}}">{{social.network}}</a>
</li>
{% endfor %}
</ul>
<hr>
<h2>{{ resume.education_title }}</h2>
<ul class="timeline">
<span class="arrow-up"></span>
<li class="event"></li>
{% for edu in resume.education.history %}
{% if edu.end != resume.education.history[loop.index - 2].start %}
{% if loop.index != 1 %}
<li class="event"></li>
{% endif %}
<li class="year">{{ edu.end }}</li>
{% endif %}
<li class="event">
{{ edu.title }}<br>
<a href="{{ edu.url }}">{{ edu.institution }}</a>
<br>{{ edu.eqv }}
</li>
<li class="year">{{ edu.start }}</li>
{% endfor %}
<li class="event"></li>
</ul>
<hr>
<h2>{{ resume.skills_title }}</h2>
<ul>
{% for skill in resume.skills %}
<li>
{{ skill.name }}
{% if skill.level %}
<small> ({{ skill.level }}) </small>
{% endif %}
<ul>
{% for tag in skill.tags %}
<li class="tag">{{ tag }}</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
<hr>
<h2>{{ resume.languages_title }}</h2>
<ul>
{% for lang in resume.languages %}
<li>
<span class="{{ lang.icon }}"></span>
{{ lang.language }}
<small>({{ lang.level }})</small>
</li>
{% endfor %}
</ul>
</div>
</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