Material design for blog on large screens
This commit is contained in:
parent
83b4d26752
commit
96cc249f9d
19 changed files with 1327 additions and 898 deletions
|
@ -36,7 +36,7 @@ class ArticleGenerator {
|
|||
|
||||
$article = file_get_contents($directory . $articlefile);
|
||||
|
||||
echo "<section>";
|
||||
echo "<section class='card'>";
|
||||
|
||||
if(substr($article, 0, 6) == "%TITLE"){
|
||||
$title = substr($article, 8, strpos($article, "\n") - 8);
|
||||
|
@ -45,13 +45,13 @@ class ArticleGenerator {
|
|||
} else {
|
||||
$link = "./?blog=$blog&article=" . substr($articlefile, 0, -3);
|
||||
}
|
||||
echo "<h2><a href='$link'>$title</a></h2>";
|
||||
echo "<a href='$link' class='headline'>$title</a>";
|
||||
$article = substr($article, strpos($article, "\n") + 1);
|
||||
}
|
||||
|
||||
if(substr($article, 0, 5) == "%DATE"){
|
||||
$date = substr($article, 7, strpos($article, "\n") - 7);
|
||||
echo "<small>$date</small>";
|
||||
echo "<span class='date'>$date</span>";
|
||||
$article = substr($article, strpos($article, "\n") + 1);
|
||||
}
|
||||
|
||||
|
@ -68,22 +68,26 @@ class ArticleGenerator {
|
|||
|
||||
//TODO Code detection
|
||||
|
||||
echo "<div class='articletext'>";
|
||||
|
||||
echo Parsedown::instance()
|
||||
->setBreaksEnabled(true)
|
||||
->text($article);
|
||||
|
||||
echo "<small>$author<br>";
|
||||
echo "</div>";
|
||||
|
||||
if($author != ""){
|
||||
echo "<span class='author'>$author</span>";
|
||||
}
|
||||
|
||||
foreach ($tags as $tag) {
|
||||
if($_GET['blog'] == ""){
|
||||
echo "<a href='./?tag=$tag'>$tag</a> ";
|
||||
echo "<a class='tag' href='./?tag=$tag'>$tag</a> ";
|
||||
} else {
|
||||
echo "<a href='./?blog=$blog&tag=$tag'>$tag</a> ";
|
||||
echo "<a class='tag' href='./?blog=$blog&tag=$tag'>$tag</a> ";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</small>";
|
||||
|
||||
echo "</section>" . "\n";
|
||||
|
||||
}
|
||||
|
|
|
@ -33,19 +33,17 @@ class BlogListGenerator {
|
|||
|
||||
function listBlog($directory, $blogname, $blogmaintitle)
|
||||
{
|
||||
echo "<p>";
|
||||
$blog = file_get_contents($directory . $blogname);
|
||||
$blog = $blog . "\n";
|
||||
if(substr($blog, 0, 6) == "%TITLE"){
|
||||
$blog = substr($blog, 8, strpos($blog, "\n") - 8);
|
||||
if($blog == "main"){
|
||||
echo "<a href='./'>$blogmaintitle</a>";
|
||||
echo "<a class='nav-item' href='./'>$blogmaintitle</a>";
|
||||
} else {
|
||||
$link = "./?blog=" . substr($blogname, 0, -3);
|
||||
echo "<a href='$link'>$blog</a>";
|
||||
echo "<a class='nav-item' href='$link'>$blog</a>";
|
||||
}
|
||||
}
|
||||
echo "</p>";
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -23,17 +23,19 @@ THE SOFTWARE.
|
|||
-->
|
||||
|
||||
<?php if($blogdisqus){ ?>
|
||||
<div id="disqus_thread"></div>
|
||||
<script type="text/javascript">
|
||||
/* * * CONFIGURATION VARIABLES * * */
|
||||
var disqus_shortname = '<?php echo $blogdisqus; ?>';
|
||||
|
||||
/* * * DON'T EDIT BELOW THIS LINE * * */
|
||||
(function() {
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
|
||||
<section class="card">
|
||||
<div id="disqus_thread"></div>
|
||||
<script type="text/javascript">
|
||||
/* * * CONFIGURATION VARIABLES * * */
|
||||
var disqus_shortname = '<?php echo $blogdisqus; ?>';
|
||||
|
||||
/* * * DON'T EDIT BELOW THIS LINE * * */
|
||||
(function() {
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
|
||||
</section>
|
||||
<?php } ?>
|
|
@ -1,14 +0,0 @@
|
|||
<!-- The following code displays the social buttons -->
|
||||
|
||||
<?php
|
||||
$url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
||||
?>
|
||||
|
||||
<div class="socialbar">
|
||||
<!--Twitter-->
|
||||
<a href="https://twitter.com/intent/tweet?text=Check out: <?php echo $post->title; ?> &url=<?php echo $url; ?>&original_referer=" target="blank"><img src="res/img/twttr.svg" class="socialimg"/></a>
|
||||
<!--Google+-->
|
||||
<a href="https://plus.google.com/share?url=<?php echo $url; ?>&hl=en-US" target="blank"><img src="res/img/gplus.svg" class="socialimg" /></a>
|
||||
<!--Facebook-->
|
||||
<a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $url; ?>&t=<?php echo $post->title; ?>" target="blank"><img src="res/img/fb.png" class="socialimg" /></a>
|
||||
</div>
|
Reference in a new issue