Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor/structure #128

Merged
merged 35 commits into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8ca8e61
feat: remove fouc by using inline script
EricRovell Sep 2, 2023
546a0e7
feat(icon): remove unused, set order, new items
EricRovell Sep 2, 2023
13fc455
refactor: move footer to views
EricRovell Sep 2, 2023
b1babfc
feat(component): implement dialog
EricRovell Sep 2, 2023
28056e2
feat: move masthead into view & move settings into modal
EricRovell Sep 2, 2023
9b29492
feat: remember user theme choice
EricRovell Sep 2, 2023
c5ff1ed
refactor: scroll prevent helper
EricRovell Sep 2, 2023
3defc49
chore: typos
EricRovell Sep 2, 2023
9e19991
fix(theme): correct type
EricRovell Sep 2, 2023
b254574
refactor: use views dir
EricRovell Sep 2, 2023
58b9ec7
refactor)component): move icon component
EricRovell Sep 2, 2023
f640835
refactor(content): wip indicator
EricRovell Sep 2, 2023
ef9520f
refactor(content): update datetime structure
EricRovell Sep 2, 2023
919df8a
refactor: update components files according to name convention
EricRovell Sep 2, 2023
11417ff
refactor: create icons dir
EricRovell Sep 2, 2023
17bd684
refactor: update utilities dir structure
EricRovell Sep 2, 2023
d69bc7d
refactor(blogpost): convert metadata into json
EricRovell Sep 2, 2023
b936070
refactor(content): change formatter format to json
EricRovell Sep 3, 2023
06c1c7b
refactor(content): move image to cloud
EricRovell Sep 3, 2023
921fcfb
fix(content): frontmatter typos
EricRovell Sep 3, 2023
3d433fc
fix: correct gallery data types
EricRovell Sep 3, 2023
a398388
feat(api): do not get extra data
EricRovell Sep 3, 2023
53f2d94
refactor: use inline svg
EricRovell Sep 3, 2023
db1f97d
refactor(component): simplify icon component
EricRovell Sep 3, 2023
441942f
refactor(content): update frontmatter props naming
EricRovell Sep 4, 2023
83a0909
refactor(content): frontmatter props naming
EricRovell Sep 4, 2023
d1c8a9b
refactor(component): rename to align with content
EricRovell Sep 4, 2023
97e07b5
refactor(content): sketch page frontmatter props naming
EricRovell Sep 4, 2023
56c7f1d
chore: custom css props autocomplete
EricRovell Sep 4, 2023
4a266e6
chore: remove unused files
EricRovell Sep 4, 2023
8c184cd
fix(styles): lint errors
EricRovell Sep 4, 2023
388dbd0
fix(types): lint errors
EricRovell Sep 4, 2023
d904089
fix(types): wrong import path
EricRovell Sep 4, 2023
6eb46eb
fix: correct prop name
EricRovell Sep 4, 2023
e3c523a
fix: missed comma
EricRovell Sep 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed .nojekyll
Empty file.
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig",
"yzhang.markdown-all-in-one",
"svelte.svelte-vscode"
"svelte.svelte-vscode",
"vunguyentuan.vscode-css-variables"
]
}
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@
"javascript",
"typescript",
"svelte"
],
"cssVariables.lookupFiles": [
"src/lib/styles/tokens.css",
"src/lib/styles/theme-*.css"
]
}
1 change: 0 additions & 1 deletion CNAME

This file was deleted.

4 changes: 4 additions & 0 deletions src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
%sveltekit.head%
</head>
<body>
<script>
const theme = localStorage.getItem("theme");
if (theme) document.documentElement.setAttribute("theme", theme);
</script>
%sveltekit.body%
</body>
</html>
130 changes: 130 additions & 0 deletions src/content/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Content pages

The directory contains collections as pages:

- blogpost;
- gallery;
- project;
- sketch.

## Page frontmatter

Each page frontmatter has interface:

```ts
interface Page {
"cover"?: string;
"dateCreated"?: ISOString;
"dateUpdated": ISOString;
"description": string;
"keywords": string[];
"layout"?: string;
"slug": string;
"title": string;
"translation"?: {
lang: "русский" | "english;
slug: string;
};
}
```

### Page

```ts
interface Page {
"description": string;
"keywords": string[];
"lang": "en" | "ru;
"slug": string;
"title": string;
"updated": ISOString;
}
```

### Blogpost

```ts
interface PageBlogpost {
"cover": string;
"created": ISOString;
"description": string;
"keywords": string[];
"lang": "en" | "ru;
"layout": "blogpost";
"slug": string;
"title": string;
"translation"?: {
lang: "русский" | "english;
slug: string;
};
"updated": ISOString;
}
```

### Gallery

```ts
interface Image {
height: number;
src: string;
width: string;
}

interface PageGalleryItem {
camera: string;
dateCreated: string;
dateTaken: string;
dateUpdated?: string;
description: string;
dominant: [ r: number, g: number, b: number ];
fnumber: number;
focalLength: number;
fullsize: Image;
id: string;
iso: number;
keywords?: string[];
lang: "en" | "ru";
layout: "gallery";
lens: string;
og: Image;
shutter: string;
slug: string;
thumbnail: Image;
thumbnailSquare: Image;
title: string;
}
```

### Project

```ts
interface PageProject {
"description": string;
"featured": boolean;
"lang": "en" | "ru;
"layout": "project";
"maintained": boolean;
"name": string;
"npm": string;
"repository": string;
"techstack": string[];
"type": string;
"updated": ISOString;
"website": string;
}
```

### Sketch

```ts
interface PageSketch {
"cover": string;
"description": string;
"keywords": string[];
"lang": "en" | "ru";
"layout": "sketch";
"title": string;
"updated": ISOString;
"url": string;
}
```
28 changes: 18 additions & 10 deletions src/content/blogpost/chaos-game/index.en.svx
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
---
cover: https://storage.yandexcloud.net/escapist-marginalia/covers/chaos-game.png
created: 2022-09-10T01:34:00.000Z
description: "Can be anything deterministic hidden behind the random?"
keywords: [ "generative art", "math" ]
lang: en
layout: blogpost
slug: "the-chaos-game"
title: "The Chaos Game: The randomness against determinism"
translation: { lang: "русский", slug: "игра-хаоса" }
updated: 2023-01-09T15:20:00.000Z
{
"cover": "https://storage.yandexcloud.net/escapist-marginalia/covers/chaos-game.png",
"dateCreated": "2022-09-10T01:34:00.000Z",
"dateUpdated": "2023-01-09T15:20:00.000Z",
"description": "Can be anything deterministic hidden behind the random?",
"keywords": [
"generative art",
"math"
],
"lang": "en",
"layout": "blogpost",
"slug": "the-chaos-game",
"title": "The Chaos Game: The randomness against determinism",
"translation": {
lang: "русский",
slug: "игра-хаоса"
}
}
---

<script>
Expand Down
28 changes: 18 additions & 10 deletions src/content/blogpost/chaos-game/index.ru.svx
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
---
cover: https://storage.yandexcloud.net/escapist-marginalia/covers/chaos-game.png
created: 2022-09-10T01:34:00.000Z
description: "Может ли что-то детерменистичное скрываться за случайностью?"
keywords: [ "generative art", "math" ]
lang: ru
layout: blogpost
slug: "игра-хаоса"
title: "Игра Хаоса: случайность против детерменизма"
translation: { lang: "english", slug: "the-chaos-game" }
updated: 2023-01-09T15:20:00.000Z
{
"cover": "https://storage.yandexcloud.net/escapist-marginalia/covers/chaos-game.png",
"dateCreated": "2022-09-10T01:34:00.000Z",
"dateUpdated": "2023-01-09T15:20:00.000Z",
"description": "Может ли что-то детерменистичное скрываться за случайностью?",
"keywords": [
"generative art",
"math"
],
"lang": "ru",
"layout": "blogpost",
"slug": "игра-хаоса",
"title": "Игра Хаоса: случайность против детерменизма",
"translation": {
lang: "english",
slug: "the-chaos-game"
}
}
---

<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
export let cropFactor = 1;
export let height = 24;
export let width = 36;
export let imageSrc = "/img/blogpost-crop-factor-comparison.jpg";
export let imageSrc = "https://storage.yandexcloud.net/escapist-marginalia/writing/crop-factor-comparison.jpg";
export let imageFocalLength = 16;
export let focalLength = imageFocalLength;

Expand Down
24 changes: 15 additions & 9 deletions src/content/blogpost/crop-factor/index.ru.svx
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
---
cover: https://storage.yandexcloud.net/escapist-marginalia/covers/crop-factor.png
created: 2023-04-14T00:12:00.000Z
description: "На что влияет размеры сенсора в фотографии и почему это так важно знать фотолюбителю."
keywords: [ "photography", "crop-factor", "equivalent focal length" ]
lang: "ru"
layout: blogpost
slug: "кроп-фактор"
title: "Кроп Фактор"
updated: 2023-04-16T01:41:00.000Z
{
"cover": "https://storage.yandexcloud.net/escapist-marginalia/covers/crop-factor.png",
"dateCreated": "2023-04-14T00:12:00.000Z",
"dateUpdated": "2023-04-16T01:41:00.000Z",
"description": "На что влияет размеры сенсора в фотографии и почему это так важно знать фотолюбителю.",
"keywords": [
"photography",
"crop-factor",
"equivalent focal length"
],
"lang": "ru",
"layout": "blogpost",
"slug": "кроп-фактор",
"title": "Кроп Фактор"
}
---

<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { cropFactorData } from "./crop-factor-data";
import styles from "./crop-factor-comparison.module.css";

export let imageSrc = "/img/blogpost-crop-factor-comparison.jpg";
export let imageSrc = "https://storage.yandexcloud.net/escapist-marginalia/writing/crop-factor-comparison.jpg";

const t = getContext<Record<string, string>>("t")["crop-factor-comparison"];
const maskID = uniqueID.get();
Expand Down
28 changes: 18 additions & 10 deletions src/content/blogpost/css-only-masonry/index.en.svx
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
---
cover: https://storage.yandexcloud.net/escapist-marginalia/covers/masonry.png
created: 2022-05-11T15:30:00.000Z
description: "Build Masonry-like layout image gallery component using the modern CSS."
keywords: [ "css", "web" ]
lang: en
layout: blogpost
slug: "masonry-image-gallery-with-almost-pure-css"
title: "Masonry Image Gallery Layout with (almost) pure CSS"
translation: { lang: "русский", slug: "галерея-изображений-в-раскладке-masonry-на-почти-чистом-css" }
updated: 2022-09-22T03:16:00.000Z
{
"cover": "https://storage.yandexcloud.net/escapist-marginalia/covers/masonry.png",
"dateCreated": "2022-05-11T15:30:00.000Z",
"dateUpdated": "2022-09-22T03:16:00.000Z",
"description": "Build Masonry-like layout image gallery component using the modern CSS.",
"keywords": [
"css",
"web"
],
"lang": "en",
"layout": "blogpost",
"slug": "masonry-image-gallery-with-almost-pure-css",
"title": "Masonry Image Gallery Layout with (almost) pure CSS",
"translation": {
lang: "русский",
slug: "галерея-изображений-в-раскладке-masonry-на-почти-чистом-css"
}
}
---

<script>
Expand Down
28 changes: 18 additions & 10 deletions src/content/blogpost/css-only-masonry/index.ru.svx
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
---
cover: https://storage.yandexcloud.net/escapist-marginalia/covers/masonry.png
created: 2022-05-11T15:30:00.000Z
description: "Реализуем компонент для галереи изображений в стиле раскладки Masonry, используя возможности CSS."
keywords: [ "css", "web" ]
lang: ru
layout: blogpost
slug: "галерея-изображений-в-раскладке-masonry-на-почти-чистом-css"
title: "Галерея изображений в раскладке Masonry на (почти) чистом CSS"
translation: { lang: "english", slug: "masonry-image-gallery-with-almost-pure-css" }
updated: 2022-09-22T03:16:00.000Z
{
"cover": "https://storage.yandexcloud.net/escapist-marginalia/covers/masonry.png",
"dateCreated": "2022-05-11T15:30:00.000Z",
"dateUpdated": "2022-09-22T03:16:00.000Z",
"description": "Реализуем компонент для галереи изображений в стиле раскладки Masonry, используя возможности CSS.",
"keywords": [
"css",
"web"
],
"lang": "ru",
"layout": "blogpost",
"slug": "галерея-изображений-в-раскладке-masonry-на-почти-чистом-css",
"title": "Галерея изображений в раскладке Masonry на (почти) чистом CSS",
"translation": {
lang: "english",
slug: "masonry-image-gallery-with-almost-pure-css"
}
}
---

<script>
Expand Down
28 changes: 18 additions & 10 deletions src/content/blogpost/project-euler/problem-001/index.en.svx
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
---
cover: https://storage.yandexcloud.net/escapist-marginalia/covers/project-euler-1.png
created: 2022-05-24T00:20:00.000Z
description: "Multiples of 3 or 5."
keywords: [ "project euler", "math" ]
lang: en
layout: blogpost
series: "project-euler"
slug: "project-euler-1"
title: "Project Euler #1"
translation: { lang: "русский", slug: "проект-эйлера-1" }
{
"cover": "https://storage.yandexcloud.net/escapist-marginalia/covers/project-euler-1.png",
"dateCreated": "2022-05-24T00:20:00.000Z",
"description": "Multiples of 3 or 5.",
"keywords": [
"project euler",
"math"
],
"lang": "en",
"layout": "blogpost",
"series": "project-euler",
"slug": "project-euler-1",
"title": "Project Euler #1",
"translation": {
lang: "русский",
slug: "проект-эйлера-1"
}
}
---

<script>
Expand Down
Loading