static--front.html.php 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?php if (!defined('HTMLY')) die('HTMLy'); ?>
  2. <div class="space-y-2 pb-6 pt-6 md:space-y-5">
  3. <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-6xl md:leading-14"><?php echo $static->title;?></h1>
  4. <?php if (authorized($p)):?><span><a href="<?php echo $p->url;?>/edit?destination=post"><?php echo i18n('edit');?></a></span><?php endif;?>
  5. <div class="prose max-w-none text-lg leading-7 pb-6 text-gray-500 dark:text-gray-400 dark:prose-invert">
  6. <?php echo $static->body;?>
  7. </div>
  8. <?php if(theme_config('frontpage_posts')):?>
  9. <div class="space-y-2 md:space-y-5">
  10. <h2 class="text-2xl font-extrabold leading-9 tracking-tight text-gray-900 dark:text-gray-100 sm:text-4xl sm:leading-10 md:text-4xl md:leading-14"><?php echo i18n('recent_posts');?></h2>
  11. </div>
  12. <?php endif;?>
  13. </div>
  14. <?php if(theme_config('frontpage_posts')):?>
  15. <?php $posts = recent_posts(true);?>
  16. <?php $teaserType = config('teaser.type'); $readMore = config('read.more');?>
  17. <ul class="divide-y divide-gray-200 dark:divide-gray-700">
  18. <?php foreach ($posts as $p):?>
  19. <?php $img = get_image($p->body);?>
  20. <li class="py-12">
  21. <article>
  22. <div class="space-y-2 xl:grid xl:grid-cols-4 xl:items-baseline xl:space-y-0">
  23. <dl>
  24. <dt class="sr-only"><?php echo i18n('posted_on');?></dt>
  25. <dd class="text-base font-medium leading-6 text-gray-500 dark:text-gray-400"><time><?php echo format_date($p->date);?></time>
  26. <?php if (authorized($p)):?> • <span><a href="<?php echo $p->url;?>/edit?destination=post"><?php echo i18n('edit');?></a></span><?php endif;?>
  27. </dd>
  28. <?php if ($teaserType === 'trimmed') :?>
  29. <dt class="sr-only"><?php echo i18n('featured_image');?></dt>
  30. <dd class="pt-4 pr-6">
  31. <?php if (!empty($p->image)) {?>
  32. <a class="thumbnail" href="<?php echo $p->url;?>"><img src="<?php echo $p->image;?>" width="100%" alt="<?php echo $p->title;?>"></a>
  33. <?php } elseif (!empty($p->video)) {?>
  34. <a class="thumbnail" href="<?php echo $p->url;?>"><img src="//img.youtube.com/vi/<?php echo get_video_id($p->video);?>/sddefault.jpg" width="100%" alt="<?php echo $p->title;?>">
  35. <span class="thumb-icon">
  36. <svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="currentColor" class="bi bi-play" viewBox="0 0 16 16"><path d="M10.804 8 5 4.633v6.734zm.792-.696a.802.802 0 0 1 0 1.392l-6.363 3.692C4.713 12.69 4 12.345 4 11.692V4.308c0-.653.713-.998 1.233-.696z"/></svg>
  37. </span>
  38. </a>
  39. <?php } elseif (!empty($p->audio)) {?>
  40. <a class="thumbnail" href="<?php echo $p->url;?>">
  41. <img src="<?php echo theme_path();?>img/soundcloud.jpg" width="100%" alt="<?php echo $p->title;?>">
  42. <span class="thumb-icon">
  43. <svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="currentColor" class="bi bi-volume-up" viewBox="0 0 16 16"><path d="M11.536 14.01A8.47 8.47 0 0 0 14.026 8a8.47 8.47 0 0 0-2.49-6.01l-.708.707A7.48 7.48 0 0 1 13.025 8c0 2.071-.84 3.946-2.197 5.303z"/><path d="M10.121 12.596A6.48 6.48 0 0 0 12.025 8a6.48 6.48 0 0 0-1.904-4.596l-.707.707A5.48 5.48 0 0 1 11.025 8a5.48 5.48 0 0 1-1.61 3.89z"/><path d="M10.025 8a4.5 4.5 0 0 1-1.318 3.182L8 10.475A3.5 3.5 0 0 0 9.025 8c0-.966-.392-1.841-1.025-2.475l.707-.707A4.5 4.5 0 0 1 10.025 8M7 4a.5.5 0 0 0-.812-.39L3.825 5.5H1.5A.5.5 0 0 0 1 6v4a.5.5 0 0 0 .5.5h2.325l2.363 1.89A.5.5 0 0 0 7 12zM4.312 6.39 6 5.04v5.92L4.312 9.61A.5.5 0 0 0 4 9.5H2v-3h2a.5.5 0 0 0 .312-.11"/></svg>
  44. </span>
  45. </a>
  46. <?php } elseif (!empty($img)) {?>
  47. <a class="thumbnail" href="<?php echo $p->url;?>"><img src="<?php echo $img;?>" width="100%" alt="<?php echo $p->title;?>"></a>
  48. <?php } ?>
  49. </dd>
  50. <?php endif;?>
  51. </dl>
  52. <div class="space-y-5 xl:col-span-3">
  53. <div class="space-y-6">
  54. <div>
  55. <?php if (!empty($p->link)) {?>
  56. <h2 class="text-2xl font-bold leading-8 tracking-tight">
  57. <a class="text-gray-900 dark:text-gray-100" href="<?php echo $p->link;?>" target="_blank"><?php echo $p->title;?>
  58. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" style="display:inline-block;margin-left: 3px;" class=" bi bi-link-45deg" viewBox="0 0 16 16">
  59. <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"/>
  60. <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"/>
  61. </svg>
  62. </a>
  63. </h2>
  64. <?php } else { ?>
  65. <h2 class="text-2xl font-bold leading-8 tracking-tight">
  66. <a class="text-gray-900 dark:text-gray-100" href="<?php echo $p->url;?>"><?php echo $p->title;?></a>
  67. </h2>
  68. <?php } ?>
  69. <div class="flex flex-wrap">
  70. <span class="mr-3 text-sm font-medium uppercase text-primary-500"><span class="tags"><?php echo $p->tag;?></span></span>
  71. </div>
  72. </div>
  73. <div class="prose max-w-none text-gray-500 dark:text-gray-400 dark:prose-invert">
  74. <?php if ($teaserType !== 'trimmed') :?>
  75. <?php if (!empty($p->image)) {?>
  76. <img src="<?php echo $p->image;?>" width="100%" alt="<?php echo $p->title;?>">
  77. <?php } elseif (!empty($p->video)) {?>
  78. <div class="relative" style="padding-top: 56.25%">
  79. <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>
  80. </div>
  81. <?php } elseif (!empty($p->audio)) {?>
  82. <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>
  83. <?php } elseif (!empty($p->quote)) {?>
  84. <blockquote class="text-2xl italic font-bold leading-8 tracking-tight">
  85. <?php echo $p->quote;?>
  86. </blockquote>
  87. <?php } ?>
  88. <?php endif;?>
  89. <?php if (!empty($p->quote) && $teaserType === 'trimmed'):?>
  90. <blockquote class="text-2xl italic font-bold leading-8 tracking-tight" style="margin: 1.6em 0;">
  91. <?php echo $p->quote;?>
  92. </blockquote>
  93. <?php endif; ?>
  94. <?php echo get_teaser($p->body, $p->url);?>
  95. </div>
  96. </div>
  97. <?php if ($teaserType === 'trimmed'):?>
  98. <div class="text-base font-medium leading-6">
  99. <a class="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400" aria-label="<?php echo $p->title;?>" href="<?php echo $p->url;?>"><?php echo $readMore;?></a>
  100. </div>
  101. <?php endif;?>
  102. </div>
  103. </div>
  104. </article>
  105. </li>
  106. <?php endforeach;?>
  107. </ul>
  108. <?php if (config('blog.enable') === 'true'):?>
  109. <div style="border:none;text-align:right;"><a class="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400" aria-label="<?php echo i18n('all_blog_posts');?>" href="<?php echo site_url() . blog_path();?>"><?php echo i18n('all_blog_posts');?> →</a></div>
  110. <?php endif;?>
  111. <?php endif;?>