1
0
mirror of https://github.com/til-schneider/slim-wiki.git synced 2025-08-08 09:36:42 +02:00

Added footer

This commit is contained in:
til-schneider
2015-12-21 13:52:42 +01:00
parent 8180d323fc
commit 4734839f93
6 changed files with 61 additions and 15 deletions

View File

@@ -28,6 +28,15 @@ table {
// See: https://github.com/less/less.js/issues/1903 // See: https://github.com/less/less.js/issues/1903
@small-screen-breakpoint: (@contentMaxWidth + 2 * @contentMinMarginX); @small-screen-breakpoint: (@contentMaxWidth + 2 * @contentMinMarginX);
html, body {
height: 100%;
}
#wrapper {
position: relative;
min-height: 100%;
}
.main-column { .main-column {
width: @contentMaxWidth; width: @contentMaxWidth;
margin: 0 auto; margin: 0 auto;
@@ -44,3 +53,14 @@ table {
top: 0; top: 0;
width: 100%; width: 100%;
} }
.content {
padding: 30px 0 150px;
}
footer {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
}

View File

@@ -2,7 +2,6 @@
font-size: 16px; font-size: 16px;
color: @colorText; color: @colorText;
line-height: 1.4; line-height: 1.4;
padding-top: 30px;
p, h5, h6 { p, h5, h6 {
margin: 15px 0; margin: 15px 0;

View File

@@ -26,3 +26,14 @@ a:hover, a:active {
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
} }
} }
footer {
height: 50px;
padding-top: 30px;
border-top: 1px solid #ddd;
color: #666;
background: #f5f5f5;
font-size: 13px;
text-shadow: 0 1px 0 #fff;
}

View File

@@ -1,3 +1,9 @@
<?php <?php
if (function_exists('date_default_timezone_set')) {
date_default_timezone_set('Europe/Berlin');
}
$config['wikiName'] = 'Slim Wiki'; $config['wikiName'] = 'Slim Wiki';
//$config['footerHtml'] = '&copy; Copyright 2000-'.date('Y').' My name';

View File

@@ -22,21 +22,28 @@
</head> </head>
<body> <body>
<nav class="breadcrumbs"><div class="main-column"><?php <div id="wrapper">
$isFirst = true; <nav class="breadcrumbs"><div class="main-column"><?php
foreach ($data['breadcrumbs'] as $item) { $isFirst = true;
if (! $isFirst) { foreach ($data['breadcrumbs'] as $item) {
echo ' / '; if (! $isFirst) {
echo ' / ';
}
if ($item['active']) {
echo $item['name'];
} else {
?><a href="<?php echo $data['basePath'] . $item['path']; ?>"><?php echo $item['name']; ?></a><?php
}
$isFirst = false;
} }
if ($item['active']) { ?></div></nav>
echo $item['name']; <article class="content main-column"><?php echo $data['articleHtml']; ?></article>
} else { <?php
?><a href="<?php echo $data['basePath'] . $item['path']; ?>"><?php echo $item['name']; ?></a><?php if (isset($data['footerHtml'])) {
} ?><footer><div class="main-column"><?php echo $data['footerHtml']; ?></div></footer><?php
$isFirst = false;
} }
?></div></nav> ?>
<article class="content main-column"><?php echo $data['articleHtml']; ?></article> </div>
</body> </body>
<!-- build:js client/view.js --> <!-- build:js client/view.js -->

View File

@@ -21,7 +21,10 @@ class Main {
$data = array(); $data = array();
$data['baseUrl'] = $baseUrl; $data['baseUrl'] = $baseUrl;
$data['basePath'] = $basePath; $data['basePath'] = $basePath;
$data['wikiName'] = $config['wikiName'];
foreach (array('wikiName', 'footerHtml') as $key) {
$data[$key] = $config[$key];
}
$data['breadcrumbs'] = $this->createBreadcrumbs($articleBaseDir, $requestPathArray, $config['wikiName']); $data['breadcrumbs'] = $this->createBreadcrumbs($articleBaseDir, $requestPathArray, $config['wikiName']);