Skip to content

Commit

Permalink
moves <h1> to page header
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Tessier committed Aug 18, 2019
1 parent 26c8340 commit b38c230
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions inc/pipelines.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ function makicatta_affichage_final_prive($texte) {
$texte = str_replace("<p class='pagination'><!-- pagination -->", '', $texte);
$texte = str_replace("<!-- /pagination --></p>", '', $texte);
$texte = str_replace("<table class='spip'>", "<table class='table table-striped'>", $texte);

// bouge le titre au bon endroit (inspiré de affichage_final_prive_title_auto)
if (($p = strpos($texte, '<!--h1-->')) !== false
and
(preg_match(",<h1[^>]*>(.+)</h1>,Uims", $texte, $match)
or preg_match(",<h[23][^>]*>(.+)</h[23]>,Uims", $texte, $match))
and $h1 = textebrut(trim($match[1]))
) {
$texte = str_replace($match[0], '', $texte);
$texte = substr_replace($texte, "<h1>" . $h1 . "</h1>", $p, 9);
}

return $texte;
}

Expand Down
1 change: 1 addition & 0 deletions prive/squelettes/header/dist.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-12">
<!--h1-->
#INCLURE{fond=prive/squelettes/top/#ENV{type-page},ajax=top,env}
</div><!-- /.col -->
</div><!-- /.row -->
Expand Down

0 comments on commit b38c230

Please sign in to comment.