post.html.php 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <?php if (!defined('HTMLY')) die('HTMLy'); ?>
  2. <section class="mx-auto max-w-3xl sm:px-6 xl:max-w-5xl xl:px-0">
  3. <article>
  4. <div class="xl:divide-y xl:divide-gray-200 xl:dark:divide-gray-700">
  5. <header class="pt-6 xl:pb-6">
  6. <div class="space-y-1 text-center">
  7. <dl class="space-y-10">
  8. <div>
  9. <dt class="sr-only"><?php echo i18n('posted_on');?></dt>
  10. <dd class="text-base font-medium leading-6 text-gray-500 dark:text-gray-400"><time><?php echo format_date($p->date);?></time>
  11. • <span><img class="mr-2 inline-block rounded-full align-middle" src="<?php echo $p->authorAvatar;?>" width="24" height="24" alt="<?php echo $p->authorName;?>"/><a class="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400" href="<?php echo $p->authorUrl;?>"><?php echo $p->authorName;?></a></span>
  12. • <span class="text-primary-500"><?php echo $p->category;?></span>
  13. <?php if (authorized($p)):?> • <span><a href="<?php echo $p->url;?>/edit?destination=post"><?php echo i18n('edit');?></a></span><?php endif;?>
  14. </dd>
  15. </div>
  16. </dl>
  17. <div>
  18. <?php if (!empty($p->link)) {?>
  19. <h1 class="text-3xl font-extrabold leading-9 tracking-tight text-gray-900 dark:text-gray-100 sm:text-4xl sm:leading-10 md:text-5xl md:leading-14">
  20. <a href="<?php echo $p->link;?>" target="_blank"><?php echo $p->title;?>
  21. <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" style="display:inline-block;margin-left: 3px;" class=" bi bi-link-45deg" viewBox="0 0 16 16">
  22. <path d="M4.715 6.542 3.343 7.914a3 3 0 1 0 4.243 4.243l1.828-1.829A3 3 0 0 0 8.586 5.5L8 6.086a1 1 0 0 0-.154.199 2 2 0 0 1 .861 3.337L6.88 11.45a2 2 0 1 1-2.83-2.83l.793-.792a4 4 0 0 1-.128-1.287z"/>
  23. <path d="M6.586 4.672A3 3 0 0 0 7.414 9.5l.775-.776a2 2 0 0 1-.896-3.346L9.12 3.55a2 2 0 1 1 2.83 2.83l-.793.792c.112.42.155.855.128 1.287l1.372-1.372a3 3 0 1 0-4.243-4.243z"/>
  24. </svg>
  25. </a>
  26. </h1>
  27. <?php } else { ?>
  28. <h1 class="text-3xl font-extrabold leading-9 tracking-tight text-gray-900 dark:text-gray-100 sm:text-4xl sm:leading-10 md:text-5xl md:leading-14"><?php echo $p->title;?></h1>
  29. <?php } ?>
  30. </div>
  31. </div>
  32. </header>
  33. <div class="divide-y divide-gray-200 pb-8 dark:divide-gray-700">
  34. <div class="divide-y divide-gray-200 dark:divide-gray-700 xl:pb-0">
  35. <div class="prose max-w-none pb-8 pt-10 dark:prose-invert">
  36. <?php if (!empty($p->image)) {?>
  37. <img src="<?php echo $p->image;?>" width="100%" alt="<?php echo $p->title;?>">
  38. <?php } elseif (!empty($p->video)) {?>
  39. <div class="relative" style="padding-top: 56.25%">
  40. <iframe class="absolute inset-0 w-full h-full" src="https://www.youtube.com/embed/<?php echo get_video_id($p->video); ?>" frameborder="0" allowfullscreen></iframe>
  41. </div>
  42. <?php } elseif (!empty($p->audio)) {?>
  43. <iframe width="100%" height="100%" class="embed-responsive-item" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=<?php echo $p->audio;?>&amp;auto_play=false&amp;visual=true"></iframe>
  44. <?php } elseif (!empty($p->quote)) {?>
  45. <blockquote class="text-2xl italic font-bold leading-8 tracking-tight">
  46. <?php echo $p->quote;?>
  47. </blockquote>
  48. <?php } ?>
  49. <?php echo $p->body;?>
  50. </div>
  51. <div class="prose max-w-none pb-6 pt-6 text-sm text-gray-700 dark:text-gray-300 related-posts">
  52. <h2 class="text-xl text-gray-700 dark:text-gray-300"><?php echo i18n('related_posts');?></h2>
  53. <?php echo get_related($p->related);?>
  54. </div>
  55. <?php if (facebook() || disqus()): ?>
  56. <div class="pb-6 pt-6 text-center text-gray-700 dark:text-gray-300" id="comment">
  57. <?php if (facebook()): ?>
  58. <div class="fb-comments" data-href="<?php echo $p->url ?>" data-numposts="<?php echo config('fb.num') ?>" data-colorscheme="<?php echo config('fb.color') ?>"></div>
  59. <?php endif; ?>
  60. <?php if (disqus()): ?>
  61. <?php echo disqus($p->title, $p->url) ?>
  62. <div id="disqus_thread"></div>
  63. <?php endif; ?>
  64. </div>
  65. <?php endif;?>
  66. </div>
  67. <footer>
  68. <div class="divide-y divide-gray-200 text-sm font-medium leading-5 dark:divide-gray-700">
  69. <?php if (theme_config('post_tag')):?>
  70. <div class="py-4 xl:py-8">
  71. <h2 class="text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400"><?php echo i18n('tags');?></h2>
  72. <div class="flex flex-wrap">
  73. <span class="mr-3 text-sm font-medium uppercase text-primary-500" ><span class="tags"><?php echo $p->tag;?></span></span>
  74. </div>
  75. </div>
  76. <?php endif;?>
  77. <?php if (theme_config('post_navigation')):?>
  78. <div class="flex justify-between gap-4 py-4 xl:py-8">
  79. <?php if (!empty($prev)): ?>
  80. <div>
  81. <h2 class="text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400"><?php echo i18n('prev_post');?></h2>
  82. <div class="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400"><a class="break-words" href="<?php echo($prev['url']); ?>"><?php echo($prev['title']); ?></a></div>
  83. </div>
  84. <?php endif;?>
  85. <?php if (!empty($next)): ?>
  86. <div>
  87. <h2 class="text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400"><?php echo i18n('next_post');?></h2>
  88. <div class="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400"><a class="break-words" href="<?php echo($next['url']); ?>"><?php echo($next['title']); ?></a></div>
  89. </div>
  90. <?php endif;?>
  91. </div>
  92. <?php endif;?>
  93. <?php if (theme_config('recent_posts')):?>
  94. <div class="prose max-w-none pb-6 pt-6 text-sm text-gray-700 dark:text-gray-300 recent-posts">
  95. <h2 class="text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400"><?php echo i18n('recent_posts');?></h2>
  96. <?php echo recent_posts();?>
  97. </div>
  98. <?php endif;?>
  99. <?php if (theme_config('popular_posts')):?>
  100. <div class="prose max-w-none pb-6 pt-6 text-sm text-gray-700 dark:text-gray-300 recent-posts">
  101. <h2 class="text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400"><?php echo i18n('popular_posts');?></h2>
  102. <?php echo popular_posts();?>
  103. </div>
  104. <?php endif;?>
  105. <?php if (theme_config('tagcloud')):?>
  106. <div class="py-4 xl:py-8">
  107. <h2 class="text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400">Tag Cloud</h2>
  108. <div class="flex flex-wrap">
  109. <span class="mr-3 text-sm font-medium uppercase text-primary-500"><span class="tags"><?php echo tag_cloud();?></span></span>
  110. </div>
  111. </div>
  112. <?php endif;?>
  113. </div>
  114. <?php if (config('blog.enable') === 'true') {?>
  115. <div class="pt-4 xl:pt-8"><a class="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400" aria-label="Back to the blog" href="<?php echo site_url() . blog_path();?>">← <?php echo i18n('back_to');?> <?php echo blog_string();?></a></div>
  116. <?php } else {?>
  117. <div class="pt-4 xl:pt-8"><a class="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400" aria-label="Back to homepage" href="<?php echo site_url();?>">← <?php echo i18n('back_to');?> <?php echo i18n('homepage');?></a></div>
  118. <?php } ?>
  119. </footer>
  120. </div>
  121. </div>
  122. </article>
  123. </section>