Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ms-studio committed Mar 28, 2021
0 parents commit 1668845
Show file tree
Hide file tree
Showing 184 changed files with 27,306 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Numerous always-ignore extensions
######################
*.diff
*.err
*.orig
*.log
*.rej
*.swo
*.swp
*.vi
*~
*.zip
*.sass-cache

# OS or Editor folders
######################
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db
*.esproj
.cache
.project
.settings
.tmproj
*.esproj
nbproject
*.sublime-project
*.sublime-workspace

# Dreamweaver added files
_notes
dwsync.xml

# Temporary files #
###################
*.autosave
*(Autosaved)*

# Folders to ignore
###################
.hg
.svn
.CVS
intermediate
publish
.idea
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2021 Manuel Schmalstieg

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
40 changes: 40 additions & 0 deletions _includes/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<footer class="site-footer">

<div class="wrapper">

<h2 class="footer-heading">{{ site.title }}</h2>

<div class="footer-col-wrapper">
<div class="footer-col footer-col-1">
<ul class="contact-list">
<li>Eracom, Lausanne</li>
<li>EAA, La Chaux-de-Fonds</li>
<li>2016–2020</li>
</ul>
</div>

<div class="footer-col footer-col-2">
<ul class="social-media-list">
<li>
{% include icon-github.html username="coursweb" %}
</li>

{% if site.twitter_username %}
<li>
{% include icon-twitter.html username=site.twitter_username %}
</li>
{% endif %}
<!-- <li>
{% include icon-twitter.html username="wpgva" %}
</li> -->
</ul>
</div>

<div class="footer-col footer-col-3">
<p>{{ site.description }}</p>
</div>
</div>

</div>

</footer>
97 changes: 97 additions & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
<meta name="description"
content="Un support de cours pour apprendre la programmation web. Sujets: HTML, CSS, JS, WordPress, Git.">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon.png">

<link rel="stylesheet" href="{{ " /css/main.css" | prepend: site.baseurl }}?ver=20200105">
<link rel="stylesheet" href="{{ " /js/magnific-popup/magnific-popup.css" | prepend: site.baseurl }}">
<link href="https://fonts.googleapis.com/css?family=Cormorant+Garamond:400,400i" rel="stylesheet">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ " /feed.xml" | prepend:
site.baseurl | prepend: site.url }}">
<style>
/*
The follwing styles are for Reveal.JS
Note: we cannot use the .reveal selector alone,
because it is also present in regular HTML version.
Solution: use .reveal.center
*/
.reveal.center,
.reveal.center .slides,
.reveal.center .slides section {
height: 100vh;
font-size: 5vmin;
}

.reveal.center .slides section {
text-align: left;
}

.reveal.center .slides h1,
.reveal.center .slides h2,
.reveal.center .slides h3,
.reveal.center .slides h4 {
hyphens: none;
word-wrap: normal;
text-align: center;
}

.reveal.center .slides h1 {
font-size: 3em;
}

.reveal.center .slides h2 {
font-size: 2.6em;
}

.reveal.center .slides h3 {
font-size: 2.2em;
}

.reveal.center .slides h4 {
font-size: 1.8em;
}

/* Images */

.reveal img {
object-fit: contain;
}

.reveal.center section img {
margin-top: -12vh;
max-height: 70vh;
}

.reveal.center .figcaption {
font-size: 0.8em;
}

/* Code */

.reveal.center pre code {
background-color: #fff;
padding: 2em;
}
</style>
<script>
if (navigator.serviceWorker) {
navigator.serviceWorker.register('/serviceworker.js')
.then(function (registration) {
// console.log('Success!', registration.scope);
})
.catch(function (error) {
// console.error('Failure!', error);
});
console.log('All done.');
}
</script>
</head>
31 changes: 31 additions & 0 deletions _includes/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<header class="site-header">

<div class="wrapper">

<a class="site-title" href="{{ site.baseurl }}/">{{ site.title }}</a>

<nav class="site-nav">
<a href="#" class="menu-icon">
<svg viewBox="0 0 18 15">
<path fill="#424242" d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.031C17.335,0,18,0.665,18,1.484L18,1.484z"/>
<path fill="#424242" d="M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0c0-0.82,0.665-1.484,1.484-1.484 h15.031C17.335,6.031,18,6.696,18,7.516L18,7.516z"/>
<path fill="#424242" d="M18,13.516C18,14.335,17.335,15,16.516,15H1.484C0.665,15,0,14.335,0,13.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.031C17.335,12.031,18,12.696,18,13.516L18,13.516z"/>
</svg>
</a>

{% assign url_parts = page.url | split: '/' %}

{% assign url_parts_size = url_parts | size %}

<div class="trigger first-menu">

{% include nav-primary.html %}

</div>
</nav>

</div><!-- #wrapper -->

</header>

{% include nav-second.html %}
1 change: 1 addition & 0 deletions _includes/icon-github.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<a href="https://github.com/{{ include.username }}"><span class="icon icon--github">{% include icon-github.svg %}</span><span class="username">{{ include.username }}</span></a>
1 change: 1 addition & 0 deletions _includes/icon-github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions _includes/icon-twitter.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<a href="https://twitter.com/{{ include.username }}"><span class="icon icon--twitter">{% include icon-twitter.svg %}</span><span class="username">{{ include.username }}</span></a>
1 change: 1 addition & 0 deletions _includes/icon-twitter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions _includes/nav-primary.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{% comment %}

Production du menu principal

On utilise pour cela les "chapters", qui sont définis dans
les custom settings de _config.yml

{% endcomment %}


{% for chapter in site.chapters %}

{% assign page_url_parts = page.url| split: '/' %}

<a class="page-link chapter-{{ chapter.url }}{% if chapter.url == page_url_parts[1] %} active{% endif %}" href="{{ site.url }}/{{ chapter.url }}">{{ chapter.title }}</a>

{% endfor %}

<a class="page-link" href="{{ site.url }}/about">About</a>

{% comment %}

Note:

We create the menu based on the "chapters",
definded in _config.yml

- Loop through site.chapters.
- For each, build the menu.

TODO: Test against current URL, to see which one is "active".

{% endcomment %}
46 changes: 46 additions & 0 deletions _includes/nav-second.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{% comment %}

This file produces the 2nd level menu.

Our method:

1: we produce an array of chapter URLs.
2: we compare it with URL of current page.

{% endcomment %}

{% assign chapter_urls = "" %}

{% for chapter in site.chapters %}
{% assign chapter_urls = chapter_urls | append: ',' | append: chapter.url %}
{% endfor %}

{% assign chapter_urls = chapter_urls | split: ',' %}

{% if chapter_urls contains url_parts[1] %}

<nav class="secondary-menu">
<div class="second-menu">
<ul>

{% assign base_url = page.url %}

{% for node in site.pages %}
{% if node.title %}
{% assign node_url_parts = node.url | split: '/' %}
{% assign node_url_parts_size = node_url_parts | size %}

{% if node_url_parts[1] == url_parts[1] %}

<li><a class="{% if node.url == page.url %} active{% endif %}" href='{{ node.url | prepend: site.baseurl }}'>{{node.title}}</a></li>
{% endif %}

{% endif %}
{% endfor %}

</ul>
</div>
</nav>

{% endif %}

Loading

0 comments on commit 1668845

Please sign in to comment.