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;
|
padding: $sidebar-padding-y $sidebar-padding-x;
|
||||||
|
|
||||||
.header__logo {
|
.header__logo {
|
||||||
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: $logo-portrait-width;
|
width: $logo-portrait-width;
|
||||||
aspect-ratio: calc(1 / 2);
|
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)
|
// PAGES (INDEX)
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
|
@forward "cv";
|
||||||
@forward "home";
|
@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
|
en: Error
|
||||||
fr: Erreur
|
fr: Erreur
|
||||||
options:
|
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
|
duplicate: false
|
||||||
preview: false
|
preview: false
|
||||||
status:
|
status:
|
||||||
draft: true
|
|
||||||
unlisted: true
|
unlisted: true
|
||||||
sections:
|
sections:
|
||||||
images: sections/media-library_images
|
images: sections/media-library_images
|
||||||
|
|
|
@ -4,7 +4,7 @@ return [
|
||||||
// Kirby configuration settings
|
// Kirby configuration settings
|
||||||
'panel' => [
|
'panel' => [
|
||||||
'css' => 'build/panel.css',
|
'css' => 'build/panel.css',
|
||||||
'install' => true,
|
'install' => false,
|
||||||
'language' => 'fr',
|
'language' => 'fr',
|
||||||
'menu' => [
|
'menu' => [
|
||||||
'site' => [
|
'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
|
<?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
|
// Get items from image gallery structure field
|
||||||
$galleryItems = $site->image_gallery()->toStructure();
|
$galleryItems = $site->image_gallery()->toStructure();
|
||||||
|
|
||||||
// Get contact fields content
|
// Return merged arrays containing shared data and current controller data
|
||||||
$email = $site->email();
|
return A::merge(
|
||||||
$instagram = $site->instagram();
|
$shared,
|
||||||
|
compact(
|
||||||
return [
|
'galleryItems',
|
||||||
'galleryItems' => $galleryItems,
|
'logoAriaLabel',
|
||||||
'email' => $email,
|
'logoHref',
|
||||||
'instagram' => $instagram,
|
)
|
||||||
];
|
);
|
||||||
};
|
};
|
||||||
|
|
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 %}
|
{% block header %}
|
||||||
<header>
|
<header>
|
||||||
<div class="header__logo"></div>
|
<a class="header__logo"
|
||||||
|
href="{{ logoHref }}"
|
||||||
|
target="_self"
|
||||||
|
aria-label="{{ logoAriaLabel }}">
|
||||||
|
</a>
|
||||||
</header>
|
</header>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
@ -43,18 +47,22 @@
|
||||||
|
|
||||||
{% block footer %}
|
{% block footer %}
|
||||||
<footer>
|
<footer>
|
||||||
|
{% if instagram.isNotEmpty %}
|
||||||
<a class="footer__link footer__instagram-link"
|
<a class="footer__link footer__instagram-link"
|
||||||
href="{{ instagram }}"
|
href="{{ instagram }}"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
aria-label="Go to {{ site.title }}'s Instagram profile">
|
aria-label="Go to {{ site.title }}'s Instagram profile">
|
||||||
{{ svg('images/feather-instagram-custom.svg') | raw }}
|
{{ svg('images/feather-instagram-custom.svg') | raw }}
|
||||||
</a>
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
{% if email.isNotEmpty %}
|
||||||
<a class="footer__link footer__mail-link"
|
<a class="footer__link footer__mail-link"
|
||||||
href="mailto:{{ email }}"
|
href="mailto:{{ email }}"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
aria-label="Write an email to {{ site.title }}">
|
aria-label="Write an email to {{ site.title }}">
|
||||||
{{ svg('images/feather-mail-custom.svg') | raw }}
|
{{ svg('images/feather-mail-custom.svg') | raw }}
|
||||||
</a>
|
</a>
|
||||||
|
{% endif %}
|
||||||
</footer>
|
</footer>
|
||||||
{% endblock %}
|
{% 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