]> git.bochard.net Git - mysite.git/commitdiff
updated head.php for no meta description and added new entry
authorbochard <git@bochard.net>
Tue, 5 Aug 2025 14:55:55 +0000 (22:55 +0800)
committerbochard <git@bochard.net>
Tue, 5 Aug 2025 14:55:55 +0000 (22:55 +0800)
journal/20250805.php [new file with mode: 0644]
parts/head.php

diff --git a/journal/20250805.php b/journal/20250805.php
new file mode 100644 (file)
index 0000000..af25d27
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+  require_once("{$_SERVER['DOCUMENT_ROOT']}/parts/head.php");
+  $pgtitle = "University orientation";
+  $pgdescription = "";
+  $pgcss = ["journal.css"];
+  head($pgtitle, $pgdescription, $pgcss);
+?>
+<body>    
+  <table id="content">
+    <tr>
+      <?php include_once("$parts/sidebar.php");?>
+      
+      <td id="body">
+        <h1 class="entry-title">University orientation</h1>
+        <p class="written-date">Written in 2025, 5th of August</p>
+        <hr>
+        <p></p>
+      </td>
+    </tr>
+    
+               <?php include_once("$parts/footer.php");?>
+  </table>
+</body>
+</html>
index 59e30228ecfae1a1d69cf6fd1caf7da3d4af8325..f8f2e7a1318f6a5a57ac2d7482acd2124d554770 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 $parts = "{$_SERVER['DOCUMENT_ROOT']}/parts";
-function head($pgtitle, $pgdescription, $pgcss = []){?>
+function head($pgtitle, $pgdescription = null, $pgcss = []){?>
   <!DOCTYPE html>
   <html lang="en">
   <head>
@@ -9,8 +9,13 @@ function head($pgtitle, $pgdescription, $pgcss = []){?>
       <link rel="shortcut icon" href="/images/icons/favicon.ico">
 
     <title><?= htmlspecialchars($pgtitle, ENT_COMPAT);?></title>
-    <meta name="description" content="<?= htmlspecialchars($pgdescription, ENT_COMPAT);?>">
-
+    <?php
+                       if($pgdescription){
+                               $content = htmlspecialchars($pgdescription, ENT_COMPAT);
+                               echo "<meta name=\"description\" content=\"$content\">";
+                       }
+    ?>
+    
     <link rel="stylesheet" href="/stylesheets/root.css?v=<?= filemtime("{$_SERVER['DOCUMENT_ROOT']}/stylesheets/root.css");?>">
     <link rel="stylesheet" href="/stylesheets/component.css?v=<?= filemtime("{$_SERVER['DOCUMENT_ROOT']}/stylesheets/component.css");?>">
     <?php foreach($pgcss as $filename):?>