Skip to content

Commit 5ed51cb

Browse files
committed
separate logic into multiple files for DRYness
1 parent 01c567e commit 5ed51cb

18 files changed

Lines changed: 494 additions & 535 deletions

_includes/author_bio.html

Lines changed: 58 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,60 @@
1-
<!DOCTYPE html>
2-
<html lang="{{ site.lang | default: " fr" }}">
3-
4-
<head>
5-
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css"
6-
integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous" />
7-
<link rel="stylesheet" href="{{ '/assets/css/style.scss?v=' | append: site.github.build_revision | relative_url }}">
8-
</head>
9-
10-
<body>
11-
{% assign author = site.data.authors[page.author] %}
12-
<h3>Auteur: </h3>
13-
14-
{% if author.name %}
15-
<p> {{author.name}} </p>
16-
{% else %}
17-
<p> Auteur anonyme </p>
18-
{% endif %}
19-
20-
<div class="author">
21-
{% if author.image %}
22-
<img src="{{author.image}}" class="avatar" alt="avatar">&nbsp;
23-
{% else %}
24-
<img src="{{'/assets/images/anon.png?v=' | append: site.github.build_revision | relative_url}}" class="avatar"
25-
alt="avatar">&nbsp;
1+
<div>
2+
{% assign author = site.data.authors[page.author] %}
3+
<h3>Auteur:</h3>
4+
5+
{% if author.name %}
6+
<p>{{author.name}}</p>
7+
{% else %}
8+
<p>Auteur anonyme</p>
9+
{% endif %}
10+
11+
<div class="author">
12+
{% if author.image %}
13+
<img
14+
src="{{author.image}}"
15+
class="avatar"
16+
alt="avatar" />&nbsp; {% else %}
17+
<img
18+
src="{{'/assets/images/anon.png?v=' | append: site.github.build_revision | relative_url}}"
19+
class="avatar"
20+
alt="avatar" />&nbsp; {% endif %}
21+
<div class="bio">
22+
{% if author.bio %}
23+
<p>{{ author.bio }}</p>
24+
{% else %}
25+
<p>Aucune bio fournie</p>
26+
{% endif %}
27+
<div class="icons">
28+
{% if author.github %}
29+
<a href="https://github.com/{{author.github}}">
30+
<img
31+
class="icon"
32+
src="{{ '/assets/images/github_icon.png?v=' | append: site.github.build_revision | relative_url }}"
33+
alt="github_icon"
34+
/></a>
35+
{% endif %} {% if author.email %}
36+
<a href="mailto:{{author.email}}">
37+
<img
38+
class="icon"
39+
src="{{ '/assets/images/mail_icon.png?v=' | append: site.github.build_revision | relative_url }}"
40+
alt="mail_icon"
41+
/></a>
42+
{% endif %} {% if author.twitter %}
43+
<a href="https://twitter.com/{{author.twitter}}">
44+
<img
45+
class="icon"
46+
src="{{ '/assets/images/twitter_icon.png?v=' | append: site.github.build_revision | relative_url }}"
47+
alt="twitter_icon"
48+
/></a>
49+
{% endif %} {% if author.tel %}
50+
<a href="https://wa.me/{{author.tel}}">
51+
<img
52+
class="icon"
53+
src="{{ '/assets/images/whatsapp_icon.png?v=' | append: site.github.build_revision | relative_url }}"
54+
alt="whatsapp_icon"
55+
/></a>
2656
{% endif %}
27-
<div class="bio">
28-
{% if author.bio %}
29-
<p> {{ author.bio }}</p>
30-
{% else %}
31-
<p> Aucune bio fournie </p>
32-
{% endif %}
33-
<div class="icons">
34-
{% if author.github %}
35-
<a href="https://github.com/{{author.github}}">
36-
<img class="icon"
37-
src="{{ '/assets/images/github_icon.png?v=' | append: site.github.build_revision | relative_url }}"
38-
alt="github_icon"></a>
39-
{% endif %}
40-
41-
{% if author.email %}
42-
<a href="mailto:{{author.email}}">
43-
<img class="icon"
44-
src="{{ '/assets/images/mail_icon.png?v=' | append: site.github.build_revision | relative_url }}"
45-
alt="mail_icon"></a>
46-
{% endif %}
47-
48-
{% if author.twitter %}
49-
<a href="https://twitter.com/{{author.twitter}}">
50-
<img class="icon"
51-
src="{{ '/assets/images/twitter_icon.png?v=' | append: site.github.build_revision | relative_url }}"
52-
alt="twitter_icon"></a>
53-
{% endif %}
54-
55-
{% if author.tel %}
56-
<a href="https://wa.me/{{author.tel}}">
57-
<img class="icon"
58-
src="{{ '/assets/images/whatsapp_icon.png?v=' | append: site.github.build_revision | relative_url }}"
59-
alt="whatsapp_icon"></a>
60-
{% endif %}
61-
</div>
62-
</div>
57+
</div>
6358
</div>
64-
65-
66-
67-
68-
<style>
69-
.author {
70-
display: flex;
71-
margin-bottom: 2%;
72-
}
73-
74-
.avatar {
75-
border-radius: 50%;
76-
border: 3px black solid;
77-
height: 80px;
78-
width: 80px;
79-
}
80-
81-
.icons {
82-
display: flex;
83-
}
84-
85-
.icon {
86-
margin-left: 5px;
87-
height: 30px;
88-
width: 30px;
89-
}
90-
91-
.bio {
92-
display: block;
93-
margin-left: 3%;
94-
margin-top: 0;
95-
}
96-
</style>
97-
</body>
59+
</div>
60+
</div>

_includes/footer.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<footer class="site-footer">
2+
{% if page.date %}
3+
<p>publié le {{ page.date | date: "%d/%m/%Y, à %R" }}</p>
4+
{% endif %} {% if page.refs %}
5+
<p>sources/references: {{ page.refs }}</p>
6+
{% endif %} {% if page.author %} {% include author_bio.html %} {% endif %} {%
7+
if site.github.is_project_page %}
8+
<span class="site-footer-owner"
9+
><a href="{{ site.github.repository_url }}"
10+
>{{ site.github.repository_name }}</a
11+
>
12+
est maintenu par ©
13+
<a href="{{ site.github.owner_url }}">{{ site.github.owner_name }}</a>,
14+
2021.</span
15+
>
16+
{% endif %}
17+
<span class="site-footer-credits"
18+
>Cette page <a href="https://jekyllrb.com/">Jekyll</a> est alimentée par
19+
<a href="https://pages.github.com">GitHub Pages</a>.</span
20+
>
21+
</footer>

_includes/head.html

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<head>
2+
<title>{{ page.title | default: site.title }}</title>
3+
<meta charset="UTF-8" />
4+
<meta
5+
name="keywords"
6+
content="{{ page.keywords | default: site.keywords }}" />
7+
<!-- PWA -->
8+
<link
9+
rel="manifest"
10+
href="{{ '/manifest.json?v=' | append: site.github.build_revision | relative_url }}" />
11+
<!-- insert favicons by favicon generator-->
12+
<link
13+
rel="apple-touch-icon"
14+
sizes="180x180"
15+
href="{{ '/assets/images/apple-touch-icon.png?v=' | append: site.github.build_revision | relative_url }}" />
16+
<link
17+
rel="icon"
18+
type="image/png"
19+
sizes="32x32"
20+
href="{{ '/assets/images/favicon-32x32.png?v=' | append: site.github.build_revision | relative_url }}" />
21+
<link
22+
rel="icon"
23+
type="image/png"
24+
sizes="16x16"
25+
href="{{ '/assets/images/favicon-16x16.png?v=' | append: site.github.build_revision | relative_url }}" />
26+
<link
27+
rel="shortcut icon"
28+
href="{{ '/assets/images/favicon.ico?v=' | append: site.github.build_revision | relative_url }}" />
29+
<meta
30+
name="msapplication-TileColor"
31+
content="#157878" />
32+
<meta
33+
name="msapplication-config"
34+
content=" " />
35+
<link
36+
href="https://fonts.googleapis.com/css?family=Open+Sans:400,700&display=swap"
37+
rel="stylesheet" />
38+
<meta
39+
name="viewport"
40+
content="width=device-width, initial-scale=1" />
41+
<meta
42+
name="theme-color"
43+
content="#157878" />
44+
<meta
45+
name="apple-mobile-web-app-status-bar-style"
46+
content="black-translucent" />
47+
<!-- FontAwesome -->
48+
<link
49+
rel="stylesheet"
50+
href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css"
51+
integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p"
52+
crossorigin="anonymous" />
53+
<!-- Styles -->
54+
<link
55+
rel="stylesheet"
56+
href="{{ '/assets/css/styles.css?v=' | append: site.github.build_revision | relative_url }}" />
57+
<link
58+
rel="stylesheet"
59+
href="{{ '/assets/css/jekyll-glossary_tooltip.css?v=' | append: site.github.build_revision | relative_url }}" />
60+
61+
<!-- Scripts -->
62+
<script
63+
type="text/javascript"
64+
src="{{ '/assets/js/main.js?=' | append: site.github.build_revision | relative_url }}"></script>
65+
<script
66+
type="text/javascript"
67+
src="{{ '/assets/js/search.js?=' | append: site.github.build_revision | relative_url }}"></script>
68+
<script
69+
type="text/javascript"
70+
src="{{ '/assets/js/navigation.js?=' | append: site.github.build_revision | relative_url }}"></script>
71+
{% include head-custom.html %} {% seo %}
72+
</head>

_includes/header.html

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<header
2+
class="page-header"
3+
role="banner">
4+
<div class="wrapper">
5+
<img
6+
class="logo"
7+
width="100"
8+
height="100"
9+
src="{{ '/assets/images/MCS.png?v=' | append: site.github.build_revision | relative_url }}"
10+
alt="MCS-logo" />
11+
<h2 class="project-name">
12+
{{ page.title | default: site.title | default: site.github.repository_name
13+
}}
14+
</h2>
15+
</div>
16+
<h3 class="project-tagline">
17+
{{ page.description | default: site.description | default:
18+
site.github.project_tagline }}
19+
</h3>
20+
21+
{% include navigation.html %} {% if site.github.is_project_page %}
22+
<a
23+
href="{{ site.github.repository_url }}"
24+
class="btn"
25+
>Voir sur GitHub</a
26+
>
27+
{% endif %} {% if site.show_downloads %}
28+
<a
29+
href="{{ site.github.zip_url }}"
30+
class="btn"
31+
>Download .zip</a
32+
>
33+
<a
34+
href="{{ site.github.tar_url }}"
35+
class="btn"
36+
>Download .tar.gz</a
37+
>
38+
{% endif %}
39+
</header>

0 commit comments

Comments
 (0)