Explorar el Código

:recycle: Tranfsform included header into a common template

DricomDragon hace 2 años
padre
commit
1575d2d459
Se han modificado 2 ficheros con 102 adiciones y 113 borrados
  1. 0 47
      web/include/head.php
  2. 102 66
      web/templates/main.html

+ 0 - 47
web/include/head.php

@@ -1,47 +0,0 @@
-<head>
-    <meta charset="utf-8">
-
-    <!-- Smartphone responsive design -->
-    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
-
-    <!-- Favicon -->
-    <link rel="shortcut icon" href="/favicon.ico"/>
-
-    <!-- Description variables -->
-    <?php
-        $shareImg = "/include/images/avatar-cartoon600.png";
-        $author = "Jovian HERSEMEULE";
-        $description = "Le site officiel de Jovian Hersemeule";
-    ?>
-
-    <!-- Generic description -->
-    <meta name="description" content="<?php echo $description; ?>">
-    <meta name="author" content="<?php echo $author; ?>">
-
-    <!-- Google / Search Engine Tags -->
-    <meta itemprop="name" content="<?php echo $author; ?>">
-    <meta itemprop="description" content="<?php echo $description; ?>">
-    <meta itemprop="image" content="<?php echo $shareImg; ?>">
-
-    <!-- Facebook Meta Tags -->
-    <meta property="og:url" content="https://www.jovian-hersemeule.eu">
-    <meta property="og:type" content="website">
-    <meta property="og:title" content="<?php echo $author; ?>">
-    <meta property="og:description" content="<?php echo $description; ?>">
-    <meta property="og:image" content="<?php echo $shareImg; ?>">
-
-    <!-- Twitter Meta Tags -->
-    <meta name="twitter:card" content="summary_large_image">
-    <meta name="twitter:title" content="<?php echo $author; ?>">
-    <meta name="twitter:description" content="<?php echo $description; ?>">
-    <meta name="twitter:image" content="<?php echo $shareImg; ?>">
-
-    <!-- Meta Tags Generated via http://heymeta.com -->
-
-    <!-- Style sheet -->
-    <link href="/include/css/bootstrap.css" rel="stylesheet">
-    <link href="/include/css/custom/main.css" rel="stylesheet">
-    <link href="/include/css/custom/back-to-projects.css" rel="stylesheet">
-
-    <title><?php echo $title; ?> - Jovian Hersemeule</title>
-</head>

+ 102 - 66
web/templates/main.html

@@ -1,69 +1,105 @@
 <!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml" lang="$lang$" xml:lang="$lang$"$if(dir)$ dir="$dir$"$endif$>
-<head>
-  <meta charset="utf-8" />
-  <meta name="generator" content="pandoc" />
-  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
-$for(author-meta)$
-  <meta name="author" content="$author-meta$" />
-$endfor$
-$if(date-meta)$
-  <meta name="dcterms.date" content="$date-meta$" />
-$endif$
-$if(keywords)$
-  <meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" />
-$endif$
-  <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>
-  <style type="text/css">
-      code{white-space: pre-wrap;}
-      span.smallcaps{font-variant: small-caps;}
-      span.underline{text-decoration: underline;}
-      div.column{display: inline-block; vertical-align: top; width: 50%;}
-$if(quotes)$
-      q { quotes: "“" "”" "‘" "’"; }
-$endif$
-  </style>
-$if(highlighting-css)$
-  <style type="text/css">
-$highlighting-css$
-  </style>
-$endif$
-$for(css)$
-  <link rel="stylesheet" href="$css$" />
-$endfor$
-$if(math)$
-  $math$
-$endif$
-$for(header-includes)$
-  $header-includes$
-$endfor$
-</head>
-<body>
-$for(include-before)$
-$include-before$
-$endfor$
-$if(title)$
-<header id="title-block-header">
-<h1 class="title">$title$</h1>
-$if(subtitle)$
-<p class="subtitle">$subtitle$</p>
-$endif$
-$for(author)$
-<p class="author">$author$</p>
-$endfor$
-$if(date)$
-<p class="date">$date$</p>
-$endif$
-</header>
-$endif$
-$if(toc)$
-<nav id="$idprefix$TOC">
-$table-of-contents$
-</nav>
-$endif$
-$body$
-$for(include-after)$
-$include-after$
-$endfor$
-</body>
+    <head>
+        <meta charset="utf-8" />
+        <meta name="generator" content="pandoc" />
+        <!-- Smartphone responsive design -->
+        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+        $for(author-meta)$
+        <meta name="author" content="$author-meta$" />
+        <meta name="description" content="$description$">
+        $endfor$
+        $if(date-meta)$
+        <meta name="dcterms.date" content="$date-meta$" />
+        $endif$
+        $if(keywords)$
+        <meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" />
+        $endif$
+        <link rel="shortcut icon" href="/favicon.ico"/>
+
+        <!-- Google / Search Engine Tags -->
+        <meta itemprop="name" content="$author-meta$">
+        <meta itemprop="description" content="$description$">
+        <meta itemprop="image" content="$shareImg$">
+
+        <!-- Facebook Meta Tags -->
+        <meta property="og:url" content="https://www.jovian-hersemeule.eu">
+        <meta property="og:type" content="website">
+        <meta property="og:title" content="$title$">
+        <meta property="og:description" content="$description$">
+        <meta property="og:image" content="$shareImg$">
+
+        <!-- Twitter Meta Tags -->
+        <meta name="twitter:card" content="summary_large_image">
+        <meta name="twitter:title" content="$title$">
+        <meta name="twitter:description" content="$description$">
+        <meta name="twitter:image" content="$shareImg$">
+
+        <!-- Meta Tags Generated via http://heymeta.com -->
+
+        <!-- Style sheet -->
+        <link href="/include/css/bootstrap.css" rel="stylesheet">
+        <link href="/include/css/custom/main.css" rel="stylesheet">
+        <link href="/include/css/custom/back-to-projects.css" rel="stylesheet">
+        <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>
+        <style type="text/css">
+            code{white-space: pre-wrap;}
+            span.smallcaps{font-variant: small-caps;}
+            span.underline{text-decoration: underline;}
+            div.column{display: inline-block; vertical-align: top; width: 50%;}
+            $if(quotes)$
+            q { quotes: "“" "”" "‘" "’"; }
+            $endif$
+        </style>
+        $if(highlighting-css)$
+        <style type="text/css">
+        $highlighting-css$
+        </style>
+        $endif$
+
+        $for(css)$
+        <link rel="stylesheet" href="$css$" />
+        $endfor$
+
+        $if(math)$
+        $math$
+        $endif$
+
+        $for(header-includes)$
+        $header-includes$
+        $endfor$
+    </head>
+    <body>
+        $for(include-before)$
+        $include-before$
+        $endfor$
+        <main role="main" class="container">
+            $if(title)$
+            <header id="title-block-header" class="focus-center">
+                <h1 class="title">$title$</h1>
+                $if(subtitle)$
+                <p class="subtitle">$subtitle$</p>
+                $endif$
+                $for(author)$
+                <p class="author">$author$</p>
+                $endfor$
+                $if(date)$
+                <p class="date">$date$</p>
+                $endif$
+                $if(leadImgSrc)$
+                <img src="$leadImgSrc$"$if(leadImgAlt)$ alt="$leadImgAlt$"$endif$>
+                $endif$
+                </header>
+            $endif$
+            $if(toc)$
+            <nav id="$idprefix$TOC">
+            $table-of-contents$
+            </nav>
+            $endif$
+            $body$
+        </main>
+        $for(include-after)$
+        $include-after$
+        $endfor$
+    </body>
 </html>