blog.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <!DOCTYPE html>
  2. <html lang='<?=$page->lang?>'>
  3. <head>
  4. <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
  5. <meta charset='utf-8'/>
  6. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
  7. <title><?=$page->title?></title>
  8. <link rel='shortcut icon' href='<?=$page->favicon?>'/>
  9. <!-- CSS files -->
  10. <link rel='stylesheet' type='text/css' href='<?=$static["css"]?>ui.css'/>
  11. <link rel='stylesheet' type='text/css' href='<?=$static["css"]?>blog.css'/>
  12. <!-- Script files -->
  13. <script type='text/javascript' src='<?=$static["script"]?>ui.js'></script>
  14. <script type='text/javascript' src='<?=$static["script"]?>blog.js'></script>
  15. <!-- Meta tags -->
  16. <link rel='canonical' href='<?=$page->canonical?>'/>
  17. <link rel='author' href='<?=$page->author?>'/>
  18. <link rel='publisher' href='<?=$page->author?>'/>
  19. <meta name='description' content='<?=$page->description?>'/>
  20. <meta property='og:title' content='<?=$page->title?>'/>
  21. <meta property='og:url' content='<?=$page->canonical?>'/>
  22. <meta property='og:description' content='<?=$page->description?>'/>
  23. <meta property='og:image' content='<?=$page->icon?>'/>
  24. <meta property='og:site_name' content='<?=$page->name?>'/>
  25. <meta property='og:type' content='website'/>
  26. <meta property='og:locale' content='<?=$page->lang?>'/>
  27. <meta name='twitter:card' content='summary'/>
  28. <meta name='twitter:title' content='<?=$page->title?>'/>
  29. <meta name='twitter:description' content='<?=$page->description?>'/>
  30. <meta name='twitter:image' content='<?=$page->icon?>'/>
  31. <meta name='twitter:url' content='<?=$page->canonical?>'/>
  32. <meta name='robots' content='index follow'/>
  33. </head>
  34. <body>
  35. <?php
  36. include $path["include"] . "header.php";
  37. ?>
  38. <main>
  39. <?php
  40. // TODO: Worth it?
  41. //include $path["inc"] . "blog-left.php";
  42. ?>
  43. <section id='post_list'>
  44. <h3>
  45. <?=$page->title?>
  46. </h3>
  47. <?php
  48. foreach($page->post as $post) {
  49. ?>
  50. <article>
  51. <h4>
  52. <a href='<?=$base_url?>/blog/<?=$post->permalink?>'><?=$post->title?></a>
  53. </h4>
  54. <?php
  55. if (sizeof($post->image) > 0){
  56. ?>
  57. <a href='<?=$base_url?>/blog/<?=$post->permalink?>'>
  58. <img alt='<?=$post->title?>' title='<?=$post->title?>' src='<?=$static["content"]?>blog/<?=$post->image[0]->image?>' srcset='<?=srcset("blog/" . $post->image[0]->image)?>'/>
  59. </a>
  60. <?php
  61. } // if (strlen($post->image) > 0)
  62. ?>
  63. <p>
  64. <?=cut_text($post->text, 100, $page->string["keep_reading"], $base_url . "/blog/" . $post->permalink)?>
  65. </p>
  66. <div class='post_details'>
  67. <div class='post_details_date'>
  68. <?=format_date($post->dtime, $page->lang, false)?>
  69. </div>
  70. <div class='post_details_tags'>
  71. <?php
  72. $tags = "";
  73. foreach($post->tag as $tag) {
  74. $tags = $tags . $tag . ", ";
  75. }
  76. substr($tags, 0, strlen($tags) - 2);
  77. ?>
  78. <?=$tags?>
  79. </div>
  80. <div class='post_details_comments'>
  81. <?php
  82. $comment = "";
  83. if (sizeof($post->comment) == 1){
  84. $comments = $page->string["comment_1"];
  85. }
  86. else if (sizeof($post->comment) == 0){
  87. $comments = $page->string["comment_0"];
  88. }
  89. else{
  90. $comments = str_replace("#", sizeof($post->comment), $page->string["comment_n"]);
  91. }
  92. ?>
  93. <?=$comments?>
  94. </div>
  95. </div>
  96. </article>
  97. <?php
  98. } // foreach($array as $item)
  99. ?>
  100. </section>
  101. <?php
  102. // TODO: Worth it?
  103. //include $path["inc"] . "blog-right.php";
  104. ?>
  105. </main>
  106. <?php
  107. include $path["include"] . "footer.php";
  108. ?>
  109. </body>
  110. </html>