Set up CV page
This commit is contained in:
parent
18c60b22cd
commit
098b8b8e0d
14 changed files with 117 additions and 31 deletions
|
@ -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
10
assets/css/pages/_cv.scss
Normal file
|
@ -0,0 +1,10 @@
|
|||
@use "../abstracts" as *;
|
||||
|
||||
// --------------------------------------------------
|
||||
// CV STYLE
|
||||
// --------------------------------------------------
|
||||
|
||||
.cv {
|
||||
|
||||
.cv__content {}
|
||||
}
|
|
@ -2,4 +2,5 @@
|
|||
// PAGES (INDEX)
|
||||
// --------------------------------------------------
|
||||
|
||||
@forward "cv";
|
||||
@forward "home";
|
||||
|
|
6
site/blueprints/pages/cv.yml
Normal file
6
site/blueprints/pages/cv.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
title: CV
|
||||
options:
|
||||
changeStatus: false
|
||||
duplicate: false
|
||||
status:
|
||||
listed: true
|
|
@ -2,4 +2,8 @@ title:
|
|||
en: Error
|
||||
fr: Erreur
|
||||
options:
|
||||
read: false
|
||||
changeStatus: false
|
||||
duplicate: false
|
||||
preview: false
|
||||
status:
|
||||
unlisted: true
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
title:
|
||||
en: Home
|
||||
fr: Accueil
|
||||
options:
|
||||
read: false
|
8
site/blueprints/pages/home.yml
Normal file
8
site/blueprints/pages/home.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
title:
|
||||
en: Home
|
||||
fr: Accueil
|
||||
options:
|
||||
changeStatus: false
|
||||
duplicate: false
|
||||
status:
|
||||
listed: true
|
|
@ -6,7 +6,6 @@ options:
|
|||
duplicate: false
|
||||
preview: false
|
||||
status:
|
||||
draft: true
|
||||
unlisted: true
|
||||
sections:
|
||||
images: sections/media-library_images
|
||||
|
|
|
@ -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
18
site/controllers/cv.php
Normal 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',
|
||||
)
|
||||
);
|
||||
};
|
|
@ -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
20
site/controllers/site.php
Normal 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',
|
||||
);
|
||||
};
|
|
@ -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
9
site/templates/cv.twig
Normal file
|
@ -0,0 +1,9 @@
|
|||
{% extends "base.twig" %}
|
||||
|
||||
{% block main %}
|
||||
<main class="cv">
|
||||
|
||||
<section class="cv__content">{{ cv | raw }}</section>
|
||||
|
||||
</main>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue