started druapl theme leshed

This commit is contained in:
2026-07-13 16:24:52 +02:00
parent 688715e47f
commit 43113e662b
28 changed files with 3299 additions and 3 deletions
+1
View File
@@ -22,6 +22,7 @@
"drupal/core-recommended": "^10.6",
"drupal/migrate_google_sheets": "^2.3",
"drupal/migrate_tools": "^6.1",
"drupal/page_manager": "^4.0@RC",
"wikimedia/composer-merge-plugin": "^2.1"
},
"conflict": {
Generated
+73 -1
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "51a612b143ee94e10892bae56d14c801",
"content-hash": "ac449b2db370114a786d294bd986b5db",
"packages": [
{
"name": "asm89/stack-cors",
@@ -5531,6 +5531,77 @@
"slack": "#migrate"
}
},
{
"name": "drupal/page_manager",
"version": "4.0.0-rc4",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/page_manager.git",
"reference": "8.x-4.0-rc4"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/page_manager-8.x-4.0-rc4.zip",
"reference": "8.x-4.0-rc4",
"shasum": "978e7c033c9113a92de849bf0f03beaf6f3e7202"
},
"require": {
"drupal/core": "^9.5 || ^10 || ^11",
"drupal/ctools": "^3.15 || ^4.1"
},
"type": "drupal-module",
"extra": {
"drupal": {
"version": "8.x-4.0-rc4",
"datestamp": "1774940375",
"security-coverage": {
"status": "not-covered",
"message": "RC releases are not covered by Drupal security advisories."
}
},
"branch-alias": {
"dev-8.x-4.x": "4.x-dev"
}
},
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0-or-later"
],
"authors": [
{
"name": "Tim Plunkett",
"homepage": "https://www.drupal.org/u/tim.plunkett",
"role": "Maintainer"
},
{
"name": "eclipsegc",
"homepage": "https://www.drupal.org/user/61203"
},
{
"name": "japerry",
"homepage": "https://www.drupal.org/user/45640"
},
{
"name": "joelpittet",
"homepage": "https://www.drupal.org/user/160302"
},
{
"name": "manuel.adan",
"homepage": "https://www.drupal.org/user/516420"
},
{
"name": "phenaproxima",
"homepage": "https://www.drupal.org/user/205645"
}
],
"description": "Provides a way to place blocks on a custom page.",
"homepage": "https://www.drupal.org/project/page_manager",
"support": {
"source": "https://git.drupal.org/project/page_manager.git",
"issues": "https://www.drupal.org/project/issues/page_manager",
"irc": "irc://irc.freenode.org/drupal-contribute"
}
},
{
"name": "drupal/pagerer",
"version": "3.1.1",
@@ -11885,6 +11956,7 @@
"drupal/maxlength": 10,
"drupal/menu_block": 20,
"drupal/menu_position": 20,
"drupal/page_manager": 5,
"drupal/path_alias_xt": 20,
"drupal/pathologic": 15,
"drupal/profile": 5,
+6
View File
@@ -54,6 +54,8 @@ module:
image: 0
inline_entity_form: 0
language: 0
layout_builder: 0
layout_discovery: 0
link: 0
link_attributes: 0
linkit: 0
@@ -72,6 +74,8 @@ module:
node: 0
options: 0
page_cache: 0
page_manager: 0
page_manager_ui: 0
pagerer: 0
path: 0
path_alias: 0
@@ -107,4 +111,6 @@ module:
theme:
seven: 0
adminimal_theme: 0
stark: 0
leshed: 0
profile: figli_starter_kit
+12
View File
@@ -0,0 +1,12 @@
uuid: f3e3d3b8-ba2d-4c20-b368-bbbfe1b8f5ce
langcode: fr
status: true
dependencies: { }
id: home
label: Home
description: ''
use_admin_theme: false
path: /home
access_logic: and
access_conditions: { }
parameters: { }
@@ -0,0 +1,18 @@
uuid: 4882a420-a3d2-4c11-b38d-0d7bd7372336
langcode: fr
status: true
dependencies: { }
_core:
default_config_hash: RCVWP-yHwxSNiQORMIabDgHMEVqOMW58w80BQgRFJ4k
id: node_view
label: 'Vue du nœud'
description: 'When enabled, this overrides the default Drupal behavior for displaying nodes at <em>/node/{node}</em>. If you add variants, you may use selection criteria such as node type or language or user access to provide different views of nodes. If no variant is selected, the default Drupal node view will be used. This page only affects nodes viewed as pages, it will not affect nodes viewed in lists or at other locations.'
use_admin_theme: false
path: '/node/{node}'
access_logic: and
access_conditions: { }
parameters:
node:
machine_name: node
label: Nœud
type: 'entity:node'
@@ -0,0 +1,60 @@
uuid: 2c2a0935-3f55-4a6e-a4ac-592e546657f8
langcode: fr
status: true
dependencies:
config:
- page_manager.page.home
- views.view.home
module:
- layout_builder
- views
id: home-layout_builder-0
label: 'Layout Builder'
weight: 0
variant: layout_builder
variant_settings:
id: layout_builder
label: null
weight: 0
uuid: 5e526712-83fd-4aeb-83b6-974ad13c73bd
sections:
-
layout_id: layout_twocol_section
layout_settings:
label: ''
context_mapping: { }
column_widths: 50-50
components:
befea5c2-ca15-453e-b3fa-3a5cd4964d39:
uuid: befea5c2-ca15-453e-b3fa-3a5cd4964d39
region: first
configuration:
id: 'views_block:home-block_1'
label: ''
label_display: '0'
provider: views
context_mapping: { }
views_label: ''
items_per_page: none
exposed: { }
weight: 0
additional: { }
f872a8d1-ade5-4443-8399-d58fabd16bf3:
uuid: f872a8d1-ade5-4443-8399-d58fabd16bf3
region: second
configuration:
id: 'views_block:home-block_2'
label: ''
label_display: '0'
provider: views
context_mapping: { }
views_label: ''
items_per_page: none
exposed: { }
weight: 0
additional: { }
third_party_settings: { }
page: home
selection_criteria: { }
selection_logic: and
static_context: { }
+1 -1
View File
@@ -8,7 +8,7 @@ slogan: ''
page:
403: ''
404: ''
front: /user/login
front: /home
admin_compact_mode: false
weight_select_max: 100
default_langcode: fr
+2 -1
View File
@@ -1,4 +1,5 @@
_core:
default_config_hash: TpdA4rsOBAawnqeon9A-Ooht_4VO3hHKib79xyHcTyg
admin: adminimal_theme
langcode: fr
admin: adminimal_theme
default: leshed
+461
View File
@@ -0,0 +1,461 @@
uuid: 6cad35b8-8332-4db2-a4a1-4cd81706925f
langcode: fr
status: true
dependencies:
config:
- core.entity_view_mode.node.teaser
- taxonomy.vocabulary.type_de_projet
content:
- 'taxonomy_term:type_de_projet:1c5e92c0-6d55-4cdd-83de-6914dc61346f'
- 'taxonomy_term:type_de_projet:69364af4-a6cf-408c-a03a-8efa83460a01'
- 'taxonomy_term:type_de_projet:6e187150-5f46-46ec-9b05-a6add0851f7a'
- 'taxonomy_term:type_de_projet:74ca42bd-d2d1-4e68-b684-5ccee09c3435'
- 'taxonomy_term:type_de_projet:8c83ec08-8c52-4636-8a9f-8d43ca6eaa96'
- 'taxonomy_term:type_de_projet:ab8d04d2-57ef-48e1-b1c9-17e7ff068534'
- 'taxonomy_term:type_de_projet:c8fe49b6-d54b-469b-b6a1-a28779c0759f'
- 'taxonomy_term:type_de_projet:dcfda362-9cff-4d7a-9a6d-bf8dd57c2de7'
- 'taxonomy_term:type_de_projet:f35aa501-6be1-478d-8a36-da8977836978'
module:
- datetime
- node
- taxonomy
- user
id: home
label: Home
module: views
description: ''
tag: ''
base_table: node_field_data
base_field: nid
display:
default:
id: default
display_title: Default
display_plugin: default
position: 0
display_options:
title: Home
fields:
title:
id: title
table: node_field_data
field: title
relationship: none
group_type: group
admin_label: ''
entity_type: node
entity_field: title
plugin_id: field
label: ''
exclude: false
alter:
alter_text: false
make_link: false
absolute: false
word_boundary: false
ellipsis: false
strip_tags: false
trim: false
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: string
settings:
link_to_entity: true
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
pager:
type: some
options:
offset: 0
items_per_page: 20
exposed_form:
type: basic
options:
submit_button: Appliquer
reset_button: false
reset_button_label: Réinitialiser
exposed_sorts_label: 'Trier par'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
access:
type: perm
options:
perm: 'access content'
cache:
type: tag
options: { }
empty: { }
sorts:
field_dates_value:
id: field_dates_value
table: node__field_dates
field: field_dates_value
relationship: none
group_type: group
admin_label: ''
plugin_id: datetime
order: DESC
expose:
label: ''
field_identifier: ''
exposed: false
granularity: second
arguments: { }
filters:
status:
id: status
table: node_field_data
field: status
entity_type: node
entity_field: status
plugin_id: boolean
value: '1'
group: 1
expose:
operator: ''
field_type_de_projet_target_id:
id: field_type_de_projet_target_id
table: node__field_type_de_projet
field: field_type_de_projet_target_id
relationship: none
group_type: group
admin_label: ''
plugin_id: taxonomy_index_tid
operator: or
value:
11: 11
1: 1
2: 2
group: 1
exposed: false
expose:
operator_id: ''
label: ''
description: ''
use_operator: false
operator: ''
operator_limit_selection: false
operator_list: { }
identifier: ''
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
reduce: false
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
reduce_duplicates: false
vid: type_de_projet
type: select
hierarchy: false
limit: true
error_message: true
save_lineage: false
force_deepest: false
parent: null
level_labels: ''
hierarchy_depth: 0
required_depth: 0
none_label: '- Please select -'
allow_unpublished: false
style:
type: default
row:
type: 'entity:node'
options:
view_mode: teaser
query:
type: views_query
options:
query_comment: ''
disable_sql_rewrite: false
distinct: false
replica: false
query_tags: { }
relationships: { }
header: { }
footer: { }
display_extenders: { }
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- 'user.node_grants:view'
- user.permissions
tags: { }
block_1:
id: block_1
display_title: 'Colone Gauche'
display_plugin: block
position: 2
display_options:
filters:
status:
id: status
table: node_field_data
field: status
entity_type: node
entity_field: status
plugin_id: boolean
value: '1'
group: 1
expose:
operator: ''
field_type_de_projet_target_id:
id: field_type_de_projet_target_id
table: node__field_type_de_projet
field: field_type_de_projet_target_id
relationship: none
group_type: group
admin_label: ''
plugin_id: taxonomy_index_tid
operator: or
value:
11: 11
1: 1
2: 2
group: 1
exposed: false
expose:
operator_id: ''
label: ''
description: ''
use_operator: false
operator: ''
operator_limit_selection: false
operator_list: { }
identifier: ''
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
reduce: false
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
reduce_duplicates: false
vid: type_de_projet
type: select
hierarchy: false
limit: true
error_message: true
save_lineage: false
force_deepest: false
parent: null
level_labels: ''
hierarchy_depth: 0
required_depth: 0
none_label: '- Please select -'
allow_unpublished: false
filter_groups:
operator: AND
groups:
1: AND
defaults:
filters: false
filter_groups: false
display_description: ''
display_extenders: { }
block_description: 'home gauche'
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- 'user.node_grants:view'
- user.permissions
tags: { }
block_2:
id: block_2
display_title: 'Colone Droite'
display_plugin: block
position: 2
display_options:
filters:
status:
id: status
table: node_field_data
field: status
entity_type: node
entity_field: status
plugin_id: boolean
value: '1'
group: 1
expose:
operator: ''
field_type_de_projet_target_id:
id: field_type_de_projet_target_id
table: node__field_type_de_projet
field: field_type_de_projet_target_id
relationship: none
group_type: group
admin_label: ''
plugin_id: taxonomy_index_tid
operator: or
value:
10: 10
7: 7
6: 6
4: 4
3: 3
5: 5
group: 1
exposed: false
expose:
operator_id: ''
label: ''
description: ''
use_operator: false
operator: ''
operator_limit_selection: false
operator_list: { }
identifier: ''
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
reduce: false
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
reduce_duplicates: false
vid: type_de_projet
type: select
hierarchy: false
limit: true
error_message: true
save_lineage: false
force_deepest: false
parent: null
level_labels: ''
hierarchy_depth: 0
required_depth: 0
none_label: '- Please select -'
allow_unpublished: false
field_type_de_projet_target_id_1:
id: field_type_de_projet_target_id_1
table: node__field_type_de_projet
field: field_type_de_projet_target_id
relationship: none
group_type: group
admin_label: ''
plugin_id: taxonomy_index_tid
operator: not
value:
11: 11
1: 1
2: 2
group: 1
exposed: false
expose:
operator_id: ''
label: ''
description: ''
use_operator: false
operator: ''
operator_limit_selection: false
operator_list: { }
identifier: ''
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
reduce: false
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
reduce_duplicates: false
vid: type_de_projet
type: select
hierarchy: false
limit: true
error_message: true
save_lineage: false
force_deepest: false
parent: null
level_labels: ''
hierarchy_depth: 0
required_depth: 0
none_label: '- Please select -'
allow_unpublished: false
filter_groups:
operator: AND
groups:
1: AND
defaults:
filters: false
filter_groups: false
display_description: ''
display_extenders: { }
block_description: 'home droite'
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- 'user.node_grants:view'
- user.permissions
tags: { }
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,32 @@
import axios from 'axios'
// https://github.com/alvar0hurtad0/drupal-vuejs-todo/blob/master/frontend/src/api/axiosInterceptor.js
// console.log('drupalSettings', drupalSettings)
console.log(window.location)
const JSONAPI = axios.create({
baseURL: `${window.location.origin}/jsonapi`,
withCredentials: true,
headers: {
Accept: 'application/vnd.api+json'
// Authorization: 'Basic {token}',
// 'Content-Type': 'application/json'
}
})
JSONAPI.interceptors.response.use(
response => {
return Promise.resolve(response)
},
error => {
const { status } = error.response
console.warn('error in json-axios', status)
// if (status === 403) {
// window.location = '/'
// }
return Promise.reject(error)
}
)
export default JSONAPI
@@ -0,0 +1,45 @@
import axios from 'axios'
// https://github.com/alvar0hurtad0/drupal-vuejs-todo/blob/master/frontend/src/api/axiosInterceptor.js
// console.log('drupalSettings', drupalSettings)
// console.log('window.location.origin', window.location.origin)
// axios.interceptors.response.use(
// response => {
// return Promise.resolve(response)
// },
// error => {
// const { status } = error.response
// console.warn('error in rest-axios', status)
// if (status === 403) {
// window.location = '/'
// }
// return Promise.reject(error)
// }
// )
const REST = axios.create({
baseURL: `${window.location.origin}`,
withCredentials: true,
headers: {
// Authorization: 'Bearer {token}',
'Content-Type': 'application/json'
}
})
REST.interceptors.response.use(
response => {
return Promise.resolve(response)
},
error => {
const { status } = error.response
console.warn('error in rest-axios', status)
// if (status === 403) {
// window.location = '/'
// }
return Promise.reject(error)
}
)
export default REST
+121
View File
@@ -0,0 +1,121 @@
// import { createApp } from 'vue'
import '../scss/main.scss'
// import Content from './vuejs/Content.vue'
// import REST from './api/rest-axios'
// import LocomotiveScroll from 'locomotive-scroll';
// const scroll = new LocomotiveScroll();
// /**
// * @file
// * https://www.drupal.org/docs/drupal-apis/javascript-api/javascript-api-overview
// */
// (function (Drupal) {
// 'use strict';
// Drupal.behaviors.leshed = {
// attach: function (context, settings) {
// console.log('It works!');
// }
// };
// } (Drupal));
(function (Drupal, drupalSettings) {
const LeShedTheme = function () {
const _is_front = drupalSettings.path.isFront
console.log('drupalSettings', drupalSettings)
// ___ _ _
// |_ _|_ _ (_) |_
// | || ' \| | _|
// |___|_||_|_|\__|
function init () {
console.log('LeShedTheme init()')
// initVues()
}
function onWindowResize() {
_cardsForms.forEach(({card, forme, formepos}) => {
// console.log(`card`, card, 'forme', forme, 'formepos', formepos);
forme.style.top = `${card.offsetTop + formepos.top}px`;
forme.style.left = `${card.offsetLeft + formepos.left}px`;
})
}
// function initVues(){
// console.log('initVues');
// // initVueContent();
// }
// function initVueContent(){
// createApp(Content).mount('main[role="main"]');
// // processEtapeLinks();
// }
// function onClickEtapeLink(e){
// e.preventDefault();
// let a = e.currentTarget;
// let nid = a.dataset.nodeNid;
// console.log(nid);
// getNodeData(nid);
// return null;
// }
// function processEtapeLinks(){
// let etape_link_fields = document.querySelectorAll('#etapes-liste div.views-field-title');
// etape_link_fields.forEach((field, index) => {
// let nid = null;
// let classList = field.classList;
// classList.forEach((classe) => {
// let reg = /data-node-(\d+)/;
// let result = classe.match(reg);
// if (result) {
// nid = result[1];
// console.log(nid);
// }
// })
// if (nid) {
// let a = field.querySelector('a');
// a.setAttribute('data-node-nid', nid);
// a.addEventListener('click', onClickEtapeLink);
// }
// })
// }
// function getNodeData(nid){
// const params = {
// }
// REST.get(`/node/${nid}?_format=json`, params)
// .then((data) => {
// console.log('user REST getUser data', data)
// })
// .catch(error => {
// console.warn('Issue with getNodedata', error)
// Promise.reject(error)
// })
// }
init()
} // end LeShedTheme()
LeShedTheme()
})(Drupal, drupalSettings)
@@ -0,0 +1,13 @@
<template>
<div>
hello HMR TROP TROP BIEN
</div>
</template>
<script>
</script>
<style>
</style>
@@ -0,0 +1,15 @@
@import "partials/colors";
@import "partials/fonts";
@import "partials/mixins";
a, a:visited{
text-decoration: none;
color: inherit;
transition: color 0.15s ease-out;
}
body{
margin: 0;
// background-color: green;
}
@@ -0,0 +1,3 @@
// $bleu_site: #1642bc;
// $bleu_typo: #0b1e52;
// $rose: #f661e2;
@@ -0,0 +1,29 @@
// @import "/assets/fonts/fredoka/stylesheet.css";
// @import "/assets/fonts/Schibsted_Grotesk/stylesheet.css";
// body{
// font-family: "Schibsted Grotesk";
// font-weight: normal;
// font-style: normal;
// color: $bleu_typo;
// }
// @mixin titre_h2{
// font-family: 'Fredoka';
// font-size: 3em;
// font-weight: 400;
// color: $bleu_typo;
// line-height: 1;
// }
// @mixin titre_h3{
// @include titre_h2();
// font-size: 2em;
// }
// @mixin titre_h4{
// @include titre_h2();
// font-size: 1.323em;
// }
@@ -0,0 +1,69 @@
@mixin menu-contenus{
ul,li{
padding: 0;
margin:0;
list-style: none;
}
.wrapper{
position: relative;
}
label{
color:$bleu_site;
font-weight: 600;
display: block;
font-size: 0.756em;
padding:0 0 0.25em 0;
transition: color 0.25s ease-out;
position: absolute;
z-index: 0;
&:has(+ a:hover){
color: $rose;
}
}
a{
font-size: 1.13em;
transition: color 0.15s ease-out;
display: block;
position: relative;
z-index: 1;
padding-top: 1em;
&:hover{
color: $bleu_site;
}
}
}
@mixin card{
position: relative;
background-color: #fff;
padding:2em;
box-shadow: 0 0 10px rgba(0,0,0,0.25);
max-width: 50em;
box-sizing: content-box;
margin: 30vh auto 0;
&[role="home-presentation"]{
margin-top: 10vh;
}
}
@mixin arrow{
display: block;
width:30px; height:30px;
border-radius: 15px;
background-repeat: no-repeat;
background-position: center center;
background-size: contain;
text-indent: 100px;
overflow: hidden;
}
@mixin arrow-white{
@include arrow();
background-image: url('/themes/custom/mathallo/assets/img/arrow-white.svg');
}
@mixin arrow-blue{
@include arrow();
background-image: url('/themes/custom/mathallo/assets/img/arrow-blue.svg');
}
+25
View File
@@ -0,0 +1,25 @@
name: Le Shed
type: theme
base theme: stark
description: leshed drupal theme based on stark
package: leshed
core: 0.x
core_version_requirement: ^8 || ^9 || ^10 || ^11
# libraries:
# - caravane/global
regions:
header_top: 'Header-top'
header_left: 'Header-left'
header_center: 'Header-center'
header_right: 'Header-right'
header_bottom: 'Header-bottom'
primary_menu: 'Primary menu'
secondary_menu: 'Secondary menu'
page_top: 'Page top'
page_bottom: 'Page bottom'
featured: 'Featured'
breadcrumb: 'Breadcrumb'
content: 'Content'
sidebar_first: 'Sidebar first'
sidebar_second: 'Sidebar second'
footer: 'Footer'
@@ -0,0 +1,20 @@
# Main theme library.
global:
js:
assets/dist/main.js: {}
# assets/js/main.js: {}
css:
theme:
assets/dist/main.css: {}
# assets/scss/main.css: {}
vitehmr:
js:
http://localhost:5173/@vite/client:
type: external
attributes:
type: module
http://localhost:5173/assets/js/main.js:
type: external
attributes:
type: module
+102
View File
@@ -0,0 +1,102 @@
<?php
/**
* @file
* Functions to support theming in the leshed theme.
*/
function leshed_page_attachments_alter(&$page) {
if (getenv('APP_ENV') === 'development') {
// $attachments['#attached']['html_head'][] = [['src' => 'http://localhost:5173/@vite/client', 'type' => 'module'],'vite-client'];
// $page['#attached']['library'][] = 'http://localhost:5173/@vite/client';
// $attachments['#attached']['html_head'][] = [['src' => 'http://localhost:5173/assets/js/main.js', 'type' => 'module'],'vite-main'];
// $page['#attached']['library'][] = 'http://localhost:5173/assets/js/main.js';
$page['#attached']['library'][] = 'leshed/vitehmr';
}else{
$page['#attached']['library'][] = 'leshed/global';
}
}
/**
* Implements hook_preprocess_HOOK() for html.html.twig.
*/
function leshed_preprocess_html(&$variables) {
}
/**
* Implements hook_preprocess_HOOK() for page.html.twig.
*/
function leshed_preprocess_page(&$variables) {
}
function leshed_preprocess_region(&$variables) {
if (!isset($variables["attributes"]['class'])) {
$variables["attributes"]['class'] = [];
}
$variables["attributes"]['class'][] = "wrapper";
}
// function leshed_preprocess_block__leshed_contenu(&$variables) {
function leshed_preprocess_block__menu_block__contenu(&$variables) {
foreach ($variables['content']['#items'] as $key => $item) {
parse_menu_item($variables['content']['#items'], $key);
}
}
function parse_menu_item(&$items, $key){
if ($items[$key]['url']->getRouteName() === "entity.node.canonical") {
$nid = $items[$key]['url']->getRouteParameters()['node'];
$node = \Drupal\node\Entity\Node::load($nid);
// create prefix (label) for chapitres
if ($node->getType() === "chapitre") {
$chapitre = $node->get('field_chapitre_num')->getValue()[0]['value'];
$items[$key]['prefix'] = "Chapitre {$chapitre}";
}
// create prefix (label) for parties
if ($node->getType() === "partie") {
$partie = $node->get('field_partie')->getValue()[0]['value'];
$items[$key]['prefix'] = "Partie {$partie}";
}
// add active attribute
if ($items[$key]['in_active_trail']){
$items[$key]['attributes']->offsetSet('class', 'in-active-trail');
}
}
if (count($items[$key]['below']) > 0) {
foreach ($items[$key]['below'] as $key_b => $item_b) {
parse_menu_item($items[$key]['below'], $key_b);
}
}
}
/**
* Implements hook_preprocess_HOOK() for node.html.twig.
*/
function leshed_preprocess_node(&$variables) {
$node_type = $variables['node']->getType();
if (!isset($variables["attributes"]['class'])) {
$variables["attributes"]['class'] = [];
}
$variables["attributes"]['class'][] = "node-type-{$node_type}";
}
function leshed_preprocess_contanier(&$variables) {
}
/**
* Implements hook_preprocess_HOOK() for node.html.twig.
*/
function leshed_preprocess_field(&$variables) {
if (!isset($variables["title_attributes"]['class'])) {
$variables["title_attributes"]['class'] = [];
}
$variables['title_attributes']['class'][] = 'field-label';
if (!isset($variables["attributes"]['class'])) {
$variables["attributes"]['class'] = [];
}
$variables['attributes']['class'][] = $variables['field_name'];
}
File diff suppressed because it is too large Load Diff
+21
View File
@@ -0,0 +1,21 @@
{
"name": "leshed",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"axios": "^1.7.2",
"gsap": "^3.14.1",
"vue": "^3.4.29"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.5",
"sass": "^1.77.8",
"vite": "^5.3.1"
}
}
+6
View File
@@ -0,0 +1,6 @@
Sass
```
npm install
npm run scss
```
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

@@ -0,0 +1,49 @@
{#
/**
* @file
* Default theme implementation for the basic structure of a single Drupal page.
*
* Variables:
* - logged_in: A flag indicating if user is logged in.
* - root_path: The root path of the current page (e.g., node, admin, user).
* - node_type: The content type for the current node, if the page is a node.
* - head_title: List of text elements that make up the head_title variable.
* May contain one or more of the following:
* - title: The title of the page.
* - name: The name of the site.
* - slogan: The slogan of the site.
* - page_top: Initial rendered markup. This should be printed before 'page'.
* - page: The rendered page markup.
* - page_bottom: Closing rendered markup. This variable should be printed after
* 'page'.
* - db_offline: A flag indicating if the database is offline.
* - placeholder_token: The token for generating head, css, js and js-bottom
* placeholders.
*
* @see template_preprocess_html()
*
* @ingroup themeable
*/
#}
<!DOCTYPE html>
<html{{ html_attributes }}>
<head>
<head-placeholder token="{{ placeholder_token }}">
<title>{{ head_title|safe_join(' | ') }}</title>
<css-placeholder token="{{ placeholder_token }}">
<js-placeholder token="{{ placeholder_token }}">
</head>
<body{{ attributes }}>
{#
Keyboard navigation/accessibility link to main content section in
page.html.twig.
#}
<a href="#main-content" class="visually-hidden focusable">
{{ 'Skip to main content'|t }}
</a>
{{ page_top }}
{{ page }}
{{ page_bottom }}
<js-bottom-placeholder token="{{ placeholder_token }}">
</body>
</html>
+48
View File
@@ -0,0 +1,48 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { fileURLToPath, URL } from 'node:url'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
server: {
// The dev server must be reachable from the browser on the host.
host: 'localhost',
port: 5173,
strictPort: true,
// Since Vite 5.4.12 (CVE-2025-24010) CORS is disabled by default.
// Explicitly allow the origin(s) that serve the Drupal pages (vhost).
cors: {
origin: [/^https?:\/\/dev\.leshed\.fr(:\d+)?$/],
},
// Absolute base URL used by Vite to build asset/HMR URLs.
origin: 'http://localhost:5173',
hmr: {
host: 'localhost',
},
watch: {
usePolling: true,
},
},
build: {
outDir: 'assets/dist',
rollupOptions: {
input: 'assets/js/main.js',
output: {
entryFileNames: 'main.js',
assetFileNames: 'main.css'
}
}
},
resolve: {
alias: {
'@api': fileURLToPath(new URL('api', import.meta.url)),
// '@': fileURLToPath(new URL('./src', import.meta.url)),
// '@stores': fileURLToPath(new URL('./src/stores', import.meta.url)),
// '@components': fileURLToPath(new URL('./src/components', import.meta.url)),
// '@views': fileURLToPath(new URL('./src/views', import.meta.url)),
// // '@icons': fileURLToPath(new URL('./node_modules/vue-material-design-icons', import.meta.url)),
// '@node_modules': fileURLToPath(new URL('./node_modules', import.meta.url))
}
}
})