post.html.php 10 KB

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