début de mise en place de la toc. le design reste à voir
This commit is contained in:
parent
e210ed40f6
commit
0de3b29e8b
7 changed files with 44 additions and 2 deletions
|
|
@ -12,6 +12,14 @@ function allYears ($article) {
|
|||
return $years;
|
||||
}
|
||||
|
||||
function addAnchors($content) {
|
||||
$content = preg_replace_callback('/<h3>(.*?)<\/h3>/', function($matches) {
|
||||
$slug = Str::slug($matches[1]);
|
||||
return '<h3 id="' . $slug . '">' . $matches[1] . '</h3>';
|
||||
}, $content);
|
||||
return $content;
|
||||
}
|
||||
|
||||
function setTitleFontSizeClass($title, $level = 'h1')
|
||||
{
|
||||
$length = strlen($title);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue