Skip to content

Commit 3ddc662

Browse files
committed
Implement socials
1 parent cd6c733 commit 3ddc662

13 files changed

+240
-55
lines changed

content/globals/contact.yaml

+46
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,49 @@
11
title: Contact
22
data:
33
4+
socials:
5+
- id: youtube
6+
name: 'My Youtube channel'
7+
icon: youtube
8+
link: 'https://youtube.com/@noeldemartin'
9+
classes: '!h-8 p-0 -m-1'
10+
represent: true
11+
type: account
12+
enabled: true
13+
- id: twitter
14+
name: 'My Twitter'
15+
link: 'https://twitter.com/NoelDeMartin'
16+
represent: true
17+
icon: twitter
18+
classes: '[&_path]:stroke-width-[10px] [&_path]:stroke-[rgba(0,0,0,.2)]'
19+
type: account
20+
enabled: true
21+
- id: mastodon
22+
name: 'My Mastodon'
23+
link: 'https://noeldemartin.social'
24+
represent: true
25+
icon: mastodon
26+
classes: '[&_path]:stroke-width-[10px] [&_path]:stroke-[rgba(0,0,0,.2)]'
27+
type: account
28+
enabled: true
29+
- id: bluesky
30+
name: 'My Bluesky'
31+
link: 'https://bsky.app/profile/noeldemartin.com'
32+
represent: true
33+
icon: bluesky
34+
type: account
35+
enabled: true
36+
- id: github
37+
name: 'My GitHub'
38+
link: 'https://github.com/NoelDeMartin'
39+
represent: true
40+
icon: github
41+
type: account
42+
enabled: true
43+
- id: email
44+
name: 'My Email'
45+
link: 'mailto:[email protected]?subject=Hi there!'
46+
represent: false
47+
icon: email
48+
type: account
49+
enabled: true
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
tabs:
2+
main:
3+
display: Main
4+
sections:
5+
- fields:
6+
- handle: email
7+
field:
8+
type: text
9+
- handle: socials
10+
field:
11+
type: replicator
12+
display: Socials
13+
sets:
14+
accounts:
15+
display: 'Accounts'
16+
sets:
17+
account:
18+
display: Account
19+
fields:
20+
- handle: name
21+
field:
22+
type: text
23+
display: Name
24+
- handle: link
25+
field:
26+
type: text
27+
display: Link
28+
width: 66
29+
- handle: represent
30+
field:
31+
type: toggle
32+
display: Represent
33+
width: 33
34+
- handle: icon
35+
field:
36+
type: text
37+
display: Icon
38+
width: 33
39+
- handle: classes
40+
field:
41+
type: text
42+
display: Classes
43+
width: 66

resources/css/main.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
@source "../views";
66
@source "../../app";
7-
@source "../../content/collections";
7+
@source "../../content";
88

99
@layer base {
1010
@import './base.css';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<header
2+
style="background-color: hsl(120, 40%, 80%)"
3+
class="z-10 flex h-16 flex-col items-center md:h-32 lg:h-40"
4+
>
5+
<div class="max-w-content flex w-full overflow-hidden">
6+
<a href="/" aria-label="Home" title="Home" class="flex" tabindex="-1">
7+
<img
8+
src="/img/myface.png"
9+
alt=""
10+
class="mr-2 h-16/10 translate-y-[-15%] transform md:mr-4 lg:mr-8 print:h-full print:translate-y-0"
11+
/>
12+
<div class="my-auto grow" style="height: 80%">
13+
<s:partial
14+
src="icons/site-title"
15+
class="h-full fill-current text-black"
16+
/>
17+
</div>
18+
</a>
19+
</div>
20+
<nav aria-label="Site navigation" class="bg-overlay w-full">
21+
<div class="max-w-content mx-auto flex h-full justify-between">
22+
<div class="flex">
23+
<s:nav handle="main">
24+
<a
25+
href="{{ $url }}"
26+
class="group hover:bg-overlay relative flex items-center p-2 font-bold text-black uppercase opacity-50 hover:opacity-100 focus:opacity-100 [&:is([aria-current])]:opacity-100"
27+
@if ($is_current)
28+
aria-current="page"
29+
@endif
30+
>
31+
<s:partial :src="'icons/'.$icon" class="mr-2 size-5" />
32+
<span
33+
class="border-b-2 border-transparent group-hover:border-black [[aria-current]>&]:border-black"
34+
>
35+
{{ $title }}
36+
</span>
37+
</a>
38+
</s:nav>
39+
</div>
40+
<div class="flex">
41+
@foreach ($socials as $account)
42+
<a
43+
href="{{ $account->link }}"
44+
aria-label="{{ $account->name }}"
45+
title="{{ $account->name }}"
46+
target="_blank"
47+
class="hover:bg-overlay flex min-w-10 items-center justify-center px-2 opacity-50 hover:opacity-100 focus:opacity-100"
48+
{{ $account->represent ? 'rel="me"' : "" }}
49+
>
50+
<s:partial
51+
:src="'icons/' . $account->icon"
52+
:class="($account->classes ?? '') . ' h-6'"
53+
/>
54+
<span class="sr-only">{{ $account->name }}</span>
55+
</a>
56+
@endforeach
57+
</div>
58+
</div>
59+
</nav>
60+
</header>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<svg
2+
class="{{ class ?? '' }}"
3+
xmlns="http://www.w3.org/2000/svg"
4+
viewBox="0 0 600 530"
5+
>
6+
<path
7+
d="M135.72 44.03C202.216 93.951 273.74 195.17 300 249.49c26.262-54.316 97.782-155.54 164.28-205.46C512.26 8.009 590-19.862 590 68.825c0 17.712-10.155 148.79-16.111 170.07-20.703 73.984-96.144 92.854-163.25 81.433 117.3 19.964 147.14 86.092 82.697 152.22-122.39 125.59-175.91-31.511-189.63-71.766-2.514-7.38-3.69-10.832-3.708-7.896-.017-2.936-1.193.516-3.707 7.896-13.714 40.255-67.233 197.36-189.63 71.766-64.444-66.128-34.605-132.26 82.697-152.22-67.108 11.421-142.55-7.45-163.25-81.433C20.15 217.613 9.997 86.535 9.997 68.825c0-88.687 77.742-60.816 125.72-24.795z"
8+
/>
9+
</svg>
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<svg
2+
class="{{ class ?? '' }}"
3+
xmlns="http://www.w3.org/2000/svg"
4+
viewBox="0 0 20 20"
5+
>
6+
<path
7+
d="M18 2a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4c0-1.1.9-2 2-2h16zm-4.37 9.1L20 16v-2l-5.12-3.9L20 6V4l-10 8L0 4v2l5.12 4.1L0 14v2l6.37-4.9L10 14l3.63-2.9z"
8+
/>
9+
</svg>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<svg
2+
class="{{ class ?? '' }}"
3+
xmlns="http://www.w3.org/2000/svg"
4+
viewBox="0 0 512 512"
5+
>
6+
<path
7+
d="M255.968,5.329C114.624,5.329,0,120.401,0,262.353c0,113.536,73.344,209.856,175.104,243.872 c12.8,2.368,17.472-5.568,17.472-12.384c0-6.112-0.224-22.272-0.352-43.712c-71.2,15.52-86.24-34.464-86.24-34.464 c-11.616-29.696-28.416-37.6-28.416-37.6c-23.264-15.936,1.728-15.616,1.728-15.616c25.696,1.824,39.2,26.496,39.2,26.496 c22.848,39.264,59.936,27.936,74.528,21.344c2.304-16.608,8.928-27.936,16.256-34.368 c-56.832-6.496-116.608-28.544-116.608-127.008c0-28.064,9.984-51.008,26.368-68.992c-2.656-6.496-11.424-32.64,2.496-68 c0,0,21.504-6.912,70.4,26.336c20.416-5.696,42.304-8.544,64.096-8.64c21.728,0.128,43.648,2.944,64.096,8.672 c48.864-33.248,70.336-26.336,70.336-26.336c13.952,35.392,5.184,61.504,2.56,68c16.416,17.984,26.304,40.928,26.304,68.992 c0,98.72-59.84,120.448-116.864,126.816c9.184,7.936,17.376,23.616,17.376,47.584c0,34.368-0.32,62.08-0.32,70.496 c0,6.88,4.608,14.88,17.6,12.352C438.72,472.145,512,375.857,512,262.353C512,120.401,397.376,5.329,255.968,5.329z"
8+
/>
9+
</svg>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<svg
2+
class="{{ class ?? '' }}"
3+
xmlns="http://www.w3.org/2000/svg"
4+
viewBox="0 0 216.414 232.01"
5+
>
6+
<path
7+
d="M106.888-1.07c-29.661.242-58.193 3.454-74.82 11.09 0 0-32.978 14.752-32.978 65.082 0 11.525-.224 25.305.14 39.918 1.198 49.22 9.024 97.729 54.532 109.774 20.982 5.554 38.998 6.717 53.507 5.92 26.31-1.459 41.081-9.39 41.081-9.39l-.868-19.09s-18.802 5.928-39.919 5.205c-20.92-.717-43.007-2.255-46.391-27.942-.313-2.256-.469-4.67-.469-7.203 0 0 20.538 5.02 46.566 6.213 15.915.73 30.839-.933 45.998-2.741 29.07-3.472 54.381-21.383 57.562-37.75 5.013-25.78 4.6-62.914 4.6-62.914 0-50.33-32.975-65.082-32.975-65.082-16.627-7.636-45.176-10.848-74.837-11.09ZM73.319 38.255c12.355 0 21.71 4.749 27.896 14.248l6.015 10.082 6.015-10.082c6.185-9.499 15.54-14.248 27.896-14.248 10.678 0 19.281 3.754 25.851 11.076 6.369 7.323 9.54 17.221 9.54 29.676v60.941h-24.144v-59.15c0-12.469-5.246-18.798-15.74-18.798-11.603 0-17.417 7.507-17.417 22.352v32.377H95.229V84.352C95.23 69.507 89.413 62 77.811 62c-10.494 0-15.74 6.33-15.74 18.798v59.15H37.927v-60.94c0-12.456 3.171-22.354 9.541-29.677C54.037 42.01 62.64 38.255 73.32 38.255z"
8+
/>
9+
</svg>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<svg
2+
class="{{ class ?? '' }}"
3+
xmlns="http://www.w3.org/2000/svg"
4+
viewBox="0 0 410.155 410.155"
5+
>
6+
<path
7+
d="M403.632,74.18c-9.113,4.041-18.573,7.229-28.28,9.537c10.696-10.164,18.738-22.877,23.275-37.067 l0,0c1.295-4.051-3.105-7.554-6.763-5.385l0,0c-13.504,8.01-28.05,14.019-43.235,17.862c-0.881,0.223-1.79,0.336-2.702,0.336 c-2.766,0-5.455-1.027-7.57-2.891c-16.156-14.239-36.935-22.081-58.508-22.081c-9.335,0-18.76,1.455-28.014,4.325 c-28.672,8.893-50.795,32.544-57.736,61.724c-2.604,10.945-3.309,21.9-2.097,32.56c0.139,1.225-0.44,2.08-0.797,2.481 c-0.627,0.703-1.516,1.106-2.439,1.106c-0.103,0-0.209-0.005-0.314-0.015c-62.762-5.831-119.358-36.068-159.363-85.14l0,0 c-2.04-2.503-5.952-2.196-7.578,0.593l0,0C13.677,65.565,9.537,80.937,9.537,96.579c0,23.972,9.631,46.563,26.36,63.032 c-7.035-1.668-13.844-4.295-20.169-7.808l0,0c-3.06-1.7-6.825,0.485-6.868,3.985l0,0c-0.438,35.612,20.412,67.3,51.646,81.569 c-0.629,0.015-1.258,0.022-1.888,0.022c-4.951,0-9.964-0.478-14.898-1.421l0,0c-3.446-0.658-6.341,2.611-5.271,5.952l0,0 c10.138,31.651,37.39,54.981,70.002,60.278c-27.066,18.169-58.585,27.753-91.39,27.753l-10.227-0.006 c-3.151,0-5.816,2.054-6.619,5.106c-0.791,3.006,0.666,6.177,3.353,7.74c36.966,21.513,79.131,32.883,121.955,32.883 c37.485,0,72.549-7.439,104.219-22.109c29.033-13.449,54.689-32.674,76.255-57.141c20.09-22.792,35.8-49.103,46.692-78.201 c10.383-27.737,15.871-57.333,15.871-85.589v-1.346c-0.001-4.537,2.051-8.806,5.631-11.712c13.585-11.03,25.415-24.014,35.16-38.591 l0,0C411.924,77.126,407.866,72.302,403.632,74.18L403.632,74.18z"
8+
/>
9+
</svg>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<svg class="{{ class ?? '' }}" viewBox="0 0 24 24">
2+
<path
3+
d="m10 15l5.19-3L10 9zm11.56-7.83c.13.47.22 1.1.28 1.9c.07.8.1 1.49.1 2.09L22 12c0 2.19-.16 3.8-.44 4.83c-.25.9-.83 1.48-1.73 1.73c-.47.13-1.33.22-2.65.28c-1.3.07-2.49.1-3.59.1L12 19c-4.19 0-6.8-.16-7.83-.44c-.9-.25-1.48-.83-1.73-1.73c-.13-.47-.22-1.1-.28-1.9c-.07-.8-.1-1.49-.1-2.09L2 12c0-2.19.16-3.8.44-4.83c.25-.9.83-1.48 1.73-1.73c.47-.13 1.33-.22 2.65-.28c1.3-.07 2.49-.1 3.59-.1L12 5c4.19 0 6.8.16 7.83.44c.9.25 1.48.83 1.73 1.73"
4+
/>
5+
</svg>

resources/views/layout.blade.php

+3-53
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
display: var(--default-display);
1919
}
2020
</style>
21-
@vite(["resources/css/main.css", "resources/js/main.js"])
21+
@vite(['resources/css/main.css', 'resources/js/main.js'])
2222
</head>
2323
<body
2424
class="font-ubuntu text-black-light flex min-h-screen flex-col bg-white text-base leading-tight font-normal antialiased print:block"
@@ -30,63 +30,13 @@ class="border-blue-darkest sr-only z-20 border bg-white focus:not-sr-only focus:
3030
Skip to content
3131
</a>
3232

33-
<header
34-
style="background-color: hsl(120, 40%, 80%)"
35-
class="z-10 flex h-16 flex-col items-center md:h-32 lg:h-40"
36-
>
37-
<div class="max-w-content flex w-full overflow-hidden">
38-
<a
39-
href="/"
40-
aria-label="Home"
41-
title="Home"
42-
class="flex"
43-
tabindex="-1"
44-
>
45-
<img
46-
src="/img/myface.png"
47-
alt=""
48-
class="mr-2 h-16/10 translate-y-[-15%] transform md:mr-4 lg:mr-8 print:h-full print:translate-y-0"
49-
/>
50-
<div class="my-auto grow" style="height: 80%">
51-
<s:partial
52-
src="icons/site-title"
53-
class="h-full fill-current text-black"
54-
/>
55-
</div>
56-
</a>
57-
</div>
58-
<nav aria-label="Site navigation" class="bg-overlay w-full">
59-
<div class="max-w-content mx-auto flex h-full justify-between">
60-
<div class="flex">
61-
<s:nav handle="main">
62-
<a
63-
href="{{ $url }}"
64-
class="group hover:bg-overlay relative flex items-center p-2 font-bold text-black uppercase opacity-50 hover:opacity-100 focus:opacity-100 [&:is([aria-current])]:opacity-100"
65-
@if ($is_current)
66-
aria-current="page"
67-
@endif
68-
>
69-
<s:partial
70-
:src="'icons/'.$icon"
71-
class="mr-2 size-5"
72-
/>
73-
<span
74-
class="border-b-2 border-transparent group-hover:border-black [[aria-current]>&]:border-black"
75-
>
76-
{{ $title }}
77-
</span>
78-
</a>
79-
</s:nav>
80-
</div>
81-
</div>
82-
</nav>
83-
</header>
33+
<x-layout-header :socials="$contact->socials" />
8434

8535
<main
8636
id="main"
8737
class="max-w-content relative mx-auto w-full grow p-4 pt-8 md:px-2"
8838
>
89-
@yield("main")
39+
@yield('main')
9040
</main>
9141

9242
<!-- Sites Verification -->

resources/views/tasks/index.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<h1>All Tasks</h1>
66

77
<ul class="ml-0 list-none pl-0">
8-
<s:collection from="tasks" sort="date_created:desc">
8+
<s:collection from="tasks" sort="publication_date:desc">
99
<li
1010
class="mb-4 flex flex-col items-start md:flex-row md:items-center"
1111
>

tests/Feature/NavigationTest.php

+36
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
$response->assertStatus(200);
77
$response->assertSee('Hi there!');
88
$response->assertSee('[email protected]');
9+
$response->assertSee('My Youtube channel');
10+
$response->assertSee('https://youtube.com/@noeldemartin');
911
});
1012

1113
test('Blog', function () {
@@ -16,13 +18,27 @@
1618
$response->assertSee('Nov 10, 2014');
1719
});
1820

21+
test('Blog post', function () {
22+
$response = $this->get('/blog/starting-something-new');
23+
24+
$response->assertStatus(200);
25+
$response->assertSee('Starting Something New');
26+
$response->assertSee('Nov 10, 2014');
27+
$response->assertSee('3 min.');
28+
$response->assertSee('There is a feeling I enjoy a lot. The feeling of Starting Something New.');
29+
$response->assertSee('What this blog will be about');
30+
});
31+
1932
test('Projects', function () {
2033
$response = $this->get('/projects');
2134

2235
$response->assertStatus(200);
2336
$response->assertSee('Umai');
2437
$response->assertSee('Soukai');
2538
$response->assertSee('Geemba');
39+
40+
$this->get('/projects/geemba')->assertSee('We aimed to make fitness more accessible');
41+
$this->get('/projects/beastmasters')->assertSee('an online turn-based card game');
2642
});
2743

2844
test('Now', function () {
@@ -38,3 +54,23 @@
3854
$response->assertSee('Starting Something New');
3955
$response->assertSee('Reading Musashi by Eiji Yoshikawa');
4056
});
57+
58+
test('Tasks', function () {
59+
$response = $this->get('/tasks');
60+
61+
$response->assertStatus(200);
62+
$response->assertSee('All Tasks');
63+
$response->assertSee('Reading Musashi by Eiji Yoshikawa');
64+
$response->assertSee('Housekeeping 2024/25');
65+
});
66+
67+
test('Task comments', function () {
68+
$response = $this->get('/tasks/reading-musashi-by-eiji-yoshikawa');
69+
70+
$response->assertStatus(200);
71+
$response->assertSee('Reading Musashi by Eiji Yoshikawa');
72+
$response->assertSee('Task started');
73+
$response->assertSee('Well, it is time');
74+
$response->assertSee('After looking over my notes');
75+
$response->assertSee('Task completed');
76+
});

0 commit comments

Comments
 (0)