post.html.php 9.6 KB

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