Skip to content

Commit

Permalink
Migration du site vers Hugo
Browse files Browse the repository at this point in the history
* Moved the website over to Hugo.

* Removed files from old website.

* indentation

* use relative URLs

* publication

* Relative URLs + Removed auto page summary in home.

* drop unused assets

* LTS page

* Nouvelle structure pour le répo!

* Petite correction: Extraire le contenu de `data`.

* Quick fix: quelques layouts

* Fixed heatmap & dactylo pages

* license

* stats (links)

* license

* Quick fix: x-keyboard shortcode.

* heatmap

* header

* Corrigé le chemin vers le script `svg.js`.

* WIP: Début de la réécriture de la page d’accueil.

* Bepo vs ErgoL

* CSS clean-up and navbar

* better bepo page

* DuckTypist: compact view

* Page d’accueil.

* wip: Erglace, Lafayette

* revamped home page

* Sections FR et EN retravaillées.

* accueil

* CI pour builder le site web avec hugo.

* Last minute fixes.

---------

Co-authored-by: Fabien Cazenave <fabien@cazenave.cc>
  • Loading branch information
Nuclear-Squid and fabi1cazenave committed Feb 28, 2024
1 parent ef961cd commit 217674f
Show file tree
Hide file tree
Showing 174 changed files with 4,746 additions and 1,080 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/hugo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Sample workflow for building and deploying a Hugo site to GitHub Pages
name: Deploy Hugo site to ergol.org

on:
# Runs on pushes targeting the default branch
push:
branches:
- main

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

# Default to bash
defaults:
run:
shell: bash

jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.123.0
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: Install Node.js dependencies
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./public

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ build
dist
*.vim*
*.custom
www/public
4 changes: 4 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Copyright © 2024 Léo Cazenave
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
all:
@for file in data/layouts/*.toml; do \
kalamine build $$file --out "data/layouts/$$(basename $${file%.*}).json"; \
@for file in layouts/*.toml; do \
kalamine build $$file --out "layouts/$$(basename $${file%.*}).json"; \
done
@for file in data/layouts/*.yaml; do \
kalamine build $$file --out "data/layouts/$$(basename $${file%.*}).json"; \
@for file in layouts/*.yaml; do \
kalamine build $$file --out "layouts/$$(basename $${file%.*}).json"; \
done

watch:
@inotifywait -m data/layouts -e close_write | while read -r _path _action file; do \
@inotifywait -m layouts -e close_write | while read -r _path _action file; do \
case $$file in \
*yaml) kalamine build "data/layouts/$$file" --out "data/layouts/$$(basename "$${file%.*}").json";; \
*toml) kalamine build "data/layouts/$$file" --out "data/layouts/$$(basename "$${file%.*}").json";; \
*yaml) kalamine build "layouts/$$file" --out "layouts/$$(basename "$${file%.*}").json";; \
*toml) kalamine build "layouts/$$file" --out "layouts/$$(basename "$${file%.*}").json";; \
esac \
done

Expand All @@ -23,12 +23,12 @@ clean:
# the install/uninstall targets below require Kalamine v0.4.2+

install:
@echo "Installer script for XKB (GNU/Linux). Requires super-user privileges."
@echo "Installer script for XKB (GNU/Linux)."
@echo
xkalamine install data/layouts/ergol.yaml
xkalamine install layouts/ergol.toml

uninstall:
@echo "Unistaller script for XKB (GNU/Linux). Requires super-user privileges."
@echo "Unistaller script for XKB (GNU/Linux)."
@echo
xkalamine remove fr/ergol
@echo
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[**(in English hereinafter)**](#English)

Une disposition de clavier ergonomique optimisée pour le français, l’anglais et
la programmation.
le code.

- Disposition **optimisée pour le français _et_ l’anglais**;
- Couche AltGr optionnelle, optimisée pour l’enchaînement des symboles de
Expand Down Expand Up @@ -68,16 +68,16 @@ pipx install kalamine
Download the [layouts/ergol.toml][4] file in this repo and build the layout :

```bash
kalamine ergol.toml
kalamine build ergol.toml
```

You’ll get a `dist` folder containing all of the drivers.

Then, to install Ergo‑L, follow the [install section of Kalamine’s repo][3],
and you should be good to go !

[2]: https://github.com/fabi1cazenave/kalamine
[3]: https://github.com/fabi1cazenave/kalamine#installing-distributable-layouts
[2]: https://github.com/OneDeadKey/kalamine
[3]: https://github.com/OneDeadKey/kalamine#installing-distributable-layouts
[4]: https://github.com/Nuclear-Squid/ergol/blob/master/layouts/ergol.toml
[5]: https://github.com/pypa/pipx?tab=readme-ov-file#install-pipx

Expand All @@ -98,6 +98,7 @@ Then switch to Ergo‑L using the following command:
setxkbmap fr -variant ergol # Switch your keyboard layout to ergol
```


Make Your Own !
--------------------------------------------------------------------------------

Expand Down
21 changes: 21 additions & 0 deletions code/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018-2024 Fabien & Léo Cazenave

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.
7 changes: 7 additions & 0 deletions code/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
The code here is linked with the OneDeadKey project.

- layout-analyser.js will be contributed to [kalamine][1]
- x-keyboard.js has been taken *as is* from [x-keyboard][2]

[1]: https://github.com/OneDeadKey/kalamine
[2]: https://github.com/OneDeadKey/x-keyboard
File renamed without changes.
File renamed without changes.
14 changes: 8 additions & 6 deletions js/dactylo.js → code/duck-typist.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ window.addEventListener('DOMContentLoaded', () => {
const gLayout = document.querySelector('#layout');
const gDict = document.querySelector('#dict');

const gKeyList = document.querySelector('header .key_list');
const gStatus = document.querySelector('header .status');
const gQuacks = document.querySelector('header .quacks');
const gKeyList = document.querySelector('.key_list');
const gStatus = document.querySelector('.status');
const gQuacks = document.querySelector('.quacks');
const gLesson = document.querySelector('#lesson');
const gInput = document;

Expand All @@ -74,7 +74,7 @@ window.addEventListener('DOMContentLoaded', () => {
// fetch a kalamine corpus: symbols, bigrams, trigrams
const fetchNgrams = () => {
const ngrams = gDict.value.split(',')[0];
return fetch(`data/corpus/${ngrams}.json`)
return fetch(`../corpus/${ngrams}.json`)
.then(response => response.json())
.then(data => {
gDictionary.trigrams = Object.keys(data.trigrams);
Expand All @@ -85,7 +85,7 @@ window.addEventListener('DOMContentLoaded', () => {
// fetch MonkeyType words
const fetchWords = () => {
const words = gDict.value.split(',')[1];
return fetch(`data/dicts/${words}.json`)
return fetch(`./${words}.json`)
.then(response => response.json())
.then(data => {
gDictionary.words = data.words;
Expand All @@ -94,7 +94,7 @@ window.addEventListener('DOMContentLoaded', () => {

// fetch a kalamine keyboard layout
const fetchLayout = () => {
return fetch(`data/layouts/${gLayout.value}.json`)
return fetch(`../layouts/${gLayout.value}.json`)
.then(response => response.json())
.then(layout => {
gKeyboard.setKeyboardLayout(layout.keymap, layout.deadkeys, gGeometry.value);
Expand Down Expand Up @@ -269,6 +269,8 @@ window.addEventListener('DOMContentLoaded', () => {
gLessonLevel = level ? Number(level) : STARTING_LEVEL;
gQuackCount = quacks ? Number(quacks) : 1;

window.location.hash = `#${gLayout.value}`;

Promise.all([fetchNgrams(), fetchWords(), fetchLayout()])
.then(setLessonLevel);
};
Expand Down
4 changes: 2 additions & 2 deletions js/heatmap.js → code/layout-analyzer.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ window.addEventListener('DOMContentLoaded', () => {
const setProp = (key, value) => {
if (key === 'layout') {
if (value) {
fetch(`data/layouts/${value}.json`)
fetch(`../layouts/${value}.json`)
.then(response => response.json())
.then(data => {
inputField.placeholder = `Zone de saisie ${value}`;
Expand All @@ -479,7 +479,7 @@ window.addEventListener('DOMContentLoaded', () => {
}
} else if (key === 'corpus') {
if (value && value !== corpusName) {
fetch(`data/corpus/${value}.json`)
fetch(`../corpus/${value}.json`)
.then(response => response.json())
.then(data => {
corpus = data.symbols;
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 217674f

Please sign in to comment.