Set up CV page

This commit is contained in:
Paul Nicoué 2025-05-30 17:15:12 +02:00
parent 18c60b22cd
commit 098b8b8e0d
14 changed files with 117 additions and 31 deletions

View file

@ -61,6 +61,7 @@ body {
padding: $sidebar-padding-y $sidebar-padding-x;
.header__logo {
display: block;
position: relative;
width: $logo-portrait-width;
aspect-ratio: calc(1 / 2);

10
assets/css/pages/_cv.scss Normal file
View file

@ -0,0 +1,10 @@
@use "../abstracts" as *;
// --------------------------------------------------
// CV STYLE
// --------------------------------------------------
.cv {
.cv__content {}
}

View file

@ -2,4 +2,5 @@
// PAGES (INDEX)
// --------------------------------------------------
@forward "cv";
@forward "home";

View file

@ -0,0 +1,6 @@
title: CV
options:
changeStatus: false
duplicate: false
status:
listed: true

View file

@ -2,4 +2,8 @@ title:
en: Error
fr: Erreur
options:
read: false
changeStatus: false
duplicate: false
preview: false
status:
unlisted: true

View file

@ -1,5 +0,0 @@
title:
en: Home
fr: Accueil
options:
read: false

View file

@ -0,0 +1,8 @@
title:
en: Home
fr: Accueil
options:
changeStatus: false
duplicate: false
status:
listed: true

View file

@ -6,7 +6,6 @@ options:
duplicate: false
preview: false
status:
draft: true
unlisted: true
sections:
images: sections/media-library_images

View file

@ -4,7 +4,7 @@ return [
// Kirby configuration settings
'panel' => [
'css' => 'build/panel.css',
'install' => true,
'install' => false,
'language' => 'fr',
'menu' => [
'site' => [

18
site/controllers/cv.php Normal file
View file

@ -0,0 +1,18 @@
<?php
return function ($kirby, $site) {
// Get shared data from default controller (site.php)
$shared = $kirby->controller('site' , compact('site'));
// Get CV field content
$cv = $site->cv();
// Return merged arrays containing shared data and current controller data
return A::merge(
$shared,
compact(
'cv',
)
);
};

View file

@ -1,17 +1,24 @@
<?php
return function ($site) {
return function ($kirby, $site) {
// Get shared data from default controller (site.php)
$shared = $kirby->controller('site' , compact('site'));
// Get CV page URL and override logo href and aria-label attributes
$logoHref = page('cv')->url();
$logoAriaLabel = "Go to {$site->title()}'s CV page";
// Get items from image gallery structure field
$galleryItems = $site->image_gallery()->toStructure();
// Get contact fields content
$email = $site->email();
$instagram = $site->instagram();
return [
'galleryItems' => $galleryItems,
'email' => $email,
'instagram' => $instagram,
];
// Return merged arrays containing shared data and current controller data
return A::merge(
$shared,
compact(
'galleryItems',
'logoAriaLabel',
'logoHref',
)
);
};

20
site/controllers/site.php Normal file
View file

@ -0,0 +1,20 @@
<?php
return function ($site) {
// Get site URL (home page URL) to potentially override logo href and aria-label attributes in other templates
$logoHref = $site->url();
$logoAriaLabel = "Go to {$site->title()}'s home page";
// Get contact fields content
$email = $site->email();
$instagram = $site->instagram();
// Return data
return compact(
'email',
'instagram',
'logoAriaLabel',
'logoHref',
);
};

View file

@ -34,7 +34,11 @@
{% block header %}
<header>
<div class="header__logo"></div>
<a class="header__logo"
href="{{ logoHref }}"
target="_self"
aria-label="{{ logoAriaLabel }}">
</a>
</header>
{% endblock %}
@ -43,18 +47,22 @@
{% block footer %}
<footer>
<a class="footer__link footer__instagram-link"
href="{{ instagram }}"
target="_blank"
aria-label="Go to {{ site.title }}'s Instagram profile">
{{ svg('images/feather-instagram-custom.svg') | raw }}
</a>
<a class="footer__link footer__mail-link"
href="mailto:{{ email }}"
target="_blank"
aria-label="Write an email to {{ site.title }}">
{{ svg('images/feather-mail-custom.svg') | raw }}
</a>
{% if instagram.isNotEmpty %}
<a class="footer__link footer__instagram-link"
href="{{ instagram }}"
target="_blank"
aria-label="Go to {{ site.title }}'s Instagram profile">
{{ svg('images/feather-instagram-custom.svg') | raw }}
</a>
{% endif %}
{% if email.isNotEmpty %}
<a class="footer__link footer__mail-link"
href="mailto:{{ email }}"
target="_blank"
aria-label="Write an email to {{ site.title }}">
{{ svg('images/feather-mail-custom.svg') | raw }}
</a>
{% endif %}
</footer>
{% endblock %}

9
site/templates/cv.twig Normal file
View file

@ -0,0 +1,9 @@
{% extends "base.twig" %}
{% block main %}
<main class="cv">
<section class="cv__content">{{ cv | raw }}</section>
</main>
{% endblock %}