Código
El elemento de contenido Código permite mostrar código resaltado de los lenguajes más comunes.
Utiliza la biblioteca highlight.js.
PHP, estilo oscuro
<?php declare(strict_types=1); /* * This file is part of the "das" Extension for TYPO3 CMS. * * For the full copyright and license information, please read the * LICENSE file that was distributed with this source code. */ namespace Jp\Das\ViewHelpers; use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; class GetFileContentViewHelper extends AbstractViewHelper { public function initializeArguments(): void { $this->registerArgument('filepath', 'string', '', false); } /** * @return string */ public function render(): string { $fileContent = ''; $filePath = $this->arguments['filepath']; if ($filePath !== null && $filePath !== '') { if (str_starts_with($filePath, '/fileadmin')) { if (file_exists($filePath)) { $fileContent = file_get_contents($filePath); } } else { $fileContent = file_get_contents($filePath); } } return $fileContent; } }<?php declare(strict_types=1); /* * This file is part of the "das" Extension for TYPO3 CMS. * * For the full copyright and license information, please read the * LICENSE file that was distributed with this source code. */ namespace Jp\Das\ViewHelpers; use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; class GetFileContentViewHelper extends AbstractViewHelper { public function initializeArguments(): void { $this->registerArgument('filepath', 'string', '', false); } /** * @return string */ public function render(): string { $fileContent = ''; $filePath = $this->arguments['filepath']; if ($filePath !== null && $filePath !== '') { if (str_starts_with($filePath, '/fileadmin')) { if (file_exists($filePath)) { $fileContent = file_get_contents($filePath); } } else { $fileContent = file_get_contents($filePath); } } return $fileContent; } }
CSS, estilo claro
html,
body {
font-family: 'Open Sans', sans-serif
}
body {
margin-top: 126px
}
a:hover {
-webkit-transition: all 1s ease;
transition: all 1s ease;
}
img {
max-width: 100%;
height: auto
}
section {
float: left;
width: 100%;
background: #fff; /* fallback for old browsers */
padding: 2rem 0
}
.tx-das-bg-wrapper {
container-type: inline-size;
width: 100%;
}
h1,
h2,
h3,
h4,
h5 {
font-family: Oswald, arial, sans-serif
}
YAML, estilo oscuro
base: 'https://das.jaumepresas.com/'
baseVariants:
-
base: 'https://das.jaumepresas.com/'
condition: 'applicationContext == "Production"'
-
base: 'https://das.ddev.site/'
condition: 'applicationContext == "Development/DDEV"'
websiteTitle: Das
disableStaticFileCache: false
errorHandling:
-
errorCode: 404
errorHandler: Page
errorContentSource: 't3://page?uid=35'
languages:
-
title: English
enabled: true
languageId: 0
base: /
locale: en_GB.UTF-8
navigationTitle: English
flag: gb
hreflang: en-GB