fix cli-server
[mdref/mdref] / views / layout.phtml
index 6b18f856574c1146d560f06a90e374dac1cbe214..6cc571ba21b44ef569da08627d54063b57b7a4fc 100644 (file)
@@ -5,12 +5,17 @@
                <title>
                        <?php if (!empty($title)) : ?>
                                <?= $title ?> -
+                       <?php elseif (isset($entry)) : ?>
+                               <?= $entry ?> -
                        <?php endif; ?>
                        mdref
                </title>
-               <base href="<?= $baseUrl ?>">
-               <meta http-equiv="Content-Location" content="<?= $baseUrl . $ref ?>">
-               <link rel="stylesheet" href="index.css">
+               <?php if (isset($baseUrl)) : ?>
+                       <base href="<?= $baseUrl ?>">
+                       <meta http-equiv="Content-Location" content="<?= $baseUrl . $ref ?>">
+                       <link rel="stylesheet" href="index.css">
+               <?php endif; ?>
+               
                <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
        </head>
        <body>
@@ -23,7 +28,7 @@
                        <?php include __DIR__."/index.phtml" ?>
                <?php endif; ?>
 
-               <?php if ($_SERVER["SERVER_NAME"] != "localhost") : ?>
+               <?php if (@$_SERVER["SERVER_NAME"] != "localhost") : ?>
                <div id="disqus_thread"></div>
                <script>
                        var disqus_shortname = 'mdref';
@@ -39,6 +44,8 @@
                <footer>
                        <?php include __DIR__."/footer.phtml" ?>
                </footer>
-               <script src="index.js"></script>
+               <?php if (isset($baseUrl)) : ?>
+                       <script src="index.js"></script>
+               <?php endif; ?>
        </body>
 </html>