load disqus only on request
[mdref/mdref] / views / layout.phtml
index 43463ca9f7a5c61328870298921972cceeb76395..e49d520fe8a9c66509d00ab6f77c69bc9e85ac31 100644 (file)
@@ -3,30 +3,50 @@
        <head>
                <meta charset="utf-8">
                <title>
-                       <?php if ($title) : ?>
-                               <?= $title ?> - mdref
-                       <?php else: ?>
-                               mdref
+                       <?php if (!empty($title)) : ?>
+                               <?= $title ?> -
+                       <?php elseif (isset($entry)) : ?>
+                               <?= $entry ?> -
                        <?php endif; ?>
+                       mdref
                </title>
-               <base href="<?= $baseUrl ?>">
-               <link rel="stylesheet" href="index.css">
-               <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
+               <meta name="viewport" content="width=1200, initial-scale=0.5">
+               <?php if (isset($baseUrl)) : ?>
+                       <base href="<?= $baseUrl ?>">
+                       <meta http-equiv="Content-Location" content="<?= $baseUrl . $ref ?>">
+                       <link rel="stylesheet" href="index.css">
+               <?php endif; ?>
+
+               <link href="https://fonts.googleapis.com/css?family=Inconsolata&amp;subset=latin-ext" rel="stylesheet">
+               <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
+               <link rel="shortcut icon" href="<?= $baseUrl . "favicon.ico" ?>">
        </head>
        <body>
+               <div class="page">
                <?php include __DIR__."/sidebar.phtml" ?>
-               
-               <?php if (isset($html)) : ?>
+               <?php if (isset($exception)) : ?>
+                       <?= \mdref\ExceptionHandler::htmlException($exception) ?>
+               <?php elseif (isset($entry)) : ?>
                        <?php include __DIR__."/mdref.phtml" ?>
                <?php else: ?>
                        <?php include __DIR__."/index.phtml" ?>
                <?php endif; ?>
 
-               <div id="disqus_thread"></div>
+                       <div id="disqus_thread"><button id="disqus_activator">Show <span> </span> Comment(s)</button></div>
+                       <script>
+                               var disqus_shortname = 'mdref';
+                               var disqus_identifier = '<?=$ref?>';
+                       </script>
+
+                       <footer>
+                               <?php include __DIR__."/footer.phtml" ?>
+
+                       </footer>
+               <?php if (isset($baseUrl)) : ?>
+
+                       <script src="index.js"></script>
+               <?php endif; ?>
 
-               <footer>
-                       <?php include __DIR__."/footer.phtml" ?>
-               </footer>
-               <script src="index.js"></script>
+               </div>
        </body>
 </html>