Add prettier for formatting
Signed-off-by: Severin Kaderli <severin@kaderli.dev>
This commit is contained in:
parent
b4e0a41991
commit
b419038bf8
7 changed files with 120 additions and 34 deletions
13
.editorconfig
Normal file
13
.editorconfig
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
end_of_line = lf
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[*.html]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
[*.css]
|
||||||
|
indent_size = 2
|
|
@ -3,19 +3,39 @@ name: Build & Push Docker Image
|
||||||
on: push
|
on: push
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
check-format:
|
||||||
runs-on: ubuntu-latest
|
name: Check formatting
|
||||||
container:
|
runs-on: ubuntu-latest
|
||||||
image: catthehacker/ubuntu:act-latest
|
steps:
|
||||||
steps:
|
- name: Checkout
|
||||||
- name: Log in to the Container registry
|
uses: actions/checkout@v3
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
- name: Install Node.js
|
||||||
registry: registry.gitlab.com/severinkaderli/registry
|
uses: actions/setup-node@v3
|
||||||
username: ${{ secrets.REGISTRY_USER }}
|
with:
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
node-version: 20
|
||||||
- name: Build and push
|
registry-url: https://git.kaderli.dev/api/packages/severinkaderli/npm/
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
- name: Install dependencies
|
||||||
push: true
|
run: npm ci
|
||||||
tags: registry.gitlab.com/severinkaderli/registry:home.kaderli.dev
|
|
||||||
|
- name: Check formatting
|
||||||
|
run: npm run format:check
|
||||||
|
|
||||||
|
build-and-push-docker-image:
|
||||||
|
name: Build & Push Docker Image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: catthehacker/ubuntu:act-latest
|
||||||
|
steps:
|
||||||
|
- name: Log in to the Container registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: registry.gitlab.com/severinkaderli/registry
|
||||||
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
tags: registry.gitlab.com/severinkaderli/registry:home.kaderli.dev
|
||||||
|
|
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
.idea/
|
||||||
|
node_modules/
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
|
@ -78,9 +78,7 @@
|
||||||
<h2>Social</h2>
|
<h2>Social</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a rel="noopener noreferrer" href="https://www.reddit.com"
|
||||||
rel="noopener noreferrer"
|
|
||||||
href="https://www.reddit.com"
|
|
||||||
>Reddit</a
|
>Reddit</a
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
|
@ -93,6 +91,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="link-group">
|
<div class="link-group">
|
||||||
<h2>Programming</h2>
|
<h2>Programming</h2>
|
||||||
|
<button class="prettier-class" id="prettier-id">Click Here</button>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a rel="noopener noreferrer" href="https://git.kaderli.dev"
|
<a rel="noopener noreferrer" href="https://git.kaderli.dev"
|
||||||
|
|
49
package-lock.json
generated
Normal file
49
package-lock.json
generated
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{
|
||||||
|
"name": "home.kaderli.dev",
|
||||||
|
"lockfileVersion": 2,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"devDependencies": {
|
||||||
|
"@severinkaderli/prettier-config": "^1.0.2",
|
||||||
|
"prettier": "^3.2.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@severinkaderli/prettier-config": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://git.kaderli.dev/api/packages/severinkaderli/npm/%40severinkaderli%2Fprettier-config/-/1.0.2/prettier-config-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-uIMtw9QK/K51wOMwapjLSdY6IjyeXN/QDjMAnxiacBsjm9JF5QhpvdH+HFhDu/1nCoNhauaRVWC0A/N2zmea6g==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "AGPL-3.0"
|
||||||
|
},
|
||||||
|
"node_modules/prettier": {
|
||||||
|
"version": "3.2.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.4.tgz",
|
||||||
|
"integrity": "sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==",
|
||||||
|
"dev": true,
|
||||||
|
"bin": {
|
||||||
|
"prettier": "bin/prettier.cjs"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@severinkaderli/prettier-config": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://git.kaderli.dev/api/packages/severinkaderli/npm/%40severinkaderli%2Fprettier-config/-/1.0.2/prettier-config-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-uIMtw9QK/K51wOMwapjLSdY6IjyeXN/QDjMAnxiacBsjm9JF5QhpvdH+HFhDu/1nCoNhauaRVWC0A/N2zmea6g==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"prettier": {
|
||||||
|
"version": "3.2.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.4.tgz",
|
||||||
|
"integrity": "sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
package.json
Normal file
11
package.json
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"devDependencies": {
|
||||||
|
"@severinkaderli/prettier-config": "^1.0.2",
|
||||||
|
"prettier": "^3.2.4"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"format": "prettier --write index.html styles.css",
|
||||||
|
"format:check": "prettier --check index.html styles.css"
|
||||||
|
},
|
||||||
|
"prettier": "@severinkaderli/prettier-config"
|
||||||
|
}
|
20
styles.css
20
styles.css
|
@ -1,6 +1,4 @@
|
||||||
:root {
|
:root {
|
||||||
--wallpaper: url("None");
|
|
||||||
|
|
||||||
/* Special */
|
/* Special */
|
||||||
--background: #18161d;
|
--background: #18161d;
|
||||||
--foreground: #a4a0ac;
|
--foreground: #a4a0ac;
|
||||||
|
@ -23,7 +21,7 @@
|
||||||
--color13: #ec7aca;
|
--color13: #ec7aca;
|
||||||
--color14: #4ab0b9;
|
--color14: #4ab0b9;
|
||||||
--color15: #a4a0ac;
|
--color15: #a4a0ac;
|
||||||
|
|
||||||
--link-group-title-font-size: 1.5rem;
|
--link-group-title-font-size: 1.5rem;
|
||||||
--link-group-item-font-size: 1.25rem;
|
--link-group-item-font-size: 1.25rem;
|
||||||
}
|
}
|
||||||
|
@ -74,32 +72,27 @@ main {
|
||||||
.link-group {
|
.link-group {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-bottom: calc(2 * var(--spacing));
|
margin-bottom: calc(2 * var(--spacing));
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
margin-bottom: calc(0.5 * var(--spacing));
|
margin-bottom: calc(0.5 * var(--spacing));
|
||||||
font-size: var(--link-group-title-font-size);
|
font-size: var(--link-group-title-font-size);
|
||||||
}
|
}
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat( auto-fill, minmax(150px, 1fr) );
|
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: var(--spacing);
|
gap: var(--spacing);
|
||||||
|
|
||||||
a {
|
a {
|
||||||
font-size: var(--link-group-item-font-size);
|
font-size: var(--link-group-item-font-size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
@ -109,9 +102,8 @@ a:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@media screen and (max-width: 800px) {
|
@media screen and (max-width: 800px) {
|
||||||
ul {
|
ul {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue