diff --git a/.gitignore b/.gitignore index 80f408e..87a85d1 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ nbproject/ +.idea/ diff --git a/articles/example/2015-07-24-example.md b/articles/example/2015-07-24-example.md index c9865d0..baa9016 100644 --- a/articles/example/2015-07-24-example.md +++ b/articles/example/2015-07-24-example.md @@ -5,3 +5,5 @@ This is the official Rangitaki logo. ![The Rangitaki logo](media/example.png) + +It is saved in the example blog directory. diff --git a/index.php b/index.php index 094e3b6..601c8d8 100644 --- a/index.php +++ b/index.php @@ -33,18 +33,48 @@ $getblog = filter_input(INPUT_GET, "blog"); // getting the blog variable $getarticle = filter_input(INPUT_GET, "article"); // getting the article variable $gettag = filter_input(INPUT_GET, "tag"); // getting the tag variable $url = "http://" . filter_input(INPUT_SERVER, "HTTP_HOST") . filter_input(INPUT_SERVER, "REQUEST_URI"); // getting the url (used for sharing) + +// Fetching necessary information about the current article +// Set blog to "main" if on main blog, else to $getblog. This variable is needed later +if ($getblog == "") { + $blog = "main"; +} else { + $blog = $getblog; +} +$articlesdir = "./articles/$blog/"; // generate a variable with the articles directory +// Fetching the articles title +if (isset($getarticle)) { + $articletitle = ArticleGenerator::getTitle($articlesdir, $getarticle . '.md'); +} +// Make sure that the entry has a title, because main.md hasn't one +if (empty($blogmainname)) { + $blogmaintitle = $blogtitle; +} else { + $blogmaintitle = $blogmainname; +} +if (isset($getblog)) { + $subblogtitle = BlogListGenerator::getName('./blogs/' . $getblog . '.md'); +} else { + $subblogtitle = $blogmaintitle; +} +// Generate title for the html head +if (isset($getarticle)) { + $hd_subblog_title = $articletitle . ' - ' . $subblogtitle; +} else { + $hd_subblog_title = $subblogtitle; +} ?> - <?php echo $blogtitle; // Setting the blog article?> + <?php echo $hd_subblog_title; ?> - + @@ -53,7 +83,7 @@ $url = "http://" . filter_input(INPUT_SERVER, "HTTP_HOST") . filter_input(INPUT_ - + @@ -86,27 +116,24 @@ if ($nav_drawer == "yes") { ?>