Blogtitle in Header
This commit is contained in:
parent
cdfccd1754
commit
51cd71846b
6 changed files with 48 additions and 4 deletions
26
index.php
26
index.php
|
@ -33,7 +33,7 @@ THE SOFTWARE.
|
|||
$getblog = filter_input(INPUT_GET, "blog");
|
||||
$getarticle = filter_input(INPUT_GET, "article");
|
||||
$gettag = filter_input(INPUT_GET, "tag");
|
||||
$url = "http://" . filter_input(INPUT_SERVER, "HTTP_HOST") . filter_input(INPUT_SERVER, "REQUEST_URI");
|
||||
$url = "http://" . filter_input(INPUT_SERVER, "HTTP_HOST") . filter_input(INPUT_SERVER, "REQUEST_URI");
|
||||
?>
|
||||
|
||||
<head>
|
||||
|
@ -73,7 +73,7 @@ THE SOFTWARE.
|
|||
if (strlen($blog) >= 3 && substr($blog, -3) == ".md") {
|
||||
if ($getblog == "") {
|
||||
if ($blog != "main.md") {
|
||||
if(empty($blogmainname)){
|
||||
if (empty($blogmainname)) {
|
||||
$blogmaintitle = $blogtitle;
|
||||
} else {
|
||||
$blogmaintitle = $blogmainname;
|
||||
|
@ -82,7 +82,7 @@ THE SOFTWARE.
|
|||
}
|
||||
} else {
|
||||
if ($getblog . ".md" != $blog) {
|
||||
if(empty($blogmainname)){
|
||||
if (empty($blogmainname)) {
|
||||
$blogmaintitle = $blogtitle;
|
||||
} else {
|
||||
$blogmaintitle = $blogmainname;
|
||||
|
@ -114,7 +114,25 @@ THE SOFTWARE.
|
|||
<div class="main">
|
||||
<div class="header">
|
||||
<img src="./res/img/menu.svg" class="nav-img" />
|
||||
<nobr><a href="./" class="title"><?php echo $blogtitle; ?></a></nobr>
|
||||
<nobr><span class="title"><a href="./"><?php echo $blogtitle; ?>
|
||||
<?php
|
||||
if (empty($getblog)) {
|
||||
if (!empty($blogmainname)) {
|
||||
?>
|
||||
› <?php
|
||||
echo $blogmainname;
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
</a>
|
||||
› <a href="<?php echo "./?blog=$getblog"?>">
|
||||
<?php
|
||||
echo BlogListGenerator::getName("./blogs/$getblog.md");
|
||||
}
|
||||
?>
|
||||
</a>
|
||||
</span>
|
||||
</nobr>
|
||||
</div>
|
||||
<?php
|
||||
if (file_exists("blogs/$blog.md") && $getarticle == "" && $blogintro == "yes" && $gettag == "") {
|
||||
|
|
|
@ -67,6 +67,11 @@ body{
|
|||
left: 75px;
|
||||
}
|
||||
|
||||
.title > a{
|
||||
text-decoration: none;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.nav-img{
|
||||
height: 26px;
|
||||
padding: 19px;
|
||||
|
|
|
@ -44,5 +44,14 @@ class BlogListGenerator {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getName($file){
|
||||
$blog = file_get_contents($file);
|
||||
$blog = $blog . "\n";
|
||||
if(substr($blog, 0, 6) == "%TITLE"){
|
||||
$blog = substr($blog, 8, strpos($blog, "\n") - 8);
|
||||
return $blog;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -47,6 +47,10 @@ body{
|
|||
position: absolute;
|
||||
}
|
||||
|
||||
.title > a{
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.nav{
|
||||
background-color: #fff;
|
||||
border-right: 1px solid #e0e0e0;
|
||||
|
|
|
@ -43,6 +43,10 @@ body{
|
|||
position: absolute;
|
||||
}
|
||||
|
||||
.title > a{
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.nav{
|
||||
background-color: #424242;
|
||||
border-right: 1px solid #1f1f1f;
|
||||
|
|
|
@ -43,6 +43,10 @@ body{
|
|||
position: absolute;
|
||||
}
|
||||
|
||||
.title > a{
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.nav{
|
||||
background-color: #fff;
|
||||
border-right: 1px solid #e0e0e0;
|
||||
|
|
Reference in a new issue