1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2025-05-29 22:37:44 +02:00

Compare commits

...

97 Commits

Author SHA1 Message Date
6abc881e94 chore(release): 2.2.0 [skip ci] 2022-03-24 10:49:45 +00:00
a67d6665ea feat: display age nearby the birth date 2022-03-24 11:45:19 +01:00
1152039663 chore(release): 2.1.0 [skip ci] 2022-03-14 08:15:56 +00:00
919ebd5f3e feat(posts): add mistakes-as-junior-developer 2022-03-14 09:09:46 +01:00
94212f9b5c chore(release): 2.0.2 [skip ci] 2022-02-23 18:52:16 +00:00
bf9347f685 ci: multiple workflows instead of one 2022-02-23 19:46:44 +01:00
896b6051e8 fix: redirect /curriculum-vitae.html to /curriculum-vitae 2022-02-23 19:31:18 +01:00
b5f3552c07 chore(release): 2.0.1 [skip ci] 2022-02-23 10:55:50 +00:00
5fbae8601f fix(posts): spelling mistakes 2022-02-23 11:51:00 +01:00
48d35776a9 fix(resume): usage of experience website 2022-02-23 11:14:53 +01:00
8b9e58c47c chore(release): 2.0.0 [skip ci] 2022-02-23 08:14:21 +00:00
33078ece66 chore: temporarily support Node.js v14 to deploy on Vercel 2022-02-23 09:06:12 +01:00
a2da9618af test(e2e): header should always be visible (sticky) 2022-02-23 09:03:10 +01:00
a467ea7aff feat: usage of VSCode Dark+ syntax highlighting in posts 2022-02-23 00:38:50 +01:00
0e0036b737 feat: add Curriculum vitae 2022-02-22 21:19:42 +01:00
729e540d04 chore: maintenance 2022-02-20 15:12:10 +01:00
e5f4615f7f fix(posts): grammar and orthograph in clean-code (#321) 2022-02-20 15:12:10 +01:00
0bf89f4df5 feat(posts): add clean-code 2022-02-20 15:12:10 +01:00
bcb184e49c feat: add blog (#320) 2022-02-20 15:12:10 +01:00
1505b81233 build(deps): bump Node.js to 16.0.0 and npm to 8.0.0
BREAKING CHANGE: minimum supported Node.js >= 16.0.0 and npm >= 8.0.0

fixes #74
2022-02-20 15:12:10 +01:00
a30355582e feat(skills): add C/C++ 2022-02-20 15:12:10 +01:00
a4effb52f9 feat(skills): add GNU/Linux 2022-02-20 15:12:10 +01:00
52bba0ef9c build(deps): update latest 2022-02-20 15:08:48 +01:00
8ecfeca50d chore(release): 1.3.6 [skip ci] 2021-09-09 08:15:20 +00:00
fd0740d12a fix: add text that I'm a student at University 2021-09-09 10:08:42 +02:00
bd2dc9c9af build(deps-dev): bump babel-jest from 27.1.0 to 27.1.1 (#212) 2021-09-09 08:46:48 +02:00
a53888ab42 build(deps-dev): bump @types/node from 16.7.13 to 16.9.0 (#213) 2021-09-09 08:46:16 +02:00
624e79eecd build(deps-dev): bump jest from 27.1.0 to 27.1.1 (#214) 2021-09-09 08:46:02 +02:00
049ec367fc build(deps-dev): bump tailwindcss from 2.2.11 to 2.2.14 (#211) 2021-09-08 21:27:01 +02:00
56f22d0c9b build(deps-dev): bump tailwindcss from 2.2.9 to 2.2.11 (#207) 2021-09-08 21:17:25 +02:00
9adb67662e build(deps-dev): bump @types/node from 16.7.10 to 16.7.13 (#208) 2021-09-08 21:17:14 +02:00
010087088f build(deps): bump html-react-parser from 1.2.8 to 1.3.0 (#209) 2021-09-08 21:17:00 +02:00
35d4396e80 build(deps): bump sharp from 0.29.0 to 0.29.1 (#210) 2021-09-08 21:16:48 +02:00
934118737a build(deps-dev): bump @typescript-eslint/eslint-plugin (#204) 2021-09-08 21:16:31 +02:00
b692dac926 build(deps): bump crazy-max/ghaction-import-gpg from 3.2.0 to 4 (#200)
Co-authored-by: Divlo <contact@divlo.fr>
2021-09-06 16:37:10 +02:00
dd582652ab build(deps-dev): bump @types/react from 17.0.19 to 17.0.20 (#201) 2021-09-06 16:28:01 +02:00
337352de0c build(deps-dev): bump @semantic-release/git from 9.0.0 to 9.0.1 (#202) 2021-09-06 16:27:44 +02:00
c513268cbb build(deps-dev): bump autoprefixer from 10.3.3 to 10.3.4 (#199) 2021-09-03 09:54:38 +02:00
4fdcb2b667 build(deps-dev): bump start-server-and-test from 1.13.1 to 1.14.0 (#198) 2021-09-03 09:54:17 +02:00
377b8e91a6 chore(release): 1.3.5 [skip ci] 2021-09-01 22:17:55 +00:00
fce29c9d4a build(deps): update latest 2021-09-02 00:13:20 +02:00
c198f47aa9 build(deps-dev): eslint-config-standard-with-typescript to 21.0.1 (#195) 2021-09-01 16:38:44 +02:00
8e051332cd build(deps-dev): bump @typescript-eslint/eslint-plugin to 4.30.0 (#197) 2021-09-01 16:37:39 +02:00
9f3436e1df build(deps-dev): bump tailwindcss from 2.2.8 to 2.2.9 (#196) 2021-09-01 16:37:17 +02:00
2f2373e62f build(deps-dev): bump cypress from 8.3.0 to 8.3.1 (#187) 2021-09-01 16:36:12 +02:00
c6b455dd10 build(deps-dev): bump eslint-plugin-prettier from 3.4.1 to 4.0.0 (#189) 2021-09-01 16:35:35 +02:00
4e089b41f2 build(deps-dev): bump @types/node from 16.7.2 to 16.7.10 (#193) 2021-09-01 16:35:19 +02:00
6c102b1b35 build(deps-dev): bump eslint-config-next from 11.1.0 to 11.1.2 (#194) 2021-09-01 16:35:03 +02:00
52b10944b7 build(deps): bump next from 11.1.0 to 11.1.2 (#192) 2021-09-01 16:34:50 +02:00
db36eb3e7a build(deps-dev): bump jest from 27.0.6 to 27.1.0 (#185) 2021-08-27 12:45:18 +02:00
c739ad951d build(deps-dev): bump babel-jest from 27.0.6 to 27.1.0 (#184) 2021-08-27 12:45:07 +02:00
2802ff029f build(deps-dev): bump tailwindcss from 2.2.7 to 2.2.8 (#182) 2021-08-27 12:43:05 +02:00
1a7457b44b build(deps-dev): bump @types/node from 16.7.1 to 16.7.2 (#183) 2021-08-27 12:41:56 +02:00
ff210f879d build(deps-dev): bump semantic-release from 17.4.6 to 17.4.7 (#178) 2021-08-27 12:41:43 +02:00
607454b360 build(deps-dev): bump eslint-plugin-import from 2.24.1 to 2.24.2 (#176) 2021-08-27 12:41:29 +02:00
d1522fbf44 build(deps): bump node from 16.7.0 to 16.8.0 (#179) 2021-08-27 12:41:06 +02:00
b82eae7499 build(deps-dev): bump autoprefixer from 10.3.2 to 10.3.3 (#181) 2021-08-27 12:40:52 +02:00
73527ce8fe build(deps-dev): bump husky from 7.0.1 to 7.0.2 (#177) 2021-08-27 12:40:30 +02:00
0cd885ee70 build(deps-dev): bump typescript from 4.3.5 to 4.4.2 (#180) 2021-08-27 12:40:16 +02:00
2cb2df975f build(deps-dev): bump @typescript-eslint/eslint-plugin to 4.29.3 (#175) 2021-08-24 02:30:24 +02:00
37f5843adb build(deps-dev): bump semantic-release from 17.4.5 to 17.4.6 (#174) 2021-08-24 02:30:06 +02:00
d794d38f14 test(e2e): visible instead of exist 2021-08-23 19:48:15 +02:00
fc5ba28b8a perf: remove unnecessary fonts weight 2021-08-23 19:41:39 +02:00
b5945150b8 fix: remove Hyper Terminal from tools used 2021-08-23 19:25:17 +02:00
aa12d626d2 perf: uses-responsive-images 2021-08-23 19:17:30 +02:00
6ac4782b7d build(deps-dev): bump @types/node from 16.6.2 to 16.7.1 (#171) 2021-08-23 12:00:52 +02:00
0aa998d593 build(deps-dev): bump eslint-plugin-prettier from 3.4.0 to 3.4.1 (#172) 2021-08-23 12:00:39 +02:00
56f975e53c build(deps-dev): bump autoprefixer from 10.3.1 to 10.3.2 (#173) 2021-08-23 12:00:26 +02:00
5a16d24ea1 build(deps-dev): bump eslint-plugin-import from 2.24.0 to 2.24.1 (#170) 2021-08-20 10:37:53 +02:00
52267005ec build(deps-dev): bump @types/react from 17.0.18 to 17.0.19 (#169) 2021-08-20 10:37:38 +02:00
99b9b12ac9 build(deps-dev): bump @types/node from 16.6.1 to 16.6.2 (#168) 2021-08-19 10:56:35 +02:00
2cae77481f build(deps): bump node from 16.6.2 to 16.7.0 (#167) 2021-08-19 10:55:46 +02:00
e98b47a459 build(deps): bump sharp from 0.28.3 to 0.29.0 (#166) 2021-08-18 11:26:24 +02:00
4cc87758c1 build(deps): bump next-pwa from 5.2.24 to 5.3.1 (#164) 2021-08-17 20:49:12 +02:00
1bb0f31223 build(deps-dev): bump @typescript-eslint/eslint-plugin (#165) 2021-08-17 20:48:56 +02:00
af2dd0bd60 build(deps-dev): bump cypress from 8.2.0 to 8.3.0 (#163) 2021-08-17 20:48:39 +02:00
63d7485c8d build(deps): bump next-pwa from 5.3.0 to 5.2.24 2021-08-16 15:38:56 +02:00
74fde0ea40 build(deps): update latest version 2021-08-16 15:31:35 +02:00
0d2b318818 build(deps): bump node from 16.6.1 to 16.6.2 (#155) 2021-08-13 15:50:10 +02:00
266b3f8589 test: add cypress e2e (#159) 2021-08-13 15:48:29 +02:00
f7d304ca80 build(deps): bump read-pkg from 5.2.0 to 6.0.0 (#136) 2021-08-12 11:03:37 +02:00
63017953d7 chore(release): 1.3.4 [skip ci] 2021-08-11 23:29:15 +00:00
20600eb976 build(deps): bump crazy-max/ghaction-import-gpg from 3.1.0 to 3.2.0 (#154) 2021-08-12 01:21:54 +02:00
7f920b77aa build(deps): bump actions/setup-node from 2.3.1 to 2.4.0 (#152) 2021-08-12 01:21:40 +02:00
4f5dfc63ea perf: reduce build size + add next-secure-headers 2021-08-12 01:19:11 +02:00
712805df93 build(deps): bump actions/setup-node from 2.3.0 to 2.3.1 (#144) 2021-08-04 10:39:56 +02:00
cd68f597c9 build(deps-dev): bump @typescript-eslint/eslint-plugin (#143) 2021-08-04 10:39:35 +02:00
7ec3fe8ced build(deps-dev): bump eslint from 7.31.0 to 7.32.0 (#141) 2021-08-04 10:39:12 +02:00
90d22b2c7f build(deps-dev): bump @types/node from 16.4.7 to 16.4.10 (#142) 2021-08-04 10:38:47 +02:00
4b06fd0522 build(deps): bump node from 16.5.0 to 16.6.1 (#145) 2021-08-04 10:38:28 +02:00
b4427f36c2 build(deps): bump @fortawesome/react-fontawesome to 0.1.15 (#146) 2021-08-04 10:38:07 +02:00
b758c64e02 build(deps-dev): bump @types/node from 16.4.6 to 16.4.7 (#139) 2021-07-30 07:21:41 +02:00
04469b83ea build(deps-dev): bump @types/node from 16.4.4 to 16.4.6 (#138) 2021-07-29 08:16:05 +02:00
36d54666a0 build(deps-dev): bump @types/node from 16.4.3 to 16.4.4 (#137) 2021-07-28 08:17:45 +02:00
a34cefec6e chore(release): set correctly env [skip ci] 2021-07-27 21:34:08 +02:00
5c343395df chore(release): 1.3.3 [skip ci] 2021-07-27 19:06:15 +00:00
028815a7b6 fix: sign release commit and backmerge to develop 2021-07-27 21:01:33 +02:00
115 changed files with 25727 additions and 19951 deletions

View File

@ -1,3 +0,0 @@
{
"presets": ["next/babel"]
}

View File

@ -1,7 +1,2 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.163.1/containers/javascript-node/.devcontainer/base.Dockerfile ARG VARIANT="16"
ARG VARIANT="14-buster"
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT} FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
ARG EXTRA_NODE_VERSION=16
RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"

View File

@ -14,11 +14,10 @@
"divlo.vscode-styled-jsx-languageserver", "divlo.vscode-styled-jsx-languageserver",
"bradlc.vscode-tailwindcss", "bradlc.vscode-tailwindcss",
"mikestead.dotenv", "mikestead.dotenv",
"coenraads.bracket-pair-colorizer",
"davidanson.vscode-markdownlint", "davidanson.vscode-markdownlint",
"ms-azuretools.vscode-docker" "ms-azuretools.vscode-docker"
], ],
"forwardPorts": [3000], "forwardPorts": [3000],
"postAttachCommand": ["npm", "clean-install"], "postAttachCommand": ["npm", "install"],
"remoteUser": "node" "remoteUser": "node"
} }

View File

@ -1,7 +1,8 @@
.next .next
.lighthouseci .lighthouseci
storybook-static
coverage
node_modules node_modules
next-env.d.ts next-env.d.ts
**/workbox-*.js **/workbox-*.js
**/sw.js **/sw.js
.vercel

View File

@ -1,11 +1,6 @@
{ {
"extends": [ "extends": ["conventions", "next/core-web-vitals", "prettier"],
"standard-with-typescript", "plugins": ["prettier", "unicorn"],
"next",
"next/core-web-vitals",
"prettier"
],
"plugins": ["prettier"],
"parserOptions": { "parserOptions": {
"project": "./tsconfig.json" "project": "./tsconfig.json"
}, },
@ -15,6 +10,8 @@
"jest": true "jest": true
}, },
"rules": { "rules": {
"prettier/prettier": "error" "prettier/prettier": "error",
"unicorn/prefer-node-protocol": "off",
"@typescript-eslint/no-misused-promises": "off"
} }
} }

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
* text=auto eol=lf

View File

@ -1,16 +0,0 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'daily'
- package-ecosystem: 'docker'
directory: '/'
schedule:
interval: 'daily'
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'daily'

View File

@ -1,122 +0,0 @@
name: 'Divlo'
on:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]
jobs:
analyze:
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
matrix:
language: ['javascript']
steps:
- uses: 'actions/checkout@v2.3.4'
- name: 'Initialize CodeQL'
uses: 'github/codeql-action/init@v1'
with:
languages: ${{ matrix.language }}
- name: 'Perform CodeQL Analysis'
uses: 'github/codeql-action/analyze@v1'
lint:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v2.3.4'
- name: 'Use Node.js'
uses: 'actions/setup-node@v2.3.0'
with:
node-version: '16.x'
cache: 'npm'
- name: 'Install'
run: 'npm install'
- run: 'npm run lint:commit -- --to "${{ github.sha }}"'
- run: 'npm run lint:docker'
- run: 'npm run lint:editorconfig'
- run: 'npm run lint:markdown'
- run: 'npm run lint:typescript'
build:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v2.3.4'
- name: 'Use Node.js'
uses: 'actions/setup-node@v2.3.0'
with:
node-version: '16.x'
cache: 'npm'
- name: 'Install'
run: 'npm install'
- name: 'Build'
run: 'npm run build'
- name: 'Lighthouse'
run: 'npm run lighthouse'
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
test:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v2.3.4'
- name: 'Use Node.js'
uses: 'actions/setup-node@v2.3.0'
with:
node-version: '16.x'
cache: 'npm'
- name: 'Install'
run: 'npm install'
- name: 'Test'
run: 'npm run test'
release:
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
needs: [analyze, lint, build, test]
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v2.3.4'
with:
fetch-depth: 0
persist-credentials: false
- name: 'Use Node.js'
uses: 'actions/setup-node@v2.3.0'
with:
node-version: '16.x'
cache: 'npm'
- name: 'Install'
run: 'npm install'
- name: 'Release'
run: 'npm run release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_NAME }}
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.GIT_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_EMAIL }}
- name: 'Deploy to Vercel'
run: 'npm run deploy -- --token="${VERCEL_TOKEN}" --prod'
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}

27
.github/workflows/analyze.yml vendored Normal file
View File

@ -0,0 +1,27 @@
name: 'Analyze'
on:
push:
branches: [develop]
pull_request:
branches: [master, develop]
jobs:
analyze:
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
matrix:
language: ['javascript']
steps:
- uses: 'actions/checkout@v3.0.0'
- name: 'Initialize CodeQL'
uses: 'github/codeql-action/init@v1'
with:
languages: ${{ matrix.language }}
- name: 'Perform CodeQL Analysis'
uses: 'github/codeql-action/analyze@v1'

25
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,25 @@
name: 'Build'
on:
push:
branches: [develop]
pull_request:
branches: [master, develop]
jobs:
build:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3.0.0'
- name: 'Use Node.js'
uses: 'actions/setup-node@v3.0.0'
with:
node-version: '16.x'
cache: 'npm'
- name: 'Install'
run: 'npm install'
- name: 'Build'
run: 'npm run build'

47
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,47 @@
name: 'Lint'
on:
push:
branches: [develop]
pull_request:
branches: [master, develop]
jobs:
lint:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3.0.0'
- name: 'Use Node.js'
uses: 'actions/setup-node@v3.0.0'
with:
node-version: '16.x'
cache: 'npm'
- name: 'Install'
run: 'npm install'
- name: 'lint:commit'
run: 'npm run lint:commit -- --to "${{ github.sha }}"'
- name: 'lint:editorconfig'
run: 'npm run lint:editorconfig'
- name: 'lint:markdown'
run: 'npm run lint:markdown'
- name: 'lint:typescript'
run: 'npm run lint:typescript'
- name: 'lint:prettier'
run: 'npm run lint:prettier'
- name: 'lint:dotenv'
uses: 'dotenv-linter/action-dotenv-linter@v2'
with:
github_token: ${{ secrets.github_token }}
- name: 'lint:docker'
uses: 'hadolint/hadolint-action@v1.6.0'
with:
dockerfile: './Dockerfile'

44
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,44 @@
name: 'Release'
on:
push:
branches: [master]
jobs:
release:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3.0.0'
with:
fetch-depth: 0
persist-credentials: false
- name: 'Import GPG key'
uses: 'crazy-max/ghaction-import-gpg@v4'
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: 'Use Node.js'
uses: 'actions/setup-node@v3.0.0'
with:
node-version: '16.x'
cache: 'npm'
- name: 'Install'
run: 'npm install'
- name: 'Release'
run: 'npm run release'
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GIT_COMMITTER_NAME: ${{ secrets.GIT_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_EMAIL }}
- name: 'Deploy to Vercel'
run: 'npm run deploy -- --token="${VERCEL_TOKEN}" --prod'
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}

70
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,70 @@
name: 'Test'
on:
push:
branches: [develop]
pull_request:
branches: [master, develop]
jobs:
test-unit:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3.0.0'
- name: 'Use Node.js'
uses: 'actions/setup-node@v3.0.0'
with:
node-version: '16.x'
cache: 'npm'
- name: 'Install'
run: 'npm install'
- name: 'Unit Test'
run: 'npm run test:unit'
test-lighthouse:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3.0.0'
- name: 'Use Node.js'
uses: 'actions/setup-node@v3.0.0'
with:
node-version: '16.x'
cache: 'npm'
- name: 'Install'
run: 'npm install'
- name: 'Build'
run: 'npm run build'
- name: 'html-w3c-validator'
run: 'npm run test:html-w3c-validator'
- name: 'Lighthouse'
run: 'npm run test:lighthouse'
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
test-e2e:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3.0.0'
- name: 'Use Node.js'
uses: 'actions/setup-node@v3.0.0'
with:
node-version: '16.x'
cache: 'npm'
- name: 'Install'
run: 'npm install'
- name: 'Build'
run: 'npm run build'
- name: 'End To End (e2e) Test'
run: 'npm run test:e2e'

11
.gitignore vendored
View File

@ -11,13 +11,16 @@ out
# production # production
build build
dist dist
public/*.html
# PWA
public/workbox-*.js
public/sw.js
# testing # testing
coverage coverage
cypress/screenshots
# PWA cypress/videos
**/workbox-*.js cypress/downloads
**/sw.js
# envs # envs
.env .env

View File

@ -1,8 +1,8 @@
image: 'gitpod/workspace-full' image: 'gitpod/workspace-full'
tasks: tasks:
- before: 'cp .env.example .env && npm install --global npm@7' - before: 'cp .env.example .env'
init: 'npm clean-install' init: 'npm install'
command: 'npm run dev' command: 'npm run dev'
ports: ports:

View File

@ -0,0 +1,8 @@
{
"urls": [
"http://localhost:3000/",
"http://localhost:3000/blog",
"http://localhost:3000/blog/hello-world"
],
"files": ["./public/curriculum-vitae.html"]
}

View File

@ -4,15 +4,22 @@
"startServerCommand": "npm run start", "startServerCommand": "npm run start",
"startServerReadyPattern": "ready on", "startServerReadyPattern": "ready on",
"startServerReadyTimeout": 20000, "startServerReadyTimeout": 20000,
"url": ["http://localhost:3000/"], "url": [
"numberOfRuns": 3 "http://localhost:3000/",
"http://localhost:3000/blog",
"http://localhost:3000/blog/hello-world"
],
"numberOfRuns": 1
}, },
"assert": { "assert": {
"preset": "lighthouse:recommended", "preset": "lighthouse:recommended",
"assertions": { "assertions": {
"csp-xss": "warning", "csp-xss": "warning",
"non-composited-animations": "warning", "non-composited-animations": "warning",
"uses-responsive-images": "warning" "unused-javascript": "warning",
"image-size-responsive": "warning",
"unsized-images": "warning",
"color-contrast": "warning"
} }
}, },
"upload": { "upload": {

View File

@ -1,11 +1,11 @@
{ {
"*": ["editorconfig-checker"], "*": ["editorconfig-checker"],
"*.{js,ts,jsx,tsx}": [ "*.{js,jsx,ts,tsx}": [
"prettier --write", "prettier --write",
"eslint --fix", "eslint --fix",
"jest --findRelatedTests" "jest --findRelatedTests"
], ],
"*.{css,yml,json}": ["prettier --write"], "*.{css,scss,sass,json,jsonc,yml,yaml}": ["prettier --write"],
"*.{md}": ["prettier --write", "markdownlint --dot --fix"], "*.{md,mdx}": ["prettier --write", "markdownlint --dot --fix"],
"./Dockerfile": ["dockerfilelint"] "resume.json": ["resume validate"]
} }

View File

@ -1,9 +1,9 @@
.next .next
.lighthouseci .lighthouseci
storybook-static
coverage
node_modules node_modules
next-env.d.ts next-env.d.ts
package.json
package-lock.json
**/workbox-*.js **/workbox-*.js
**/sw.js **/sw.js
.vercel *.hbs

View File

@ -13,7 +13,12 @@
"preset": "conventionalcommits" "preset": "conventionalcommits"
} }
], ],
[
"@semantic-release/npm", "@semantic-release/npm",
{
"npmPublish": false
}
],
[ [
"@semantic-release/git", "@semantic-release/git",
{ {
@ -21,6 +26,13 @@
"message": "chore(release): ${nextRelease.version} [skip ci]" "message": "chore(release): ${nextRelease.version} [skip ci]"
} }
], ],
"@semantic-release/github" "@semantic-release/github",
[
"@saithodev/semantic-release-backmerge",
{
"branches": [{ "from": "master", "to": "develop" }],
"backmergeStrategy": "merge"
}
]
] ]
} }

View File

@ -7,7 +7,6 @@
"divlo.vscode-styled-jsx-languageserver", "divlo.vscode-styled-jsx-languageserver",
"bradlc.vscode-tailwindcss", "bradlc.vscode-tailwindcss",
"mikestead.dotenv", "mikestead.dotenv",
"coenraads.bracket-pair-colorizer",
"davidanson.vscode-markdownlint", "davidanson.vscode-markdownlint",
"ms-azuretools.vscode-docker" "ms-azuretools.vscode-docker"
] ]

View File

@ -1,7 +1,8 @@
{ {
"typescript.tsdk": "node_modules/typescript/lib", "typescript.tsdk": "node_modules/typescript/lib",
"editor.defaultFormatter": "esbenp.prettier-vscode", "editor.bracketPairColorization.enabled": true,
"prettier.configPath": ".prettierrc.json", "prettier.configPath": ".prettierrc.json",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true, "editor.formatOnSave": true,
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll": true "source.fixAll": true

View File

@ -13,7 +13,7 @@ Thanks a lot for your interest in contributing to **divlo.fr**! 🎉
- **Please first discuss** the change you wish to make via [issue](https://github.com/Divlo/Divlo/issues) before making a change. It might avoid a waste of your time. - **Please first discuss** the change you wish to make via [issue](https://github.com/Divlo/Divlo/issues) before making a change. It might avoid a waste of your time.
- Ensure your code respect [Typescript Standard Style](https://www.npmjs.com/package/ts-standard). - Ensure your code respect linting.
- Make sure your **code passes the tests**. - Make sure your **code passes the tests**.
@ -51,8 +51,8 @@ Scopes define what part of the code changed.
### Prerequisites ### Prerequisites
- [Node.js](https://nodejs.org/) >= 14.0.0 - [Node.js](https://nodejs.org/) >= 16.0.0
- [npm](https://www.npmjs.com/) >= 7.0.0 - [npm](https://www.npmjs.com/) >= 8.0.0
### Installation ### Installation

View File

@ -1,15 +1,15 @@
FROM node:16.5.0 AS dependencies FROM node:16.14.0 AS dependencies
WORKDIR /usr/src/app WORKDIR /usr/src/app
COPY ./package*.json ./ COPY ./package*.json ./
RUN npm clean-install RUN npm install
FROM node:16.5.0 AS builder FROM node:16.14.0 AS builder
WORKDIR /usr/src/app WORKDIR /usr/src/app
COPY ./ ./ COPY ./ ./
COPY --from=dependencies /usr/src/app/node_modules ./node_modules COPY --from=dependencies /usr/src/app/node_modules ./node_modules
RUN npm run build RUN npm run build
FROM node:16.5.0 AS runner FROM node:16.14.0 AS runner
WORKDIR /usr/src/app WORKDIR /usr/src/app
ENV NODE_ENV=production ENV NODE_ENV=production
COPY --from=builder /usr/src/app/next.config.js ./next.config.js COPY --from=builder /usr/src/app/next.config.js ./next.config.js

View File

@ -5,7 +5,6 @@
</p> </p>
<p align="center"> <p align="center">
<a href="https://github.com/Divlo/Divlo/actions/workflows/Divlo.yml"><img src="https://github.com/Divlo/Divlo/actions/workflows/Divlo.yml/badge.svg?branch=master" alt="Divlo's CI" /></a>
<a href="https://github.com/Divlo"><img alt="GitHub" src="https://img.shields.io/badge/-GitHub-5A5A5A?style=flat&labelColor=5A5A5A&logo=github&logoColor=white"/></a> <a href="https://github.com/Divlo"><img alt="GitHub" src="https://img.shields.io/badge/-GitHub-5A5A5A?style=flat&labelColor=5A5A5A&logo=github&logoColor=white"/></a>
<a href="https://gitlab.com/Divlo"><img alt="GitLab" src="https://img.shields.io/badge/-GitLab-303030?style=flat&labelColor=303030&logo=gitlab&logoColor=white"/></a> <a href="https://gitlab.com/Divlo"><img alt="GitLab" src="https://img.shields.io/badge/-GitLab-303030?style=flat&labelColor=303030&logo=gitlab&logoColor=white"/></a>
<a href="https://www.npmjs.com/~divlo"><img alt="npm" src="https://img.shields.io/badge/-npm-c4302b?style=flat&labelColor=c4302b&logo=npm&logoColor=white"/></a> <a href="https://www.npmjs.com/~divlo"><img alt="npm" src="https://img.shields.io/badge/-npm-c4302b?style=flat&labelColor=c4302b&logo=npm&logoColor=white"/></a>
@ -23,7 +22,7 @@
```json ```json
{ {
"name": "Divlo", "name": "Divlo",
"pronouns": "He' | 'Him", "pronouns": "He/Him",
"birthDate": "31/03/2003", "birthDate": "31/03/2003",
"nationality": "Alsace, France", "nationality": "Alsace, France",
"interests": [ "interests": [
@ -32,17 +31,17 @@
"Open-Source enthusiast" "Open-Source enthusiast"
], ],
"skills": { "skills": {
"programmingLanguages": ["JavaScript", "TypeScript", "Python"], "programmingLanguages": ["JavaScript", "TypeScript", "Python", "C/C++"],
"frontEnd": ["HTML", "CSS", "Tailwind CSS", "React.js (+ Next.js)"], "frontEnd": ["HTML", "CSS", "Tailwind CSS", "React.js (+ Next.js)"],
"backEnd": ["Node.js", "Fastify", "Prisma", "PostgreSQL", "MySQL"], "backEnd": ["Node.js", "Fastify", "Prisma", "PostgreSQL", "MySQL"],
"tools": ["Ubuntu", "Hyper Terminal", "VSCode", "Git", "Docker"] "tools": ["GNU/Linux", "Ubuntu", "Visual Studio Code", "Git", "Docker"]
} }
} }
``` ```
<hr /> <hr />
## 📈 Stats ## 📈 Statistics
<p align=center> <p align=center>
<img height=175 align="center" src="https://github-readme-stats.vercel.app/api?username=Divlo&show_icons=true&theme=dark" /> <img height=175 align="center" src="https://github-readme-stats.vercel.app/api?username=Divlo&show_icons=true&theme=dark" />

View File

@ -1,10 +0,0 @@
import { render } from '@testing-library/react'
import Error404 from 'pages/404'
describe('GET /404', () => {
it('should render', async () => {
const { getByText } = render(<Error404 />)
expect(getByText('404')).toBeInTheDocument()
})
})

View File

@ -1,10 +0,0 @@
import { render } from '@testing-library/react'
import Error500 from 'pages/500'
describe('GET /500', () => {
it('should render', async () => {
const { getByText } = render(<Error500 />)
expect(getByText('500')).toBeInTheDocument()
})
})

View File

@ -12,15 +12,20 @@ export const ErrorPage: React.FC<ErrorPageProps> = (props) => {
return ( return (
<> <>
<h1 className='my-6 font-semibold text-4xl'> <h1 className='my-6 text-4xl font-semibold'>
{t('errors:error')}{' '} {t('errors:error')}{' '}
<span className='text-yellow dark:text-yellow-dark'>{statusCode}</span> <span
className='text-yellow dark:text-yellow-dark'
data-cy='status-code'
>
{statusCode}
</span>
</h1> </h1>
<p className='text-center text-lg'> <p className='text-center text-lg'>
{message}{' '} {message}{' '}
<Link href='/'> <Link href='/'>
<a className='text-yellow dark:text-yellow-dark hover:underline'> <a className='text-yellow hover:underline dark:text-yellow-dark'>
{t('errors:returnToHomePage')} {t('errors:return-to-home-page')}
</a> </a>
</Link> </Link>
</p> </p>

View File

@ -11,26 +11,23 @@ export const Footer: React.FC<FooterProps> = (props) => {
const { version } = props const { version } = props
const versionLink = useMemo(() => { const versionLink = useMemo(() => {
if (version !== '0.0.0-development') {
return `https://github.com/Divlo/Divlo/releases/tag/v${version}` return `https://github.com/Divlo/Divlo/releases/tag/v${version}`
}
return 'https://github.com/Divlo/Divlo/tree/develop'
}, [version]) }, [version])
return ( return (
<footer className='bg-white flex flex-col items-center justify-center py-6 text-lg border-t-2 border-gray-600 dark:border-gray-400 dark:bg-black'> <footer className='flex flex-col items-center justify-center border-t-2 border-gray-600 bg-white py-6 text-lg dark:border-gray-400 dark:bg-black'>
<p> <p>
<Link href='/'> <Link href='/'>
<a className='hover:underline text-yellow dark:text-yellow-dark'> <a className='text-yellow hover:underline dark:text-yellow-dark'>
Divlo Divlo
</a> </a>
</Link>{' '} </Link>{' '}
| {t('common:allRightsReserved')} | {t('common:all-rights-reserved')}
</p> </p>
<p className='mt-1'> <p className='mt-1'>
Version{' '} Version{' '}
<a <a
className='hover:underline text-yellow dark:text-yellow-dark' className='text-yellow hover:underline dark:text-yellow-dark'
href={versionLink} href={versionLink}
target='_blank' target='_blank'
rel='noopener noreferrer' rel='noopener noreferrer'

View File

@ -3,15 +3,15 @@ import NextHead from 'next/head'
interface HeadProps { interface HeadProps {
title?: string title?: string
image?: string image?: string
description?: string description: string
url?: string url?: string
} }
export const Head: React.FC<HeadProps> = (props) => { export const Head: React.FC<HeadProps> = (props) => {
const { const {
title = 'Divlo', title = 'Divlo',
image = '/images/icons/icon-96x96.png', image = 'https://divlo.fr/images/icons/icon-96x96.png',
description = "I'm Divlo, I'm 18 years old, I'm from France - Developer Full Stack Junior • Passionate about High-Tech", description,
url = 'https://divlo.fr/' url = 'https://divlo.fr/'
} = props } = props
@ -39,7 +39,7 @@ export const Head: React.FC<HeadProps> = (props) => {
<meta name='twitter:card' content='summary' /> <meta name='twitter:card' content='summary' />
<meta name='twitter:description' content={description} /> <meta name='twitter:description' content={description} />
<meta name='twitter:title' content={title} /> <meta name='twitter:title' content={title} />
<meta name='twitter:image:src' content={image} /> <meta name='twitter:image' content={image} />
{/* Google Verification */} {/* Google Verification */}
<meta <meta

View File

@ -10,12 +10,15 @@ export const LanguageFlag: React.FC<LanguageFlagProps> = (props) => {
return ( return (
<> <>
<Image <Image
quality={100}
width={35} width={35}
height={35} height={35}
src={`/images/languages/${language}.svg`} src={`/images/languages/${language}.svg`}
alt={language} alt={language}
/> />
<p className='mx-2 text-base'>{language.toUpperCase()}</p> <p data-cy='language-flag-text' className='mx-2 text-base'>
{language.toUpperCase()}
</p>
</> </>
) )
} }

View File

@ -1,10 +1,12 @@
import { useCallback, useEffect, useState } from 'react' import { useCallback, useEffect, useState } from 'react'
import useTranslation from 'next-translate/useTranslation' import useTranslation from 'next-translate/useTranslation'
import setLanguage from 'next-translate/setLanguage' import setLanguage from 'next-translate/setLanguage'
import classNames from 'classnames'
import i18n from 'i18n.json'
import { Arrow } from './Arrow' import { Arrow } from './Arrow'
import { LanguageFlag } from './LanguageFlag' import { LanguageFlag } from './LanguageFlag'
import i18n from 'i18n.json'
export const Language: React.FC = () => { export const Language: React.FC = () => {
const { lang: currentLanguage } = useTranslation() const { lang: currentLanguage } = useTranslation()
@ -32,13 +34,23 @@ export const Language: React.FC = () => {
} }
return ( return (
<div className='flex flex-col justify-center items-center cursor-pointer'> <div className='flex cursor-pointer flex-col items-center justify-center'>
<div className='flex items-center mr-5' onClick={handleHiddenMenu}> <div
data-cy='language-click'
className='mr-5 flex items-center'
onClick={handleHiddenMenu}
>
<LanguageFlag language={currentLanguage} /> <LanguageFlag language={currentLanguage} />
<Arrow /> <Arrow />
</div> </div>
{!hiddenMenu && (
<ul className='flex flex-col justify-center items-center absolute p-0 top-14 z-10 w-24 mt-3 mr-4 rounded-lg list-none shadow-light dark:shadow-dark bg-white dark:bg-black'> <ul
data-cy='languages-list'
className={classNames(
'absolute top-14 z-10 mt-3 mr-4 flex w-24 list-none flex-col items-center justify-center rounded-lg bg-white p-0 shadow-lightFlag dark:bg-black dark:shadow-darkFlag',
{ hidden: hiddenMenu }
)}
>
{i18n.locales.map((language, index) => { {i18n.locales.map((language, index) => {
if (language === currentLanguage) { if (language === currentLanguage) {
return null return null
@ -46,7 +58,7 @@ export const Language: React.FC = () => {
return ( return (
<li <li
key={index} key={index}
className='flex items-center justify-center w-full h-12 hover:bg-[#4f545c] hover:bg-opacity-20 pl-2' className='flex h-12 w-full items-center justify-center pl-2 hover:bg-[#4f545c] hover:bg-opacity-20'
onClick={async () => await handleLanguage(language)} onClick={async () => await handleLanguage(language)}
> >
<LanguageFlag language={language} /> <LanguageFlag language={language} />
@ -54,7 +66,6 @@ export const Language: React.FC = () => {
) )
})} })}
</ul> </ul>
)}
</div> </div>
) )
} }

View File

@ -13,26 +13,42 @@ export const SwitchTheme: React.FC = () => {
return null return null
} }
const handleClick = (): void => {
setTheme(theme === 'dark' ? 'light' : 'dark')
}
return ( return (
<> <>
<div <div
className='toggle-button' className='flex items-center'
onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')} data-cy='switch-theme-click'
onClick={handleClick}
> >
<div className='toggle-theme-button'> <div className='toggle-theme-button relative inline-block cursor-pointer bg-transparent'>
<div className='toggle-track'> <div className='toggle-track'>
<div className='toggle-track-check'> <div
<span className='toggle_Dark'>🌜</span> data-cy='switch-theme-dark'
className='toggle-track-check absolute'
>
<span className='toggle_Dark relative flex items-center justify-center'>
🌜
</span>
</div> </div>
<div className='toggle-track-x'> <div
<span className='toggle_Light'>🌞</span> data-cy='switch-theme-light'
className='toggle-track-x absolute'
>
<span className='toggle_Light relative flex items-center justify-center'>
🌞
</span>
</div> </div>
</div> </div>
<div className='toggle-thumb' /> <div className='toggle-thumb absolute' />
<input <input
data-cy='switch-theme-input'
type='checkbox' type='checkbox'
aria-label='Dark mode toggle' aria-label='Dark mode toggle'
className='toggle-screenreader-only' className='toggle-screenreader-only absolute overflow-hidden'
defaultChecked defaultChecked
/> />
</div> </div>
@ -40,16 +56,8 @@ export const SwitchTheme: React.FC = () => {
<style jsx> <style jsx>
{` {`
.toggle-button {
display: flex;
align-items: center;
}
.toggle-theme-button { .toggle-theme-button {
touch-action: pan-x; touch-action: pan-x;
display: inline-block;
position: relative;
cursor: pointer;
background-color: transparent;
border: 0; border: 0;
padding: 0; padding: 0;
user-select: none; user-select: none;
@ -64,7 +72,6 @@ export const SwitchTheme: React.FC = () => {
color: #fff; color: #fff;
} }
.toggle-track-check { .toggle-track-check {
position: absolute;
width: 14px; width: 14px;
height: 10px; height: 10px;
top: 0; top: 0;
@ -77,7 +84,6 @@ export const SwitchTheme: React.FC = () => {
transition: opacity 0.25s ease; transition: opacity 0.25s ease;
} }
.toggle-track-x { .toggle-track-x {
position: absolute;
width: 10px; width: 10px;
height: 10px; height: 10px;
top: 0; top: 0;
@ -90,15 +96,10 @@ export const SwitchTheme: React.FC = () => {
} }
.toggle_Dark, .toggle_Dark,
.toggle_Light { .toggle_Light {
align-items: center;
display: flex;
height: 10px; height: 10px;
justify-content: center;
position: relative;
width: 10px; width: 10px;
} }
.toggle-thumb { .toggle-thumb {
position: absolute;
left: ${theme === 'dark' ? '27px' : '0px'}; left: ${theme === 'dark' ? '27px' : '0px'};
width: 22px; width: 22px;
height: 22px; height: 22px;
@ -115,9 +116,7 @@ export const SwitchTheme: React.FC = () => {
clip: rect(0 0 0 0); clip: rect(0 0 0 0);
height: 1px; height: 1px;
margin: -1px; margin: -1px;
overflow: hidden;
padding: 0; padding: 0;
position: absolute;
width: 1px; width: 1px;
} }
`} `}

View File

@ -3,7 +3,7 @@ import { render } from '@testing-library/react'
import { Header } from '..' import { Header } from '..'
describe('<Header />', () => { describe('<Header />', () => {
it('should render', async () => { it('should render', () => {
const { getByText } = render(<Header />) const { getByText } = render(<Header />)
expect(getByText('Divlo')).toBeInTheDocument() expect(getByText('Divlo')).toBeInTheDocument()
}) })

View File

@ -4,26 +4,43 @@ import Image from 'next/image'
import { Language } from './Language' import { Language } from './Language'
import { SwitchTheme } from './SwitchTheme' import { SwitchTheme } from './SwitchTheme'
export const Header: React.FC = () => { export interface HeaderProps {
showLanguage?: boolean
}
export const Header: React.FC<HeaderProps> = (props) => {
const { showLanguage = false } = props
return ( return (
<header className='bg-white sticky top-0 z-50 flex w-full justify-between px-6 py-2 border-b-2 border-gray-600 dark:border-gray-400 dark:bg-black'> <header className='sticky top-0 z-50 flex w-full justify-between border-b-2 border-gray-600 bg-white px-6 py-2 dark:border-gray-400 dark:bg-black'>
<Link href='/'> <Link href='/'>
<a> <a>
<div className='flex items-center justify-center'> <div className='flex items-center justify-center'>
<Image <Image
quality={100}
width={60} width={60}
height={60} height={60}
src='/images/divlo_icon_small.png' src='/images/divlo_icon_small.png'
alt='Divlo' alt='Divlo'
/> />
<strong className='ml-1 font-headline font-semibold hidden xs:block text-yellow dark:text-yellow-dark'> <strong className='ml-1 hidden font-headline font-semibold text-yellow dark:text-yellow-dark xs:block'>
Divlo Divlo
</strong> </strong>
</div> </div>
</a> </a>
</Link> </Link>
<div className='flex justify-between'> <div className='flex justify-between'>
<Language /> <div className='flex flex-col items-center justify-center px-6'>
<Link href='/blog'>
<a
data-cy='header-blog-link'
className='text-yellow hover:underline dark:text-yellow-dark'
>
Blog
</a>
</Link>
</div>
{showLanguage && <Language />}
<SwitchTheme /> <SwitchTheme />
</div> </div>
</header> </header>

View File

@ -10,8 +10,8 @@ export const InterestParagraph: React.FC<InterestParagraphProps> = (props) => {
return ( return (
<> <>
<p className='text-center my-6 text-gray dark:text-gray-dark'> <p className='my-6 text-center text-gray dark:text-gray-dark'>
<strong className='text-yellow font-medium text-lg dark:text-yellow-dark'> <strong className='text-lg font-semibold text-yellow dark:text-yellow-dark'>
{title} {title}
</strong> </strong>
<br /> <br />

View File

@ -10,9 +10,9 @@ export const InterestItem: React.FC<InterestItemProps> = (props) => {
const { fontAwesomeIcon, title } = props const { fontAwesomeIcon, title } = props
return ( return (
<li className='interest-item my-2 mx-2 w-8 h-8' title={title}> <li className='interest-item my-2 mx-2 h-8 w-8' title={title}>
<FontAwesomeIcon <FontAwesomeIcon
className='text-yellow cursor-pointer h-full w-full block dark:text-yellow-dark' className='block h-full w-full text-yellow dark:text-yellow-dark'
icon={fontAwesomeIcon} icon={fontAwesomeIcon}
/> />
</li> </li>

View File

@ -5,8 +5,8 @@ import { InterestItem } from './InterestItem'
export const InterestsList: React.FC = () => { export const InterestsList: React.FC = () => {
return ( return (
<div className='flex justify-center my-4'> <div className='my-4 flex justify-center'>
<ul className='flex justify-around p-0 m-0 list-none w-96'> <ul className='m-0 flex w-96 list-none justify-around p-0'>
<InterestItem <InterestItem
title='Developer Full Stack Junior' title='Developer Full Stack Junior'
fontAwesomeIcon={faCode} fontAwesomeIcon={faCode}

View File

@ -15,13 +15,11 @@ export const Interests: React.FC = () => {
) )
return ( return (
<>
<div className='max-w-full'> <div className='max-w-full'>
{paragraphs.map((paragraph, index) => { {paragraphs.map((paragraph, index) => {
return <InterestParagraph key={index} {...paragraph} /> return <InterestParagraph key={index} {...paragraph} />
})} })}
<InterestsList /> <InterestsList />
</div> </div>
</>
) )
} }

View File

@ -11,10 +11,10 @@ export const Repository: React.FC<RepositoryProps> = (props) => {
const { name, description, href } = props const { name, description, href } = props
return ( return (
<ShadowContainer className='cursor-pointer relative p-6 !mb-4 max-h-32 transition-transform duration-200 ease-in-out hover:-translate-y-2'> <ShadowContainer className='relative !mb-4 max-h-32 cursor-pointer p-6 transition-transform duration-200 ease-in-out hover:-translate-y-2'>
<a href={href} target='_blank' rel='noopener noreferrer'> <a href={href} target='_blank' rel='noopener noreferrer'>
<div className='flex'> <div className='flex'>
<GitHubIcon className='h-6 mr-2' /> <GitHubIcon className='mr-2 h-6' />
<span className='text-yellow dark:text-yellow-dark'>{name}</span> <span className='text-yellow dark:text-yellow-dark'>{name}</span>
</div> </div>
<p className='my-4'>{description}</p> <p className='my-4'>{description}</p>

View File

@ -6,13 +6,12 @@ export const OpenSource: React.FC = () => {
const { t } = useTranslation() const { t } = useTranslation()
return ( return (
<> <div className='mt-0 flex max-w-full flex-col items-center'>
<div className='max-w-full mt-0 flex flex-col items-center'>
<p className='text-center'>{t('home:open-source.description')}</p> <p className='text-center'>{t('home:open-source.description')}</p>
<div className='grid grid-cols-1 md:w-10/12 md:grid-cols-2 gap-6 my-6'> <div className='my-6 grid grid-cols-1 gap-6 md:w-10/12 md:grid-cols-2'>
<Repository <Repository
name='nodejs/node' name='nodejs/node'
description='Node.js JavaScript runtime ✨️🐢🚀✨️' description='Node.js JavaScript runtime 🐢🚀'
href='https://github.com/nodejs/node/commits?author=Divlo' href='https://github.com/nodejs/node/commits?author=Divlo'
/> />
<Repository <Repository
@ -26,22 +25,11 @@ export const OpenSource: React.FC = () => {
href='https://github.com/nrwl/nx/commits?author=Divlo' href='https://github.com/nrwl/nx/commits?author=Divlo'
/> />
<Repository <Repository
name='vercel/styled-jsx' name='vercel/next.js'
description='Full CSS support for JSX without compromises' description='The React Framework for Production'
href='https://github.com/vercel/styled-jsx/commits?author=Divlo' href='https://github.com/vercel/next.js/commits?author=Divlo'
/> />
</div> </div>
</div> </div>
<style jsx global>{`
.animation-custom {
position: relative;
transition: all 0.3s ease 0s;
}
.animation-custom:hover {
transform: translateY(-7px);
}
`}</style>
</>
) )
} }

View File

@ -1,6 +1,7 @@
import { ShadowContainer } from 'components/design/ShadowContainer'
import Image from 'next/image' import Image from 'next/image'
import { ShadowContainer } from 'components/design/ShadowContainer'
export interface PortfolioItemProps { export interface PortfolioItemProps {
title: string title: string
description: string description: string
@ -12,7 +13,7 @@ export const PortfolioItem: React.FC<PortfolioItemProps> = (props) => {
const { title, description, link, image } = props const { title, description, link, image } = props
return ( return (
<ShadowContainer className='cursor-pointer relative items-center sm:ml-10'> <ShadowContainer className='relative cursor-pointer items-center sm:ml-10'>
<a <a
className='group inline-flex justify-center' className='group inline-flex justify-center'
target='_blank' target='_blank'
@ -22,6 +23,7 @@ export const PortfolioItem: React.FC<PortfolioItemProps> = (props) => {
> >
<div className='flex justify-center'> <div className='flex justify-center'>
<Image <Image
quality={100}
className='transition-opacity duration-500 group-hover:opacity-20 dark:group-hover:opacity-5' className='transition-opacity duration-500 group-hover:opacity-20 dark:group-hover:opacity-5'
width={300} width={300}
height={300} height={300}
@ -29,8 +31,8 @@ export const PortfolioItem: React.FC<PortfolioItemProps> = (props) => {
alt={title} alt={title}
/> />
</div> </div>
<div className='opacity-0 transition-opacity duration-500 h-auto absolute text-center overflow-hidden bottom-0 group-hover:opacity-100'> <div className='absolute bottom-0 h-auto overflow-hidden text-center opacity-0 transition-opacity duration-500 group-hover:opacity-100'>
<h3 className='text-yellow text-xl font-semibold my-6 dark:text-yellow-dark'> <h3 className='my-6 text-xl font-semibold text-yellow dark:text-yellow-dark'>
{title} {title}
</h3> </h3>
<p className='my-6'>{description}</p> <p className='my-6'>{description}</p>

View File

@ -14,7 +14,7 @@ export const Portfolio: React.FC = () => {
) )
return ( return (
<div className='flex flex-wrap justify-center px-3 w-full'> <div className='flex w-full flex-wrap justify-center px-3'>
{items.map((item, index) => { {items.map((item, index) => {
return <PortfolioItem key={index} {...item} /> return <PortfolioItem key={index} {...item} />
})} })}

View File

@ -1,12 +1,23 @@
import Translation from 'next-translate/Trans' import useTranslation from 'next-translate/useTranslation'
export const ProfileDescriptionBottom: React.FC = () => { export const ProfileDescriptionBottom: React.FC = () => {
const { t, lang } = useTranslation()
return ( return (
<p className='mt-8 mb-8 font-normal text-base text-gray dark:text-gray-dark'> <p className='mt-8 mb-8 text-base font-normal text-gray dark:text-gray-dark'>
<Translation {t('home:about.description-bottom')}
i18nKey='home:about.descriptionBottom' {lang === 'fr' && (
components={[<br key='break' />]} <>
/> <br />
<br />
<a
href='/curriculum-vitae'
className='text-yellow hover:underline dark:text-yellow-dark'
>
Curriculum vitæ
</a>
</>
)}
</p> </p>
) )
} }

View File

@ -1,44 +1,17 @@
import useTranslation from 'next-translate/useTranslation' import useTranslation from 'next-translate/useTranslation'
export const ProfileInfo: React.FC = () => { export const ProfileInformation: React.FC = () => {
const { t } = useTranslation() const { t } = useTranslation()
return ( return (
<> <div className='mb-6 border-b-2 border-gray-600 pb-2 font-headline dark:border-gray-400'>
<div className='pb-2 mb-6 border-b-2 font-headline border-gray-600 dark:border-gray-400'> <h1 className='mb-2 text-4xl'>
<h1 className='text-4xl mb-2'> {t('home:about.i-am')}{' '}
{t('home:about.IAm')}{' '}
<strong className='font-semibold text-yellow dark:text-yellow-dark'> <strong className='font-semibold text-yellow dark:text-yellow-dark'>
Divlo Divlo
</strong> </strong>
</h1> </h1>
<h2 className='text-base mb-3'>{t('home:about.description')}</h2> <h2 className='mb-3 text-base'>{t('home:about.description')}</h2>
</div> </div>
<style jsx>
{`
.profile-info {
padding-bottom: 25px;
margin-bottom: 25px;
border-bottom: 1px solid #dedede;
}
.profile-title {
font-size: 36px;
line-height: 1.1;
font-weight: 300;
margin-bottom: 10px;
}
.profile-title > strong {
font-weight: 600;
}
.profile-description {
font-size: 17.4px;
font-weight: 400;
line-height: 1.1;
margin: 0;
}
`}
</style>
</>
) )
} }

View File

@ -8,15 +8,14 @@ export const ProfileItem: React.FC<ProfileItemProps> = (props) => {
const { title, value, link } = props const { title, value, link } = props
return ( return (
<> <li className='mb-3 before:table after:clear-both after:table'>
<li className='profile-list__item'> <strong className='float-left block w-28 text-sm font-bold text-black dark:text-white'>
<strong className='profile-list__item-title text-black dark:text-white'>
{title} {title}
</strong> </strong>
<span className='profile-list__item-info text-gray dark:text-gray-dark'> <span className='ml-0 mb-4 block text-sm font-normal text-gray dark:text-gray-dark sm:mb-0 sm:ml-32'>
{link != null ? ( {link != null ? (
<a <a
className='text-gray dark:text-gray-dark hover:underline' className='text-gray hover:underline dark:text-gray-dark'
href={link} href={link}
> >
{value} {value}
@ -26,54 +25,5 @@ export const ProfileItem: React.FC<ProfileItemProps> = (props) => {
)} )}
</span> </span>
</li> </li>
<style jsx>
{`
.profile-list__item {
margin-bottom: 13px;
}
.profile-list__item::after,
.profile-list__item::before {
content: ' ';
display: table;
}
.profile-list__item::after {
clear: both;
}
.profile-list__item-title {
display: block;
width: 120px;
float: left;
font-size: 12px;
font-weight: 700;
line-height: 20px;
text-transform: uppercase;
}
.profile-list__item-info {
display: block;
margin-left: 125px;
font-size: 15px;
font-weight: 400;
line-height: 20px;
}
@media (max-width: 576px) {
.profile-list__item-title {
margin-bottom: 3px;
}
.profile-list__item-info {
margin-left: 0;
margin-bottom: 15px;
}
.profile-list__item-info,
.profile-list__item-title {
width: 100%;
float: none;
line-height: 1.2;
}
}
`}
</style>
</>
) )
} }

View File

@ -1,13 +1,30 @@
import useTranslation from 'next-translate/useTranslation' import useTranslation from 'next-translate/useTranslation'
import {
DIVLO_BIRTHDAY_DAY,
DIVLO_BIRTHDAY_MONTH,
DIVLO_BIRTHDAY_YEAR
} from 'utils/getAge'
import { ProfileItem } from './ProfileItem' import { ProfileItem } from './ProfileItem'
export const ProfileList: React.FC = () => { export interface ProfileListProps {
age: number
}
export const ProfileList: React.FC<ProfileListProps> = (props) => {
const { age } = props
const { t } = useTranslation('home') const { t } = useTranslation('home')
return ( return (
<ul className='m-0 p-0 list-none'> <ul className='m-0 list-none p-0'>
<ProfileItem title={t('home:about.birthDate')} value='31/03/2003' /> <ProfileItem title={t('home:about.full-name')} value='Théo LUDWIG' />
<ProfileItem
title={t('home:about.birth-date')}
value={`${DIVLO_BIRTHDAY_DAY}/${DIVLO_BIRTHDAY_MONTH}/${DIVLO_BIRTHDAY_YEAR} (${age} ${t(
'home:about.years-old'
)})`}
/>
<ProfileItem title={t('home:about.nationality')} value='Alsace, France' /> <ProfileItem title={t('home:about.nationality')} value='Alsace, France' />
<ProfileItem <ProfileItem
title='Email' title='Email'

View File

@ -1,14 +1,11 @@
import Image from 'next/image' import Image from 'next/image'
import DivloLogo from 'public/images/divlo_logo.png'
export const ProfileLogo: React.FC = () => { export const ProfileLogo: React.FC = () => {
return ( return (
<div className='px-2 py-6'> <div className='max-h-[370px] max-w-[370px] px-2 py-6'>
<Image <Image quality={100} src={DivloLogo} alt='Divlo' />
width={370}
height={370}
src='/images/divlo_logo.png'
alt='Divlo'
/>
</div> </div>
) )
} }

View File

@ -8,7 +8,7 @@ export const Icon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => {
xmlns='http://www.w3.org/2000/svg' xmlns='http://www.w3.org/2000/svg'
viewBox='0 0 24 24' viewBox='0 0 24 24'
className={classNames( className={classNames(
'dark:text-white text-black w-8 h-8 fill-current', 'h-8 w-8 fill-current text-black dark:text-white',
className className
)} )}
{...rest} {...rest}

View File

@ -7,7 +7,7 @@ export const SocialMediaItem: React.FC<SocialMediaItemProps> = (props) => {
const { link, ariaLabel, children } = props const { link, ariaLabel, children } = props
return ( return (
<li className='inline-block mx-4 my-1'> <li className='mx-4 my-1 inline-block'>
<a <a
href={link} href={link}
aria-label={ariaLabel} aria-label={ariaLabel}

View File

@ -9,7 +9,7 @@ import { NPMIcon } from './SocialMediaIcons/NPMIcon'
export const SocialMediaList: React.FC = () => { export const SocialMediaList: React.FC = () => {
return ( return (
<ul className='social-media-list m-0 mt-2 py-4 list-none text-center'> <ul className='social-media-list m-0 mt-2 list-none py-4 text-center'>
<SocialMediaItem link='https://github.com/Divlo' ariaLabel='GitHub'> <SocialMediaItem link='https://github.com/Divlo' ariaLabel='GitHub'>
<GitHubIcon /> <GitHubIcon />
</SocialMediaItem> </SocialMediaItem>

View File

@ -1,15 +1,21 @@
import { ProfileDescriptionBottom } from './ProfileDescriptionBottom' import { ProfileDescriptionBottom } from './ProfileDescriptionBottom'
import { ProfileInfo } from './ProfileInfo' import { ProfileInformation } from './ProfileInfo'
import { ProfileList } from './ProfileList' import { ProfileList } from './ProfileList'
import { ProfileLogo } from './ProfileLogo' import { ProfileLogo } from './ProfileLogo'
export const Profile: React.FC = () => { export interface ProfileProps {
age: number
}
export const Profile: React.FC<ProfileProps> = (props) => {
const { age } = props
return ( return (
<div className='flex flex-col justify-center items-center px-10 pt-2 md:pt-10 xl:pt-0 md:flex-row'> <div className='flex flex-col items-center justify-center px-10 pt-2 md:flex-row md:pt-10'>
<ProfileLogo /> <ProfileLogo />
<div> <div>
<ProfileInfo /> <ProfileInformation />
<ProfileList /> <ProfileList age={age} />
<ProfileDescriptionBottom /> <ProfileDescriptionBottom />
</div> </div>
</div> </div>

View File

@ -28,7 +28,7 @@ export const SkillComponent: React.FC<SkillComponentProps> = (props) => {
rel='noopener noreferrer' rel='noopener noreferrer'
> >
<div className='text-center'> <div className='text-center'>
<Image width={60} height={60} alt={skill} src={image} /> <Image quality={100} width={60} height={60} alt={skill} src={image} />
<p className='mt-1'>{skill}</p> <p className='mt-1'>{skill}</p>
</div> </div>
</a> </a>

View File

@ -10,15 +10,15 @@ export const SkillsSection: React.FC<SkillsSectionProps> = (props) => {
return ( return (
<ShadowContainer> <ShadowContainer>
<div className='w-full px-4 mx-auto'> <div className='mx-auto w-full px-4'>
<div className='flex flex-wrap px-4 py-6'> <div className='flex flex-wrap px-4 py-6'>
<div className='flex-1'> <div className='flex-1'>
<div className='mb-8 border-b border-gray-600 dark:border-opacity-10 dark:border-white'> <div className='mb-8 border-b border-gray-600 dark:border-white dark:border-opacity-10'>
<h3 className='text-yellow font-semibold text-xl my-3 dark:text-yellow-dark'> <h3 className='my-3 text-xl font-semibold text-yellow dark:text-yellow-dark'>
{title} {title}
</h3> </h3>
</div> </div>
<div className='flex justify-around flex-wrap'>{children}</div> <div className='flex flex-wrap justify-around'>{children}</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -12,6 +12,7 @@ export const Skills: React.FC = () => {
<SkillComponent skill='JavaScript' /> <SkillComponent skill='JavaScript' />
<SkillComponent skill='TypeScript' /> <SkillComponent skill='TypeScript' />
<SkillComponent skill='Python' /> <SkillComponent skill='Python' />
<SkillComponent skill='C/C++' />
</SkillsSection> </SkillsSection>
<SkillsSection title='Front-end'> <SkillsSection title='Front-end'>
@ -29,9 +30,9 @@ export const Skills: React.FC = () => {
<SkillComponent skill='MySQL' /> <SkillComponent skill='MySQL' />
</SkillsSection> </SkillsSection>
<SkillsSection title={t('home:skills.softwareTools')}> <SkillsSection title={t('home:skills.software-tools')}>
<SkillComponent skill='GNU/Linux' />
<SkillComponent skill='Ubuntu' /> <SkillComponent skill='Ubuntu' />
<SkillComponent skill='Hyper' />
<SkillComponent skill='Visual Studio Code' /> <SkillComponent skill='Visual Studio Code' />
<SkillComponent skill='Git' /> <SkillComponent skill='Git' />
<SkillComponent skill='Docker' /> <SkillComponent skill='Docker' />

View File

@ -98,6 +98,10 @@ export const skills: Skills = {
link: 'https://ubuntu.com/', link: 'https://ubuntu.com/',
image: '/images/skills/Ubuntu.png' image: '/images/skills/Ubuntu.png'
}, },
'GNU/Linux': {
link: 'https://www.gnu.org/',
image: '/images/skills/GNU-Linux.png'
},
Docker: { Docker: {
link: 'https://www.docker.com/', link: 'https://www.docker.com/',
image: '/images/skills/Docker.png' image: '/images/skills/Docker.png'

View File

@ -3,7 +3,7 @@ import { render } from '@testing-library/react'
import { ErrorPage } from '../ErrorPage' import { ErrorPage } from '../ErrorPage'
describe('<ErrorPage />', () => { describe('<ErrorPage />', () => {
it('should render the message and statusCode', async () => { it('should render the message and statusCode', () => {
const messageContent = 'message content' const messageContent = 'message content'
const statusCode = 404 const statusCode = 404
const { getByText } = render( const { getByText } = render(

View File

@ -3,7 +3,7 @@ import { render } from '@testing-library/react'
import { Footer } from '../Footer' import { Footer } from '../Footer'
describe('<Footer />', () => { describe('<Footer />', () => {
it('should render the version link pointing to the GitHub release', async () => { it('should render with appropriate link tag version', () => {
const version = '1.0.0' const version = '1.0.0'
const { getByText } = render(<Footer version={version} />) const { getByText } = render(<Footer version={version} />)
const versionLink = getByText(version) as HTMLAnchorElement const versionLink = getByText(version) as HTMLAnchorElement
@ -13,15 +13,4 @@ describe('<Footer />', () => {
`https://github.com/Divlo/Divlo/releases/tag/v${version}` `https://github.com/Divlo/Divlo/releases/tag/v${version}`
) )
}) })
it('should render the version link pointing to the `develop` branch', async () => {
const version = '0.0.0-development'
const { getByText } = render(<Footer version={version} />)
const versionLink = getByText(version) as HTMLAnchorElement
expect(getByText('Divlo')).toBeInTheDocument()
expect(versionLink).toBeInTheDocument()
expect(versionLink.href).toEqual(
'https://github.com/Divlo/Divlo/tree/develop'
)
})
}) })

View File

@ -10,7 +10,8 @@ export const RevealFade: React.FC = (props) => {
(entries, observer) => { (entries, observer) => {
entries.forEach((entry) => { entries.forEach((entry) => {
if (entry.isIntersecting) { if (entry.isIntersecting) {
entry.target.classList.add('reveal-visible') entry.target.className =
'opacity-100 visible translate-y-0 transition-all duration-700 ease-in-out'
observer.unobserve(entry.target) observer.unobserve(entry.target)
} }
}) })
@ -25,26 +26,8 @@ export const RevealFade: React.FC = (props) => {
}, []) }, [])
return ( return (
<> <div ref={htmlElement} className='invisible -translate-y-7 opacity-0'>
<div ref={htmlElement} className='reveal'>
{children} {children}
</div> </div>
<style jsx>
{`
.reveal {
opacity: 0;
visibility: hidden;
transform: translateY(-30px);
}
.reveal-visible {
opacity: 1;
visibility: visible;
transform: translateY(0);
transition: all 500ms ease-out 100ms;
}
`}
</style>
</>
) )
} }

View File

@ -4,7 +4,7 @@ export const SectionHeading: React.FC<SectionHeadingProps> = (props) => {
const { children, ...rest } = props const { children, ...rest } = props
return ( return (
<h2 {...rest} className='text-4xl font-semibold text-center mt-1 mb-3'> <h2 {...rest} className='mt-1 mb-3 text-center text-4xl font-semibold'>
{children} {children}
</h2> </h2>
) )

View File

@ -20,11 +20,11 @@ export const Section: React.FC<SectionProps> = (props) => {
if (isMain) { if (isMain) {
return ( return (
<div className='px-3 w-full'> <div className='w-full px-3'>
<ShadowContainer style={{ marginTop: 50 }}> <ShadowContainer style={{ marginTop: 50 }}>
<section {...rest}> <section {...rest}>
{heading != null && <SectionHeading>{heading}</SectionHeading>} {heading != null && <SectionHeading>{heading}</SectionHeading>}
<div className='px-3 w-full'>{children}</div> <div className='w-full px-3'>{children}</div>
</section> </section>
</ShadowContainer> </ShadowContainer>
</div> </div>
@ -35,7 +35,7 @@ export const Section: React.FC<SectionProps> = (props) => {
return ( return (
<section {...rest}> <section {...rest}>
{heading != null && <SectionHeading>{heading}</SectionHeading>} {heading != null && <SectionHeading>{heading}</SectionHeading>}
<div className='px-3 w-full'>{children}</div> <div className='w-full px-3'>{children}</div>
</section> </section>
) )
} }
@ -52,9 +52,9 @@ export const Section: React.FC<SectionProps> = (props) => {
{description} {description}
</p> </p>
)} )}
<div className='px-3 w-full'> <div className='w-full px-3'>
<ShadowContainer> <ShadowContainer>
<div className='px-16 py-4 leading-8 w-full'>{children}</div> <div className='w-full px-16 py-4 leading-8'>{children}</div>
</ShadowContainer> </ShadowContainer>
</div> </div>
</section> </section>

View File

@ -6,27 +6,14 @@ export const ShadowContainer: React.FC<ShadowContainerProps> = (props) => {
const { children, className, ...rest } = props const { children, className, ...rest } = props
return ( return (
<>
<div <div
className={classNames( className={classNames(
'shadow-container h-full max-w-full break-words', 'mb-12 h-full max-w-full break-words rounded-2xl border border-solid border-[#000] shadow-light dark:shadow-dark ',
className className
)} )}
{...rest} {...rest}
> >
{children} {children}
</div> </div>
<style jsx>
{`
.shadow-container {
box-shadow: 0px 0px 6px 6px rgba(0, 0, 0, 0.25);
border: 1px solid black;
border-radius: 1rem;
margin-bottom: 50px;
}
`}
</style>
</>
) )
} }

8
cypress.json Normal file
View File

@ -0,0 +1,8 @@
{
"baseUrl": "http://localhost:3000",
"pluginsFile": false,
"supportFile": false,
"fixturesFolder": false,
"video": false,
"screenshotOnRunFailure": false
}

View File

@ -0,0 +1,58 @@
describe('Common > Header', () => {
beforeEach(() => cy.visit('/'))
it('should redirect to /blog on click of the blog link', () => {
cy.get('[data-cy=header-blog-link]')
.click()
.location('pathname')
.should('eq', '/blog')
})
it('should always be visible (sticky header)', () => {
cy.scrollTo('bottom').get('header').should('be.visible')
})
describe('Switch theme color (dark/light)', () => {
it('should switch theme from `dark` (default) to `light`', () => {
cy.get('[data-cy=switch-theme-dark]').should('be.visible')
cy.get('[data-cy=switch-theme-light]').should('not.be.visible')
cy.get('body').should(
'not.have.css',
'background-color',
'rgb(255, 255, 255)'
)
cy.get('[data-cy=switch-theme-click]').click()
cy.get('[data-cy=switch-theme-dark]').should('not.be.visible')
cy.get('[data-cy=switch-theme-light]').should('be.visible')
cy.get('body').should(
'have.css',
'background-color',
'rgb(255, 255, 255)'
)
})
})
describe('Switch Language', () => {
it('should switch language from EN (default) to FR', () => {
cy.get('h1').contains('I am Divlo')
cy.get('[data-cy=language-flag-text]').contains('EN')
cy.get('[data-cy=languages-list]').should('not.be.visible')
cy.get('[data-cy=language-click]').click()
cy.get('[data-cy=languages-list]').should('be.visible')
cy.get('[data-cy=languages-list] > li:first-child').contains('FR').click()
cy.get('[data-cy=languages-list]').should('not.be.visible')
cy.get('[data-cy=language-flag-text]').contains('FR')
cy.get('h1').contains('Je suis Divlo')
})
it('should close the language list menu when clicking outside', () => {
cy.get('[data-cy=languages-list]').should('not.be.visible')
cy.get('[data-cy=language-click]').click()
cy.get('[data-cy=languages-list]').should('be.visible')
cy.get('h1').click()
cy.get('[data-cy=languages-list]').should('not.be.visible')
})
})
})

View File

@ -0,0 +1,7 @@
describe('Page /404', () => {
beforeEach(() => cy.visit('/404', { failOnStatusCode: false }))
it('should display the statusCode of 404', () => {
cy.get('[data-cy=status-code]').contains('404')
})
})

View File

@ -0,0 +1,7 @@
describe('Page /500', () => {
beforeEach(() => cy.visit('/500', { failOnStatusCode: false }))
it('should display the statusCode of 500', () => {
cy.get('[data-cy=status-code]').contains('500')
})
})

View File

@ -0,0 +1,13 @@
describe('Page /blog/[slug]', () => {
it('should displays the first blog post (`hello-world`)', () => {
cy.visit('/blog/hello-world')
cy.get('[data-cy=language-flag-text]').should('not.exist')
cy.get('h1').should('have.text', '👋 Hello, world!')
cy.get('.prose a').should('have.attr', 'target', '_blank')
})
it("should redirect to /404 if the blog post doesn't exist", () => {
cy.visit('/blog/random-blog-post-not-found', { failOnStatusCode: false })
cy.get('[data-cy=status-code]').contains('404')
})
})

View File

@ -0,0 +1,22 @@
describe('Page /blog', () => {
it('should displays the blog posts sorted from newest to oldest', () => {
cy.visit('/blog')
cy.get('[data-cy=blog-posts] [data-cy=blog-post-title]')
.last()
.should('have.text', '👋 Hello, world!')
cy.get('[data-cy=blog-posts] [data-cy=blog-post-description]')
.last()
.should(
'have.text',
'First post of the blog, introduction and explanation of how this blog is made.'
)
})
it('should redirect the user to the right blog post', () => {
cy.visit('/blog')
cy.get('[data-cy=hello-world]')
.click()
.location('pathname')
.should('eq', '/blog/hello-world')
})
})

View File

@ -0,0 +1,19 @@
describe('Page /', () => {
beforeEach(() => cy.visit('/'))
it('should reveals the sections while scrolling except the about section', () => {
const sectionsReveals = [
'#interests',
'#skills',
'#portfolio',
'#open-source'
]
cy.get('#about').should('be.visible')
for (const section of sectionsReveals) {
cy.get(section)
.should('not.be.visible')
.scrollIntoView()
.should('be.visible')
}
})
})

9
cypress/tsconfig.json Normal file
View File

@ -0,0 +1,9 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"noEmit": true,
"types": ["cypress"],
"isolatedModules": false
},
"include": ["../node_modules/cypress", "./**/*.ts"]
}

View File

@ -1,16 +1,14 @@
module.exports = { const nextJest = require('next/jest')
roots: ['<rootDir>'],
transform: { const createJestConfig = nextJest()
'^.+\\.(js|jsx|ts|tsx)$': 'babel-jest' const customJestConfig = {
},
moduleDirectories: ['node_modules', './'], moduleDirectories: ['node_modules', './'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], modulePathIgnorePatterns: ['<rootDir>/cypress'],
testEnvironment: 'jsdom', testEnvironment: 'jsdom',
setupFilesAfterEnv: [ setupFilesAfterEnv: [
'@testing-library/jest-dom/extend-expect', '@testing-library/jest-dom/extend-expect',
'@testing-library/react' '@testing-library/react'
], ]
collectCoverage: true,
coverageDirectory: './coverage',
coverageReporters: ['text', 'cobertura']
} }
module.exports = createJestConfig(customJestConfig)

4
jsonresume-theme-custom/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
node_modules
theme/index.html
dist
.parcel-cache

View File

@ -0,0 +1,28 @@
import fs from 'fs'
import { fileURLToPath } from 'url'
import ejs from 'ejs'
import date from 'date-and-time'
import { Parcel } from '@parcel/core'
export const render = async (resume) => {
const themeIndexURL = new URL('./theme/index.ejs', import.meta.url)
const themeBuildURL = new URL('./theme/index.html', import.meta.url)
const indexHTMLURL = new URL('./dist/index.html', import.meta.url)
const themeBuildPath = fileURLToPath(themeBuildURL)
const html = await ejs.renderFile(fileURLToPath(themeIndexURL), {
date,
locals: {
...resume
}
})
await fs.promises.writeFile(themeBuildURL, html, { encoding: 'utf-8' })
const bundler = new Parcel({
entries: themeBuildPath,
source: themeBuildPath,
mode: 'production',
defaultConfig: '@parcel/config-default'
})
await bundler.run()
return await fs.promises.readFile(indexHTMLURL, { encoding: 'utf-8' })
}

4100
jsonresume-theme-custom/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,19 @@
{
"name": "jsonresume-theme-custom",
"private": true,
"version": "1.0.0",
"type": "module",
"scripts": {},
"dependencies": {
"date-and-time": "2.3.0",
"ejs": "3.1.6",
"modern-normalize": "1.1.0"
},
"devDependencies": {
"@parcel/config-default": "2.4.0",
"@parcel/core": "2.4.0",
"@parcel/optimizer-data-url": "2.4.0",
"@parcel/transformer-inline-string": "2.4.0",
"parcel": "2.4.0"
}
}

View File

@ -0,0 +1,18 @@
import fs from 'fs'
import { render } from '../index.js'
const jsonResumeURL = new URL('../../resume.json', import.meta.url)
const publicResumeURL = new URL(
'../../public/curriculum-vitae.html',
import.meta.url
)
const dataResumeStringJSON = await fs.promises.readFile(jsonResumeURL, {
encoding: 'utf-8'
})
const dataResumeJSON = JSON.parse(dataResumeStringJSON)
const dataResumeIndexHTML = await render(dataResumeJSON)
await fs.promises.writeFile(publicResumeURL, dataResumeIndexHTML, {
encoding: 'utf-8'
})

View File

@ -0,0 +1,2 @@
<!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M243.4 2.587C251.4-.8625 260.6-.8625 268.6 2.587L492.6 98.59C506.6 104.6 514.4 119.6 511.3 134.4C508.3 149.3 495.2 159.1 479.1 160V168C479.1 181.3 469.3 192 455.1 192H55.1C42.74 192 31.1 181.3 31.1 168V160C16.81 159.1 3.708 149.3 .6528 134.4C-2.402 119.6 5.429 104.6 19.39 98.59L243.4 2.587zM256 128C273.7 128 288 113.7 288 96C288 78.33 273.7 64 256 64C238.3 64 224 78.33 224 96C224 113.7 238.3 128 256 128zM127.1 416H167.1V224H231.1V416H280V224H344V416H384V224H448V420.3C448.6 420.6 449.2 420.1 449.8 421.4L497.8 453.4C509.5 461.2 514.7 475.8 510.6 489.3C506.5 502.8 494.1 512 480 512H31.1C17.9 512 5.458 502.8 1.372 489.3C-2.715 475.8 2.515 461.2 14.25 453.4L62.25 421.4C62.82 420.1 63.41 420.6 63.1 420.3V224H127.1V416z"/></svg>

After

Width:  |  Height:  |  Size: 1015 B

View File

@ -0,0 +1,2 @@
<!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path d="M623.1 136.9l-282.7-101.2c-13.73-4.91-28.7-4.91-42.43 0L16.05 136.9C6.438 140.4 0 149.6 0 160s6.438 19.65 16.05 23.09L76.07 204.6c-11.89 15.8-20.26 34.16-24.55 53.95C40.05 263.4 32 274.8 32 288c0 9.953 4.814 18.49 11.94 24.36l-24.83 149C17.48 471.1 25 480 34.89 480H93.11c9.887 0 17.41-8.879 15.78-18.63l-24.83-149C91.19 306.5 96 297.1 96 288c0-10.29-5.174-19.03-12.72-24.89c4.252-17.76 12.88-33.82 24.94-47.03l190.6 68.23c13.73 4.91 28.7 4.91 42.43 0l282.7-101.2C633.6 179.6 640 170.4 640 160S633.6 140.4 623.1 136.9zM351.1 314.4C341.7 318.1 330.9 320 320 320c-10.92 0-21.69-1.867-32-5.555L142.8 262.5L128 405.3C128 446.6 213.1 480 320 480c105.1 0 192-33.4 192-74.67l-14.78-142.9L351.1 314.4z"/></svg>

After

Width:  |  Height:  |  Size: 986 B

View File

@ -0,0 +1,2 @@
<!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M0 190.9V185.1C0 115.2 50.52 55.58 119.4 44.1C164.1 36.51 211.4 51.37 244 84.02L256 96L267.1 84.02C300.6 51.37 347 36.51 392.6 44.1C461.5 55.58 512 115.2 512 185.1V190.9C512 232.4 494.8 272.1 464.4 300.4L283.7 469.1C276.2 476.1 266.3 480 256 480C245.7 480 235.8 476.1 228.3 469.1L47.59 300.4C17.23 272.1 .0003 232.4 .0003 190.9L0 190.9z"/></svg>

After

Width:  |  Height:  |  Size: 629 B

View File

@ -0,0 +1,2 @@
<!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M502.6 182.6l-45.25-45.25C451.4 131.4 443.3 128 434.8 128H384V80C384 53.5 362.5 32 336 32h-160C149.5 32 128 53.5 128 80V128H77.25c-8.5 0-16.62 3.375-22.62 9.375L9.375 182.6C3.375 188.6 0 196.8 0 205.3V304h128v-32C128 263.1 135.1 256 144 256h32C184.9 256 192 263.1 192 272v32h128v-32C320 263.1 327.1 256 336 256h32C376.9 256 384 263.1 384 272v32h128V205.3C512 196.8 508.6 188.6 502.6 182.6zM336 128h-160V80h160V128zM384 368c0 8.875-7.125 16-16 16h-32c-8.875 0-16-7.125-16-16v-32H192v32C192 376.9 184.9 384 176 384h-32C135.1 384 128 376.9 128 368v-32H0V448c0 17.62 14.38 32 32 32h448c17.62 0 32-14.38 32-32v-112h-128V368z"/></svg>

After

Width:  |  Height:  |  Size: 912 B

View File

@ -0,0 +1,2 @@
<!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M224 256c70.7 0 128-57.31 128-128s-57.3-128-128-128C153.3 0 96 57.31 96 128S153.3 256 224 256zM274.7 304H173.3C77.61 304 0 381.6 0 477.3c0 19.14 15.52 34.67 34.66 34.67h378.7C432.5 512 448 496.5 448 477.3C448 381.6 370.4 304 274.7 304z"/></svg>

After

Width:  |  Height:  |  Size: 528 B

View File

@ -0,0 +1,206 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><%= locals.basics.name %></title>
<link rel="icon" type="image/png" href="<%= locals.basics.image %>" />
<style>
@import './styles/global.css';
</style>
</head>
<body>
<div class="container-fluid">
<div class="row main clearfix">
<section class="col-md-3 card-wrapper profile-card-wrapper affix">
<div class="card profile-card">
<div class="profile-pic-container">
<div class="profile-pic">
<img
class="media-object img-circle center-block"
data-src="holder.js/100x100"
alt="<%= locals.basics.name %>"
src="<%= locals.basics.image %>"
/>
</div>
<div class="name-and-profession text-center">
<h3>
<strong><%= locals.basics.name %></strong>
</h3>
<h5 class="text-muted"><%= locals.basics.label %></h5>
</div>
</div>
<div class="contact-details clearfix">
<div class="detail">
<span class="info"><%= locals.basics.phone %></span>
</div>
<div class="detail">
<span class="info">
<a
class="link-disguise"
href="mailto:<%= locals.basics.email %>"
>
<%= locals.basics.email %>
</a>
</span>
</div>
<div class="detail">
<span class="info">
<a class="link-disguise" href="<%= locals.basics.url %>">
<%= locals.basics.url %>
</a>
</span>
</div>
</div>
<hr />
</div>
<div class="card background-card">
<div class="background-details">
<div class="detail" id="about">
<div class="icon">
<img src="data-url:./images/user.svg" alt="user" />
</div>
<div class="info">
<h4 class="title text-uppercase">À propos</h4>
<div class="card card-nested">
<div class="content mop-wrapper">
<p><%- locals.basics.summary %></p>
</div>
</div>
</div>
</div>
<hr />
<div class="detail" id="work-experience">
<div class="icon">
<img
src="data-url:./images/building-columns.svg"
alt="work"
/>
</div>
<div class="info">
<h4 class="title text-uppercase">Expériences</h4>
<ul class="list-unstyled clear-margin">
<% locals.work.forEach((experience) => { %>
<li class="card card-nested clearfix">
<div class="content">
<p class="clear-margin relative">
<a href="<%= experience.website %>">
<strong><%= experience.name %></strong>
</a>
</p>
<p class="clear-margin relative">
<strong><%- experience.position %></strong>
</p>
<p class="text-muted">
<small>
<span class="space-right">
<%= date.format(new Date(experience.startDate),
'DD/MM/YYYY') %> - <%= date.format(new
Date(experience.endDate), 'DD/MM/YYYY') %>
</span>
</small>
</p>
<div class="experience-description">
<p><%- experience.summary %></p>
</div>
</div>
</li>
<% }) %>
</ul>
</div>
</div>
<hr />
<div class="detail" id="skills">
<div class="icon">
<img src="data-url:./images/toolbox.svg" alt="toolbox" />
</div>
<div class="info">
<h4 class="title text-uppercase">Compétences</h4>
<div class="content">
<ul class="list-unstyled clear-margin">
<% locals.skills.forEach((skill) => { %>
<li class="card card-nested card-skills">
<div class="skill-info">
<strong><%= skill.name %></strong>
<div class="space-top labels">
<% skill.keywords.forEach((keyword) => { %>
<p class="label label-keyword"><%= keyword %></p>
<% }) %>
</div>
</div>
</li>
<% }) %>
</ul>
</div>
</div>
</div>
<hr />
<div class="detail" id="education">
<div class="icon">
<img
src="data-url:./images/graduation-cap.svg"
alt="graduation"
/>
</div>
<div class="info">
<h4 class="title text-uppercase">Éducation</h4>
<div class="content">
<ul class="list-unstyled clear-margin">
<% locals.education.forEach((degree) => { %>
<li class="card card-nested">
<div class="content">
<p class="clear-margin relative">
<strong><%= degree.studyType %></strong>
</p>
<p class="clear-margin relative">
<strong><%= degree.score %></strong>
</p>
<p class="text-muted clear-margin">
<%= degree.institution %>
</p>
<p class="text-muted clear-margin">
<small>
<%= degree.startDate %> - <%= degree.endDate %>
</small>
</p>
</div>
</li>
<% }) %>
</ul>
</div>
</div>
</div>
<hr />
<div class="detail" id="interests">
<div class="icon">
<img src="data-url:./images/heart.svg" alt="heart" />
</div>
<div class="info">
<h4 class="title text-uppercase">Intérets</h4>
<div class="content">
<ul class="list-unstyled clear-margin">
<% locals.interests.forEach((interest) => { %>
<li class="card card-nested">
<p><strong><%= interest.name %></strong></p>
</li>
<% }) %>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,229 @@
@import 'npm:modern-normalize/modern-normalize.css';
body {
font-family: 'Montserrat', 'Arial', 'sans-serif';
background: #f0f0f0;
color: #333;
line-height: 1.42857143;
font-size: 14px;
}
hr {
margin-top: 15px;
margin-bottom: 15px;
border: 0;
border-top: 1px solid #eee;
}
p {
margin: 0;
}
strong {
font-weight: 600;
}
a {
color: #337ab7;
text-decoration: none;
}
a:focus,
a:hover {
color: #23527c;
text-decoration: underline;
}
.link-disguise {
color: inherit;
}
.link-disguise:hover {
color: inherit;
}
.h1,
.h2,
.h3,
h1,
h2,
h3 {
margin-top: 20px;
margin-bottom: 10px;
}
.h4,
.h5,
.h6,
h4,
h5,
h6 {
margin-top: 10px;
margin-bottom: 10px;
}
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: inherit;
font-weight: 500;
line-height: 1.1;
color: inherit;
}
.h3,
h3 {
font-size: 24px;
}
.h4,
h4 {
font-size: 18px;
}
.h5,
h5 {
font-size: 14px;
}
.container-fluid {
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
}
.row {
margin-right: -15px;
margin-left: -15px;
}
.clear-margin {
margin: 0;
}
.relative {
position: relative;
}
.center-block {
display: block;
margin-right: auto;
margin-left: auto;
}
.text-center {
text-align: center;
}
.text-muted {
color: #777;
}
.text-uppercase {
text-transform: uppercase;
}
.list-unstyled {
padding-left: 0;
list-style: none;
}
.main {
padding: 5px;
}
.title {
font-weight: 600;
}
.profile-card-wrapper {
position: relative;
}
.card-wrapper {
float: none !important;
padding: 5px;
}
.profile-card-wrapper .profile-card {
padding: 10px;
}
.card {
background: white;
border-radius: 3px;
padding: 10px 0;
}
.profile-pic {
padding: 10px 0;
}
.profile-pic img {
width: 100px;
height: 100px;
border-radius: 50%;
vertical-align: middle;
border: 0;
}
.contact-details {
display: flex;
justify-content: center;
}
.contact-details .detail {
position: relative;
min-height: 1px;
padding: 10px;
}
.social-links {
line-height: 2.5;
}
.experience-description {
margin-top: 10px;
}
.background-details .detail {
display: table;
}
.background-details .detail .icon,
.background-details .detail .info {
display: table-cell;
}
.background-details .detail .icon {
color: #707070;
}
.background-details .detail .icon {
min-width: 45px;
max-width: 45px;
text-align: center;
}
.icon img {
width: 20px;
height: 20px;
}
.background-details .detail .mobile-title {
display: none;
}
.card-nested {
min-height: 0;
border-width: 1px 0 0 0;
}
.card-skills {
position: relative;
}
.labels {
line-height: 2;
}
.space-top {
margin-top: 10px;
}
.label {
display: inline;
padding: 0.2em 0.6em 0.3em;
font-size: 75%;
font-weight: 600;
line-height: 1;
color: #fff;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: 0.25em;
}
.label-keyword {
display: inline-block;
background: #7eb0db;
color: white;
font-size: 0.9em;
padding: 5px;
border: 1px solid #357ebd;
margin-right: 5px;
}
.label-keyword p {
margin: 0;
}

View File

@ -1,6 +1,6 @@
{ {
"english": "English", "english": "English",
"french": "French", "french": "French",
"allRightsReserved": "All rights reserved", "all-rights-reserved": "All rights reserved",
"home": "Home" "home": "Home"
} }

View File

@ -1,6 +1,6 @@
{ {
"returnToHomePage": "Return to the home page?", "return-to-home-page": "Return to the home page?",
"error": "Error", "error": "Error",
"serverError": "Internal Server Error!", "server-error": "Internal Server Error!",
"notFound": "This page doesn't exist!" "not-found": "This page doesn't exist!"
} }

View File

@ -1,24 +1,26 @@
{ {
"about": { "about": {
"IAm": "I am", "i-am": "I am",
"description": "Developer Full Stack Junior • Passionate about High-Tech", "description": "Developer Full Stack Junior • Passionate about High-Tech",
"birthDate": "Birth date", "full-name": "Full name",
"birth-date": "Birth date",
"years-old": "years old",
"nationality": "Nationality", "nationality": "Nationality",
"descriptionBottom": "I am self-taught in Computer Science by following online trainings. <0/> <0/> I put into practice everything I learn and make many projects." "description-bottom": "I am self-taught in Computer Science by following online trainings and I am also a student at the university following the French training \"BUT Informatique\" (first year)."
}, },
"interests": { "interests": {
"title": "Interests", "title": "Interests",
"paragraphs": [ "paragraphs": [
{ {
"title": "Developer Full Stack Junior :", "title": "Developer Full Stack Junior",
"description": "Computer programming is my main hobby, I love it! <br/> Mostly web development for the moment but I'm programming some Python and others programming language too." "description": "Computer programming is my main hobby, I love it! <br/> Mostly web development for the moment but I'm programming in others programming language too."
}, },
{ {
"title": "Passionate about High-Tech :", "title": "Passionate about High-Tech",
"description": "I always wondered how the future would be. Every day I want to wake up and think that the future will be great and better than the past. Technologies improve gradually over time, which is very useful in many areas." "description": "I always wondered how the future would be. Every day I want to wake up and think that the future will be great and better than the past. Technologies improve gradually over time, which is very useful in many areas."
}, },
{ {
"title": "Open-Source enthusiast :", "title": "Open-Source enthusiast",
"description": "For me, everyone should work, solve problems, build things and think together. Long live open source, whenever you can share your work, do it! <br/> The website is open-source on <a class='text-yellow dark:text-yellow-dark hover:underline' href='https://github.com/Divlo/Divlo' target='_blank' rel='noopener noreferrer'>github</a>." "description": "For me, everyone should work, solve problems, build things and think together. Long live open source, whenever you can share your work, do it! <br/> The website is open-source on <a class='text-yellow dark:text-yellow-dark hover:underline' href='https://github.com/Divlo/Divlo' target='_blank' rel='noopener noreferrer'>github</a>."
} }
] ]
@ -26,7 +28,7 @@
"skills": { "skills": {
"title": "Skills", "title": "Skills",
"languages": "Programming languages", "languages": "Programming languages",
"softwareTools": "Software and tools" "software-tools": "Software and tools"
}, },
"portfolio": { "portfolio": {
"title": "Portfolio", "title": "Portfolio",

View File

@ -1,6 +1,6 @@
{ {
"english": "Anglais", "english": "Anglais",
"french": "Français", "french": "Français",
"allRightsReserved": "Tous droits réservés", "all-rights-reserved": "Tous droits réservés",
"home": "Accueil" "home": "Accueil"
} }

View File

@ -1,6 +1,6 @@
{ {
"returnToHomePage": "Revenir à la page d'accueil ?", "return-to-home-page": "Revenir à la page d'accueil ?",
"error": "Erreur", "error": "Erreur",
"serverError": "Erreur Interne du Serveur !", "server-error": "Erreur Interne du Serveur !",
"notFound": "Cette page n'existe pas!" "not-found": "Cette page n'existe pas!"
} }

View File

@ -1,24 +1,26 @@
{ {
"about": { "about": {
"IAm": "Je suis", "i-am": "Je suis",
"description": "Développeur Full Stack Junior • Passionné de High-Tech", "description": "Développeur Full Stack Junior • Passionné de High-Tech",
"birthDate": "Date de naissance", "full-name": "Prénom NOM",
"birth-date": "Date de naissance",
"years-old": "ans",
"nationality": "Nationalité", "nationality": "Nationalité",
"descriptionBottom": "Je me forme en autodidacte dans l'informatique en suivant des formations en ligne. <0/> <0/> Je mets en pratique tout ce que j'apprends et réalise de nombreux projets." "description-bottom": "Je me forme en autodidacte dans l'informatique en suivant des formations en ligne et je suis aussi un étudiant à l'université suivant la formation \"BUT Informatique\" (première année)."
}, },
"interests": { "interests": {
"title": "Intérêts", "title": "Intérêts",
"paragraphs": [ "paragraphs": [
{ {
"title": "Développeur Full Stack Junior :", "title": "Développeur Full Stack Junior",
"description": "La programmation informatique est mon loisir principal, j'adore! <br/> Principalement du développement Web pour le moment, mais je programme aussi du Python et d'autres langages de programmation." "description": "La programmation informatique est mon loisir principal, j'adore! <br/> Principalement du développement Web pour le moment, mais je programme aussi dans d'autres langages de programmation."
}, },
{ {
"title": "Passionné de High-Tech :", "title": "Passionné de High-Tech",
"description": "Je me suis toujours demandé comment l'avenir serait. Chaque jour, je veux me réveiller et penser que l'avenir sera formidable et meilleur que le passé. Les technolgies s'améliorent progressivement avec le temps, ce qui est très utile dans de nombreux domaines." "description": "Je me suis toujours demandé comment l'avenir serait. Chaque jour, je veux me réveiller et penser que l'avenir sera formidable et meilleur que le passé. Les technolgies s'améliorent progressivement avec le temps, ce qui est très utile dans de nombreux domaines."
}, },
{ {
"title": "Enthousiaste de l'Open-Source :", "title": "Enthousiaste de l'Open-Source",
"description": "Pour moi, tout le monde devrait travailler, résoudre des problèmes, construire des choses et réfléchir ensemble. Longue vie à l'open-source, chaque fois que vous pouvez partagez votre travail, faites-le! <br/> Le site est open-source sur <a class='text-yellow dark:text-yellow-dark hover:underline' href='https://github.com/Divlo/Divlo' target='_blank' rel='noopener noreferrer'>github</a>." "description": "Pour moi, tout le monde devrait travailler, résoudre des problèmes, construire des choses et réfléchir ensemble. Longue vie à l'open-source, chaque fois que vous pouvez partagez votre travail, faites-le! <br/> Le site est open-source sur <a class='text-yellow dark:text-yellow-dark hover:underline' href='https://github.com/Divlo/Divlo' target='_blank' rel='noopener noreferrer'>github</a>."
} }
] ]
@ -26,7 +28,7 @@
"skills": { "skills": {
"title": "Compétences", "title": "Compétences",
"languages": "Langages de programmation", "languages": "Langages de programmation",
"softwareTools": "Logiciels et outils" "software-tools": "Logiciels et outils"
}, },
"portfolio": { "portfolio": {
"title": "Portfolio", "title": "Portfolio",
@ -39,7 +41,7 @@
}, },
{ {
"title": "thream.divlo.fr", "title": "thream.divlo.fr",
"description": "Votre plateforme open source pour rester proche de vos amis et communautés, parler, discuter, collaborer, partager et vous amuser.", "description": "Votre plateforme open source pour rester proche de vos amis et communautés, parler, discuter, collaborer, partager et amusez-vous.",
"link": "https://thream.divlo.fr/", "link": "https://thream.divlo.fr/",
"image": "/images/portfolio/threamdivlofr.png" "image": "/images/portfolio/threamdivlofr.png"
}, },

4
next-env.d.ts vendored
View File

@ -1,3 +1,5 @@
/// <reference types="next" /> /// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" /> /// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.

View File

@ -1,11 +1,41 @@
const nextPWA = require('next-pwa') const nextPWA = require('next-pwa')
const nextTranslate = require('next-translate') const nextTranslate = require('next-translate')
const { createSecureHeaders } = require('next-secure-headers')
/** @type {import("next").NextConfig} */
module.exports = nextTranslate( module.exports = nextTranslate(
nextPWA({ nextPWA({
reactStrictMode: true,
pwa: { pwa: {
disable: process.env.NODE_ENV !== 'production', disable: process.env.NODE_ENV !== 'production',
dest: 'public' dest: 'public'
},
headers() {
return [
{
source: '/:path*',
headers: createSecureHeaders({
contentSecurityPolicy: {
directives: {
defaultSrc: ["'self'"],
scriptSrc: [
"'self'",
'data:',
"'unsafe-eval'",
"'unsafe-inline'"
],
styleSrc: ["'self'", "'unsafe-inline'"],
imgSrc: ['*', 'data:', 'blob:'],
mediaSrc: "'none'",
connectSrc: '*',
objectSrc: "'none'",
fontSrc: "'self'",
baseURI: "'none'"
}
}
})
}
]
} }
}) })
) )

38472
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "divlo", "name": "divlo",
"version": "1.3.2", "version": "2.2.0",
"private": true, "private": true,
"repository": { "repository": {
"type": "git", "type": "git",
@ -13,70 +13,90 @@
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",
"start": "next start", "start": "next start",
"build": "next build", "build": "npm run resume:build && next build",
"export": "next export", "export": "next export",
"lint:commit": "commitlint", "lint:commit": "commitlint",
"lint:docker": "dockerfilelint './Dockerfile'",
"lint:editorconfig": "editorconfig-checker", "lint:editorconfig": "editorconfig-checker",
"lint:markdown": "markdownlint '**/*.md' --dot --ignore node_modules", "lint:markdown": "markdownlint \"**/*.{md,mdx}\" --dot --ignore-path \".gitignore\"",
"lint:typescript": "eslint '**/*.{js,ts,jsx,tsx}'", "lint:typescript": "eslint \"**/*.{js,jsx,ts,tsx}\"",
"lint:prettier": "prettier \".\" --check",
"lint:staged": "lint-staged", "lint:staged": "lint-staged",
"lighthouse": "lhci autorun", "test:unit": "jest",
"test": "jest", "test:html-w3c-validator": "start-server-and-test \"start\" \"http://localhost:3000\" \"html-w3c-validator\"",
"test:lighthouse": "lhci autorun",
"test:e2e": "start-server-and-test \"start\" \"http://localhost:3000\" \"cypress run\"",
"test:e2e:dev": "start-server-and-test \"dev\" \"http://localhost:3000\" \"cypress open\"",
"resume:build": "node ./jsonresume-theme-custom/scripts/build.js",
"release": "semantic-release", "release": "semantic-release",
"deploy": "vercel", "deploy": "vercel",
"postinstall": "husky install" "postinstall": "husky install"
}, },
"dependencies": { "dependencies": {
"@fontsource/montserrat": "4.5.0", "@fontsource/montserrat": "4.5.7",
"@fortawesome/fontawesome-svg-core": "1.2.35", "@fortawesome/fontawesome-svg-core": "6.1.1",
"@fortawesome/free-brands-svg-icons": "5.15.3", "@fortawesome/free-brands-svg-icons": "6.1.1",
"@fortawesome/free-solid-svg-icons": "5.15.3", "@fortawesome/free-solid-svg-icons": "6.1.1",
"@fortawesome/react-fontawesome": "0.1.14", "@fortawesome/react-fontawesome": "0.1.18",
"classnames": "2.3.1", "classnames": "2.3.1",
"html-react-parser": "1.2.7", "date-and-time": "2.3.0",
"next": "11.0.1", "gray-matter": "4.0.3",
"next-pwa": "5.2.24", "html-react-parser": "1.4.9",
"next-themes": "0.0.15", "next": "12.1.0",
"next-translate": "1.0.7", "next-mdx-remote": "4.0.0",
"next-pwa": "5.4.6",
"next-themes": "0.1.1",
"next-translate": "1.3.5",
"react": "17.0.2", "react": "17.0.2",
"react-dom": "17.0.2", "react-dom": "17.0.2",
"read-pkg": "5.2.0", "read-pkg": "7.1.0",
"rehype-raw": "6.1.1",
"rehype-slug": "5.0.1",
"remark-gfm": "3.0.1",
"sharp": "0.30.3",
"shiki": "0.10.1",
"unified": "10.1.2",
"unist-util-visit": "4.1.0",
"universal-cookie": "4.0.4" "universal-cookie": "4.0.4"
}, },
"devDependencies": { "devDependencies": {
"@commitlint/cli": "13.1.0", "@commitlint/cli": "16.2.3",
"@commitlint/config-conventional": "13.1.0", "@commitlint/config-conventional": "16.2.1",
"@lhci/cli": "0.8.0", "@lhci/cli": "0.9.0",
"@semantic-release/git": "9.0.0", "@saithodev/semantic-release-backmerge": "2.1.2",
"@testing-library/jest-dom": "5.14.1", "@semantic-release/git": "10.0.1",
"@testing-library/react": "12.0.0", "@tailwindcss/typography": "0.5.2",
"@types/jest": "26.0.24", "@testing-library/jest-dom": "5.16.2",
"@types/node": "16.4.3", "@testing-library/react": "12.1.4",
"@types/react": "17.0.15", "@types/jest": "27.4.1",
"@types/styled-jsx": "2.2.9", "@types/node": "17.0.23",
"@typescript-eslint/eslint-plugin": "4.28.5", "@types/react": "17.0.42",
"autoprefixer": "10.3.1", "@types/unist": "2.0.6",
"babel-jest": "27.0.6", "@typescript-eslint/eslint-plugin": "5.16.0",
"dockerfilelint": "1.8.0", "autoprefixer": "10.4.4",
"cypress": "9.5.2",
"editorconfig-checker": "4.0.2", "editorconfig-checker": "4.0.2",
"eslint": "7.31.0", "eslint": "8.11.0",
"eslint-config-next": "11.0.1", "eslint-config-conventions": "1.1.2",
"eslint-config-prettier": "8.3.0", "eslint-config-next": "12.1.0",
"eslint-config-standard-with-typescript": "20.0.0", "eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.23.4", "eslint-plugin-import": "2.25.4",
"eslint-plugin-node": "11.1.0", "eslint-plugin-prettier": "4.0.0",
"eslint-plugin-prettier": "3.4.0", "eslint-plugin-promise": "6.0.0",
"eslint-plugin-promise": "5.1.0", "eslint-plugin-unicorn": "41.0.1",
"husky": "7.0.1", "html-w3c-validator": "1.1.0",
"jest": "27.0.6", "husky": "7.0.4",
"lint-staged": "11.1.1", "jest": "27.5.1",
"markdownlint-cli": "0.28.1", "jsonresume-theme-custom": "file:./jsonresume-theme-custom",
"postcss": "8.3.6", "lint-staged": "12.3.7",
"prettier": "2.3.2", "markdownlint-cli": "0.31.1",
"semantic-release": "17.4.4", "next-secure-headers": "2.2.0",
"tailwindcss": "2.2.7", "postcss": "8.4.12",
"typescript": "4.3.5", "prettier": "2.6.0",
"vercel": "23.0.1" "prettier-plugin-tailwindcss": "0.1.8",
"semantic-release": "19.0.2",
"start-server-and-test": "1.14.0",
"tailwindcss": "3.0.23",
"typescript": "4.6.2",
"vercel": "24.0.1"
} }
} }

View File

@ -1,23 +1,28 @@
import { GetStaticProps } from 'next' import { GetStaticProps, NextPage } from 'next'
import useTranslation from 'next-translate/useTranslation' import useTranslation from 'next-translate/useTranslation'
import readPackageJSON from 'read-pkg'
import { ErrorPage } from 'components/ErrorPage' import { ErrorPage } from 'components/ErrorPage'
import { Head } from 'components/Head' import { Head } from 'components/Head'
import { Header } from 'components/Header' import { Header } from 'components/Header'
import { Footer, FooterProps } from 'components/Footer' import { Footer, FooterProps } from 'components/Footer'
import { getDefaultDescription } from 'utils/getDefaultDescription'
import { DIVLO_BIRTHDAY, getAge } from 'utils/getAge'
const Error404: React.FC<FooterProps> = (props) => { interface Error404Props extends FooterProps {
description: string
}
const Error404: NextPage<Error404Props> = (props) => {
const { t } = useTranslation() const { t } = useTranslation()
const { version } = props const { version, description } = props
return ( return (
<> <>
<Head title='Divlo - 404' /> <Head title='404 | Divlo' description={description} />
<Header /> <Header showLanguage />
<main className='flex flex-col md:mx-auto md:max-w-4xl lg:max-w-7xl'> <main className='flex flex-col md:mx-auto md:max-w-4xl lg:max-w-7xl'>
<ErrorPage statusCode={404} message={t('errors:notFound')} /> <ErrorPage statusCode={404} message={t('errors:not-found')} />
</main> </main>
<Footer version={version} /> <Footer version={version} />
</> </>
@ -25,8 +30,11 @@ const Error404: React.FC<FooterProps> = (props) => {
} }
export const getStaticProps: GetStaticProps<FooterProps> = async () => { export const getStaticProps: GetStaticProps<FooterProps> = async () => {
const { version } = await readPackageJSON() const { readPackage } = await import('read-pkg')
return { props: { version } } const { version } = await readPackage()
const age = getAge(DIVLO_BIRTHDAY)
const description = getDefaultDescription(age)
return { props: { version, description } }
} }
export default Error404 export default Error404

View File

@ -1,23 +1,28 @@
import { GetStaticProps } from 'next' import { GetStaticProps, NextPage } from 'next'
import useTranslation from 'next-translate/useTranslation' import useTranslation from 'next-translate/useTranslation'
import readPackageJSON from 'read-pkg'
import { ErrorPage } from 'components/ErrorPage' import { ErrorPage } from 'components/ErrorPage'
import { Head } from 'components/Head' import { Head } from 'components/Head'
import { Header } from 'components/Header' import { Header } from 'components/Header'
import { Footer, FooterProps } from 'components/Footer' import { Footer, FooterProps } from 'components/Footer'
import { getDefaultDescription } from 'utils/getDefaultDescription'
import { DIVLO_BIRTHDAY, getAge } from 'utils/getAge'
const Error500: React.FC<FooterProps> = (props) => { interface Error500Props extends FooterProps {
description: string
}
const Error500: NextPage<Error500Props> = (props) => {
const { t } = useTranslation() const { t } = useTranslation()
const { version } = props const { version, description } = props
return ( return (
<> <>
<Head title='Divlo - 500' /> <Head title='500 | Divlo' description={description} />
<Header /> <Header showLanguage />
<main className='flex flex-col md:mx-auto md:max-w-4xl lg:max-w-7xl'> <main className='flex flex-col md:mx-auto md:max-w-4xl lg:max-w-7xl'>
<ErrorPage statusCode={500} message={t('errors:serverError')} /> <ErrorPage statusCode={500} message={t('errors:server-error')} />
</main> </main>
<Footer version={version} /> <Footer version={version} />
</> </>
@ -25,8 +30,11 @@ const Error500: React.FC<FooterProps> = (props) => {
} }
export const getStaticProps: GetStaticProps<FooterProps> = async () => { export const getStaticProps: GetStaticProps<FooterProps> = async () => {
const { version } = await readPackageJSON() const { readPackage } = await import('read-pkg')
return { props: { version } } const { version } = await readPackage()
const age = getAge(DIVLO_BIRTHDAY)
const description = getDefaultDescription(age)
return { props: { version, description } }
} }
export default Error500 export default Error500

View File

@ -4,18 +4,16 @@ import { ThemeProvider } from 'next-themes'
import useTranslation from 'next-translate/useTranslation' import useTranslation from 'next-translate/useTranslation'
import UniversalCookie from 'universal-cookie' import UniversalCookie from 'universal-cookie'
import 'tailwindcss/tailwind.css' import 'styles/global.css'
import '@fontsource/montserrat/400.css' import '@fontsource/montserrat/400.css'
import '@fontsource/montserrat/500.css'
import '@fontsource/montserrat/600.css' import '@fontsource/montserrat/600.css'
import '@fontsource/montserrat/700.css'
const universalCookie = new UniversalCookie() const universalCookie = new UniversalCookie()
/** how long in seconds, until the cookie expires (10 years) */ /** how long in seconds, until the cookie expires (10 years) */
const COOKIE_MAX_AGE = 10 * 365.25 * 24 * 60 * 60 const COOKIE_MAX_AGE = 10 * 365.25 * 24 * 60 * 60
const MyApp = ({ Component, pageProps }: AppProps): JSX.Element => { const Application = ({ Component, pageProps }: AppProps): JSX.Element => {
const { lang } = useTranslation() const { lang } = useTranslation()
useEffect(() => { useEffect(() => {
@ -32,4 +30,4 @@ const MyApp = ({ Component, pageProps }: AppProps): JSX.Element => {
) )
} }
export default MyApp export default Application

View File

@ -1,31 +1,15 @@
import Document, { import { Html, Head, Main, NextScript } from 'next/document'
Html,
Head,
Main,
NextScript,
DocumentContext,
DocumentInitialProps
} from 'next/document'
class MyDocument extends Document { const Document: React.FC = () => {
static async getInitialProps(
ctx: DocumentContext
): Promise<DocumentInitialProps> {
const initialProps = await Document.getInitialProps(ctx)
return initialProps
}
render(): JSX.Element {
return ( return (
<Html> <Html>
<Head /> <Head />
<body className='bg-white dark:bg-black text-black dark:text-white font-headline'> <body className='bg-white font-headline text-black dark:bg-black dark:text-white'>
<Main /> <Main />
<NextScript /> <NextScript />
</body> </body>
</Html> </Html>
) )
} }
}
export default MyDocument export default Document

83
pages/blog/[slug].tsx Normal file
View File

@ -0,0 +1,83 @@
import { GetStaticProps, GetStaticPaths, NextPage } from 'next'
import { MDXRemote } from 'next-mdx-remote'
import date from 'date-and-time'
import { Head } from 'components/Head'
import { Header } from 'components/Header'
import { Footer, FooterProps } from 'components/Footer'
import type { Post } from 'utils/blog'
interface BlogPostPageProps extends FooterProps {
post: Post
}
const BlogPostPage: NextPage<BlogPostPageProps> = (props) => {
const { version, post } = props
return (
<>
<Head
title={`${post.frontmatter.title} | Divlo`}
description={post.frontmatter.description}
/>
<Header />
<main className='flex flex-1 flex-col flex-wrap items-center'>
<div className='my-10 flex flex-col items-center'>
<h1 className='text-3xl font-semibold'>{post.frontmatter.title}</h1>
<p className='mt-2' data-cy='blog-post-date'>
{date.format(new Date(post.frontmatter.publishedOn), 'DD/MM/YYYY')}
</p>
</div>
<div className='prose mb-10 px-8'>
<MDXRemote
{...post.source}
components={{
a: (props: React.ComponentPropsWithoutRef<'a'>) => {
if (props.href?.startsWith('#') ?? false) {
return <a {...props} />
}
return (
<a target='_blank' rel='noopener noreferrer' {...props} />
)
}
}}
/>
</div>
</main>
<Footer version={version} />
</>
)
}
export const getStaticProps: GetStaticProps<BlogPostPageProps> = async (
context
) => {
const slug = context?.params?.slug
const { getPostBySlug } = await import('utils/blog')
const post = await getPostBySlug(slug)
if (post == null || (post != null && !post.frontmatter.isPublished)) {
return {
redirect: {
destination: '/404',
permanent: false
}
}
}
const { readPackage } = await import('read-pkg')
const { version } = await readPackage()
return { props: { version, post } }
}
export const getStaticPaths: GetStaticPaths = async () => {
const { getPosts } = await import('utils/blog')
const posts = await getPosts()
return {
paths: posts.map((post) => {
return { params: { slug: post.slug } }
}),
fallback: false
}
}
export default BlogPostPage

77
pages/blog/index.tsx Normal file
View File

@ -0,0 +1,77 @@
import { GetStaticProps, NextPage } from 'next'
import Link from 'next/link'
import date from 'date-and-time'
import { Head } from 'components/Head'
import { Header } from 'components/Header'
import { Footer, FooterProps } from 'components/Footer'
import { ShadowContainer } from 'components/design/ShadowContainer'
import type { PostMetadata } from 'utils/blog'
const blogDescription =
'The latest news about my journey of learning computer science.'
interface BlogPageProps extends FooterProps {
posts: PostMetadata[]
}
const BlogPage: NextPage<BlogPageProps> = (props) => {
const { version, posts } = props
return (
<>
<Head title='Blog | Divlo' description={blogDescription} />
<Header />
<main className='flex flex-1 flex-col flex-wrap items-center'>
<div className='mt-10 flex flex-col items-center'>
<h1 className='text-4xl font-semibold'>Blog</h1>
<p className='mt-6 text-center' data-cy='blog-post-date'>
{blogDescription}
</p>
</div>
<div className='flex w-full items-center justify-center p-8'>
<div className='w-[1600px]' data-cy='blog-posts'>
{posts.map((post, index) => {
const postPublishedOn = date.format(
new Date(post.frontmatter.publishedOn),
'DD/MM/YYYY'
)
return (
<Link href={`/blog/${post.slug}`} key={index} locale='en'>
<a data-cy={post.slug}>
<ShadowContainer className='cursor-pointer p-6 transition duration-200 ease-in-out hover:-translate-y-2'>
<h2
data-cy='blog-post-title'
className='text-xl font-semibold'
>
{post.frontmatter.title}
</h2>
<p data-cy='blog-post-date' className='mt-2'>
{postPublishedOn}
</p>
<p data-cy='blog-post-description' className='mt-3'>
{post.frontmatter.description}
</p>
</ShadowContainer>
</a>
</Link>
)
})}
</div>
</div>
</main>
<Footer version={version} />
</>
)
}
export const getStaticProps: GetStaticProps<BlogPageProps> = async () => {
const { readPackage } = await import('read-pkg')
const { getPosts } = await import('utils/blog')
const posts = await getPosts()
const { version } = await readPackage()
return { props: { version, posts } }
}
export default BlogPage

View File

@ -1,6 +1,5 @@
import { GetStaticProps } from 'next' import { GetStaticProps, NextPage } from 'next'
import useTranslation from 'next-translate/useTranslation' import useTranslation from 'next-translate/useTranslation'
import readPackageJSON from 'read-pkg'
import { RevealFade } from 'components/design/RevealFade' import { RevealFade } from 'components/design/RevealFade'
import { Section } from 'components/design/Section' import { Section } from 'components/design/Section'
@ -13,19 +12,26 @@ import { Skills } from 'components/Skills'
import { OpenSource } from 'components/OpenSource' import { OpenSource } from 'components/OpenSource'
import { Header } from 'components/Header' import { Header } from 'components/Header'
import { Footer, FooterProps } from 'components/Footer' import { Footer, FooterProps } from 'components/Footer'
import { getDefaultDescription } from 'utils/getDefaultDescription'
import { DIVLO_BIRTHDAY, getAge } from 'utils/getAge'
const Home: React.FC<FooterProps> = (props) => { interface HomeProps extends FooterProps {
description: string
age: number
}
const Home: NextPage<HomeProps> = (props) => {
const { t } = useTranslation() const { t } = useTranslation()
const { version } = props const { version, description, age } = props
return ( return (
<> <>
<Head /> <Head description={description} />
<Header /> <Header showLanguage />
<main className='flex flex-col md:mx-auto md:max-w-4xl lg:max-w-7xl'> <main className='flex flex-col md:mx-auto md:max-w-4xl lg:max-w-7xl'>
<Section isMain id='about'> <Section isMain id='about'>
<Profile /> <Profile age={age} />
<SocialMediaList /> <SocialMediaList />
</Section> </Section>
@ -70,9 +76,12 @@ const Home: React.FC<FooterProps> = (props) => {
) )
} }
export const getStaticProps: GetStaticProps<FooterProps> = async () => { export const getStaticProps: GetStaticProps<HomeProps> = async () => {
const { version } = await readPackageJSON() const { readPackage } = await import('read-pkg')
return { props: { version } } const { version } = await readPackage()
const age = getAge(DIVLO_BIRTHDAY)
const description = getDefaultDescription(age)
return { props: { version, description, age } }
} }
export default Home export default Home

Some files were not shown because too many files have changed in this diff Show More