-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 882993c
Showing
77 changed files
with
39,804 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
browser: true, | ||
node: true | ||
}, | ||
parserOptions: { | ||
parser: '@babel/eslint-parser', | ||
requireConfigFile: false | ||
}, | ||
extends: [ | ||
'@nuxtjs', | ||
'plugin:nuxt/recommended' | ||
], | ||
plugins: [ | ||
], | ||
// add your custom rules here | ||
rules: {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# These are supported funding model platforms | ||
|
||
github: Skyost | ||
patreon: # Replace with a single Patreon username | ||
open_collective: # Replace with a single Open Collective username | ||
ko_fi: Skyost | ||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel | ||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry | ||
liberapay: # Replace with a single Liberapay username | ||
issuehunt: # Replace with a single IssueHunt username | ||
otechie: # Replace with a single Otechie username | ||
custom: ['paypal.me/Skyost'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
name: Rapport de bug | ||
about: Créer un rapport de bug | ||
title: '' | ||
labels: bug | ||
assignees: Skyost | ||
|
||
--- | ||
|
||
**Description du bug** | ||
Une description claire et concise du problème encouru. | ||
|
||
**Pour reproduire** | ||
Pour reproduire : | ||
1. Aller sur '...' | ||
2. Cliquer sur '....' | ||
3. Scroller jusqu'à '....' | ||
4. Et voici l'erreur | ||
|
||
**Ce qui aurait dû se passer** | ||
Une description claire et concise de ce qui aurait dû se passer. | ||
|
||
**Screenshots** | ||
Si possible, joindre des captures d'écran du problème. | ||
|
||
**Machine (compléter les informations):** | ||
- Appareil : [ex. iPhone6] | ||
- OS : [ex. iOS] | ||
- Browser : [ex. chrome, safari] | ||
- Version : [ex. 22] | ||
|
||
**Informations additionnelles** | ||
Ajoutez tout autre élément de contexte qui pourrait être utile à la résolution du problème. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Correction d'une erreur | ||
about: Soumettre une correction d'erreur | ||
title: '' | ||
labels: error | ||
assignees: Skyost | ||
|
||
--- | ||
|
||
**Localisation de l'erreur** | ||
1. Aller sur la page '...' | ||
2. Cliquer sur '....' | ||
3. Scroller jusqu'à '....' | ||
4. Et voici l'erreur | ||
|
||
**Description de l'erreur** | ||
Une description claire et concise du problème encouru. | ||
|
||
**Informations additionnelles** | ||
Ajoutez tout autre élément de contexte qui pourrait être utile à la résolution du problème. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Idée d'amélioration | ||
about: Suggérer une idée pour ce projet | ||
title: '' | ||
labels: enhancement | ||
assignees: Skyost | ||
|
||
--- | ||
|
||
**Est-ce-que votre amélioration est liée à un problème ? Veuillez décrire.** | ||
Une description claire et concise du problème. Exemple : Je suis toujours frustré quand [...] | ||
|
||
**Décrivez la solution souhaitée** | ||
Une description claire et concise de ce qui devrait arriver selon vous. | ||
|
||
**Décrivez les alternatives que vous avez considérées** | ||
Une description claire et concise des solutions alternatives que vous avez considérées. | ||
|
||
**Informations additionnelles** | ||
Ajoutez tout autre élément de contexte qui pourrait être utile à la résolution du problème. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
# Created by .ignore support plugin (hsz.mobi) | ||
### Node template | ||
# Logs | ||
/logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# next.js build output | ||
.next | ||
|
||
# nuxt.js build output | ||
.nuxt | ||
|
||
# Nuxt generate | ||
dist | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless | ||
|
||
# IDE / Editor | ||
.idea | ||
|
||
# Service worker | ||
sw.* | ||
|
||
# macOS | ||
.DS_Store | ||
|
||
# Vim swap files | ||
*.swp | ||
|
||
# Vercel | ||
.vercel | ||
|
||
# Generated files | ||
*.aux | ||
*.bbl | ||
*.bcf | ||
*.blg | ||
*.fdb_latexmk | ||
*.fls | ||
*.sta | ||
*.out | ||
*.synctex.gz | ||
*.run.xml | ||
content/ | ||
static/images/lessons/ | ||
static/pdf/ | ||
static/CNAME | ||
latex/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 Hugo Delaunay | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# Mes cours de maths | ||
|
||
_Ce projet est en cours de construction, veuillez repasser plus tard !_ | ||
|
||
Bienvenue sur la page Github du site web [Mes cours de maths](https://mes-cours-de-maths.fr) ! | ||
Il s'agit d'un petit site web où je dépose tous mes cours de mathématiques ainsi que les ressources | ||
qui y sont liées. | ||
|
||
Ce site est totalement open-source : vous pouvez tout à fait en exécuter une instance personnelle. | ||
Pour cela, suivez le guide ci-dessous. | ||
|
||
## Installation | ||
|
||
### Cloner le projet | ||
|
||
Il vous suffit de [cliquer ici](https://github.com/Skyost/MesCoursDeMaths/fork) pour cloner le projet. | ||
Cela créera un nouveau dépôt sur Github où vous pourrez [configurer](#configuration) votre nouveau site web. | ||
|
||
### Création d'applications et de jetons | ||
|
||
Toujours sur Github, il va falloir créer une application OAUTH. Pour cela, rendez-vous sur | ||
[ce lien](https://github.com/settings/applications/new). | ||
|
||
* Dans `Application name`, mettez ce que vous souhaitez. | ||
* Dans `Homepage URL` et dans `Authorization callback URL`, mettez l'URL de votre site web. | ||
Se référer à [https://docs.github.com/en/developers/apps/building-oauth-apps/authorizing-oauth-apps#redirect-urls](ce lien) | ||
pour le dernier champ. | ||
|
||
Par la suite, notez votre `Client ID` quelque-part et générez un nouveau `Client secret`. Copiez-le aussi | ||
et ne le perdez surtout pas. Nous aurons besoin de ces données plus tard. | ||
|
||
### Configuration | ||
|
||
Pour configurer le site web (nom, dépôt Github, répertoire des cours, etc.), il vous faut modifier le | ||
fichier `site.js`. Indiquez votre `Client ID` dans le champ `clientId`. | ||
|
||
Pour modifier le contenu de la page d'accueil, il faut éditer le fichier `pages/index.vue`. | ||
Une façon plus rapide (et intuitive...) de modifier les pages sera sûrement ajoutée à l'avenir. | ||
|
||
### Création d'un dépôt de données | ||
|
||
Cette étape est optionnelle : vous pouvez parfaitement vous servir du même dépôt que le site web | ||
pour y stocker vos données LaTeX. Pour cela, dans `site.js`, laissez `dataRepository` à la même valeur que `repository`. | ||
|
||
Si vous souhaitez utiliser un dépôt séparé (par exemple, afin de garder les sources LaTeX privées ; ou tout | ||
simplement pour séparer le contenu de sa présentation), créez-en un sur Github et indiquez sa valeur dans | ||
`dataRepository`. Celui-ci doit contenir le `lessonsDirectory`. | ||
|
||
Si votre dépôt est privé, nous allons devoir créer un `Personal access token`. Pour cela rendez-vous sur | ||
[ce lien](https://github.com/settings/tokens/new). Nommez-le comme vous souhaitez et cochez la case `repo`. | ||
Notez quelque-part le jeton que vous obtenez. | ||
|
||
### Structure des fichiers LaTeX | ||
|
||
Vos fichiers LaTeX peuvent être structurés comme vous le souhaitez, du moment qu'ils sont interprétables | ||
par [KaTeX](https://katex.org). Ceux-ci doivent tout de même définir deux environnements : | ||
|
||
* `doctitle` qui doit correspondre au titre de votre document. | ||
* `docnumber` qui peut correspondre à un numéro de chapitre par exemple. | ||
|
||
Afin d'être compilables par [Pandoc](https://pandoc.org), vous pouvez créer un fichier `pandoc.tex`, | ||
à placer dans le `lessonsDirectory`. Voici par exemple le contenu du mien : | ||
|
||
```tex | ||
% Ceci me permet de remplacer ma commande \cours dans mes fichiers LaTeX. | ||
\providecommand{\cours}[3]{% | ||
\begin{doctitle}% | ||
#2% | ||
\end{doctitle}% | ||
} | ||
% Et ceci me permet de remplacer ma commande \chapitrenumero dans mes fichiers LaTeX. | ||
\providecommand{\chapitrenumero}[1]{% | ||
\begin{docnumber}% | ||
#1% | ||
\end{docnumber}% | ||
} | ||
``` | ||
|
||
### Création d'un projet Vercel | ||
|
||
Ainsi, afin d'être utilisable, nous avons encore besoin de créer un projet sur [Vercel](https://vercel.com/). | ||
Inscrivez-vous si ce n'est pas déjà fait et créez un nouveau projet à partir du dépôt Github cloné. | ||
|
||
Une fois créé, nous allons devoir créer deux variables d'environnements (dans les paramètres du projet Vercel) : | ||
|
||
* `GITHUB_CLIENT_SECRET`, qui contient votre `Client secret`. | ||
* `ENCRYPTION_KEY`, qui contient 32 caractères générés de manière aléatoire (majuscules, minuscules et chiffres uniquement). | ||
* `GITHUB_PERSONAL_ACCESS_TOKEN`, qui contient votre `Personal access token` créé précédemment. | ||
Cette étape est requise uniquement si vous utilisez un dépôt séparé pour héberger vos données. | ||
|
||
## Tests locaux | ||
|
||
Pour tester localement votre site web, une commande suffit : `npm run vercel`. Il vous faut également | ||
créer un fichier `.env` contenant toutes variables d'environnement listées [précédemment](#création-dun-projet-vercel). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import github from '../../utils/octokit' | ||
import site from '../../site' | ||
|
||
export default async function handler (request, response) { | ||
const octokit = github.createOctokitFromRequest(request, response) | ||
if (octokit === null) { | ||
return | ||
} | ||
let githubResponse = await octokit.request('GET /repos/{owner}/{repo}/contents/{path}', { | ||
owner: site.github.username, | ||
repo: site.github.dataRepository, | ||
path: site.github.calendarFile | ||
}) | ||
githubResponse = await octokit.request('DELETE /repos/{owner}/{repo}/contents/{path}', { | ||
owner: site.github.username, | ||
repo: site.github.dataRepository, | ||
path: site.github.calendarFile, | ||
message: 'Suppression du calendrier.', | ||
sha: githubResponse.data.sha | ||
}) | ||
const data = githubResponse.data | ||
response.status(githubResponse.status).json({ | ||
commit: data.commit | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import github from '../../utils/octokit' | ||
import calendar from '../../utils/calendar' | ||
|
||
export default async function handler (request, response) { | ||
const octokit = github.createOctokitFromRequest(request, response) | ||
if (octokit === null) { | ||
return | ||
} | ||
const calendarObject = await calendar.loadCalendar(octokit) | ||
response.status(200).json({ | ||
dates: calendarObject === null ? [] : Object.keys(calendarObject) | ||
}) | ||
} |
Oops, something went wrong.
882993c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
mes-cours-de-maths – ./
mes-cours-de-maths.fr
mes-cours-de-maths-git-master-skyost.vercel.app
mes-cours-de-maths.vercel.app
www.mes-cours-de-maths.fr
mes-cours-de-maths-skyost.vercel.app