post.html.php 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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 class="inline-flex items-center gap-2 align-middle">
  12. <img class="inline-block rounded-full" src="<?php echo $p->authorAvatar;?>" width="24" height="24" alt="<?php echo $p->authorName;?>"/>
  13. <a class="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400" href="<?php echo $p->authorUrl;?>"><?php echo $p->authorName;?></a>
  14. </span>
  15. • <span class="text-primary-500"><?php echo $p->category;?></span>
  16. <?php if (authorized($p)):?> • <span><a href="<?php echo $p->url;?>/edit?destination=post"><?php echo i18n('edit');?></a></span><?php endif;?>
  17. </dd>
  18. </div>
  19. </dl>
  20. <div>
  21. <?php if (!empty($p->link)) {?>
  22. <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">
  23. <a href="<?php echo $p->link;?>" target="_blank"><?php echo $p->title;?>
  24. <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">
  25. <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"/>
  26. <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"/>
  27. </svg>
  28. </a>
  29. </h1>
  30. <?php } else { ?>
  31. <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>
  32. <?php } ?>
  33. </div>
  34. </div>
  35. </header>
  36. <div class="divide-y divide-gray-200 pb-8 dark:divide-gray-700">
  37. <div class="divide-y divide-gray-200 dark:divide-gray-700 xl:pb-0">
  38. <div class="prose max-w-none pb-8 pt-10 dark:prose-invert">
  39. <?php if (!empty($p->image)) {?>
  40. <img src="<?php echo $p->image;?>" width="100%" alt="<?php echo $p->title;?>">
  41. <?php } elseif (!empty($p->video)) {?>
  42. <div class="relative" style="padding-top: 56.25%">
  43. <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>
  44. </div>
  45. <?php } elseif (!empty($p->audio)) {?>
  46. <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>
  47. <?php } elseif (!empty($p->quote)) {?>
  48. <blockquote class="text-2xl italic font-bold leading-8 tracking-tight">
  49. <?php echo $p->quote;?>
  50. </blockquote>
  51. <?php } ?>
  52. <?php echo $p->body;?>
  53. </div>
  54. <div class="prose max-w-none pb-6 pt-6 text-sm text-gray-700 dark:text-gray-300 related-posts">
  55. <h2 class="text-xl text-gray-700 dark:text-gray-300"><?php echo i18n('related_posts');?></h2>
  56. <?php echo get_related($p->related);?>
  57. </div>
  58. <?php if (facebook() || disqus()): ?>
  59. <div class="pb-6 pt-6 text-center text-gray-700 dark:text-gray-300" id="comment">
  60. <?php if (facebook()): ?>
  61. <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>
  62. <?php endif; ?>
  63. <?php if (disqus()): ?>
  64. <?php echo disqus($p->title, $p->url) ?>
  65. <div id="disqus_thread"></div>
  66. <?php endif; ?>
  67. </div>
  68. <?php endif;?>
  69. </div>
  70. <footer>
  71. <div class="divide-y divide-gray-200 text-sm font-medium leading-5 dark:divide-gray-700">
  72. <?php if (theme_config('post_tag')):?>
  73. <div class="py-4 xl:py-8">
  74. <h2 class="text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400"><?php echo i18n('tags');?></h2>
  75. <div class="flex flex-wrap">
  76. <span class="mr-3 text-sm font-medium uppercase text-primary-500" ><span class="tags"><?php echo $p->tag;?></span></span>
  77. </div>
  78. </div>
  79. <?php endif;?>
  80. <?php if (theme_config('post_navigation')):?>
  81. <div class="flex justify-between gap-4 py-4 xl:py-8">
  82. <?php if (!empty($prev)): ?>
  83. <div>
  84. <h2 class="text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400"><?php echo i18n('prev_post');?></h2>
  85. <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>
  86. </div>
  87. <?php endif;?>
  88. <?php if (!empty($next)): ?>
  89. <div>
  90. <h2 class="text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400"><?php echo i18n('next_post');?></h2>
  91. <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>
  92. </div>
  93. <?php endif;?>
  94. </div>
  95. <?php endif;?>
  96. <?php if (theme_config('recent_posts')):?>
  97. <div class="prose max-w-none pb-6 pt-6 text-sm text-gray-700 dark:text-gray-300 recent-posts">
  98. <h2 class="text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400"><?php echo i18n('recent_posts');?></h2>
  99. <?php echo recent_posts();?>
  100. </div>
  101. <?php endif;?>
  102. <?php if (theme_config('popular_posts')):?>
  103. <div class="prose max-w-none pb-6 pt-6 text-sm text-gray-700 dark:text-gray-300 recent-posts">
  104. <h2 class="text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400"><?php echo i18n('popular_posts');?></h2>
  105. <?php echo popular_posts();?>
  106. </div>
  107. <?php endif;?>
  108. <?php if (theme_config('tagcloud')):?>
  109. <div class="py-4 xl:py-8">
  110. <h2 class="text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400">Tag Cloud</h2>
  111. <div class="flex flex-wrap">
  112. <span class="mr-3 text-sm font-medium uppercase text-primary-500"><span class="tags"><?php echo tag_cloud();?></span></span>
  113. </div>
  114. </div>
  115. <?php endif;?>
  116. </div>
  117. <?php if (config('blog.enable') === 'true') {?>
  118. <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>
  119. <?php } else {?>
  120. <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>
  121. <?php } ?>
  122. </footer>
  123. </div>
  124. </div>
  125. </article>
  126. </section>