blog.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. {% load static %}{% load day_util %}
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta charset="utf-8"/>
  6. <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/>
  7. <meta
  8. name="viewport"
  9. content="width=device-width, initial-scale=1, maximum-scale=2, user-scalable=no"
  10. />
  11. <meta
  12. name="description"
  13. content="{{ article.intro }}"
  14. />
  15. <meta name="keywords" content="{{ article.title }}"/>
  16. <meta name="author" content="CyberSicko"/>
  17. <meta name="theme-color" content="#ffffff"/>
  18. <title>{{ article.title }}-CyberSicko.net</title>
  19. <link
  20. rel="stylesheet"
  21. href="{% static 'semantic.min.css' %}"
  22. type="text/css"
  23. />
  24. <link
  25. rel="stylesheet"
  26. href="{% static 'photoswipe/photoswipe.css' %}"
  27. type="text/css"
  28. />
  29. <link rel="stylesheet" href="{% static 'highlightjs/styles/androidstudio.min.css' %}">
  30. <link rel="stylesheet" href="{% static 'css/fonts.css' %}">
  31. <link rel="shortcut icon" href="{% static 'favicon.ico' %}">
  32. <style type="text/css">
  33. blockquote {
  34. margin: 0;
  35. }
  36. blockquote {
  37. padding: 15px;
  38. background: #eee;
  39. }
  40. blockquote ::before {
  41. content: '\201C';
  42. }
  43. blockquote ::after {
  44. content: '\201D';
  45. }
  46. p {
  47. font-size: 1.2em;
  48. }
  49. body {
  50. padding-top: 54px;
  51. -webkit-font-smoothing: antialiased;
  52. -moz-font-smoothing: grayscale;
  53. }
  54. .ui.borderless.menu {
  55. background-color: #f8f8f8;
  56. {#box-shadow: none;#} flex-wrap: wrap;
  57. border: none;
  58. padding-left: 0;
  59. padding-right: 0;
  60. }
  61. .ui.borderless.menu .header.item {
  62. font-size: 18px;
  63. font-weight: 400;
  64. }
  65. .ui.mobile.only.grid .ui.menu .ui.vertical.menu {
  66. display: none;
  67. }
  68. .ui.mobile.only.grid .ui.vertical.menu .dropdown.icon {
  69. float: unset;
  70. }
  71. .ui.mobile.only.grid .ui.vertical.menu .dropdown.icon:before {
  72. content: "\f0d7";
  73. }
  74. .ui.mobile.only.grid .ui.vertical.menu .ui.dropdown.item .menu {
  75. position: static;
  76. width: 100%;
  77. background-color: unset;
  78. border: none;
  79. box-shadow: none;
  80. }
  81. .ui.mobile.only.grid .ui.vertical.menu .ui.dropdown.item .menu {
  82. margin-top: 6px;
  83. }
  84. .ui.container > .ui.message {
  85. background-color: rga(238, 238, 238);
  86. box-shadow: none;
  87. padding: 5rem 4rem;
  88. margin-top: 1rem;
  89. }
  90. .ui.message h1.ui.header {
  91. font-size: 4.5rem;
  92. }
  93. .ui.message p.lead {
  94. font-size: 1.3rem;
  95. color: #333333;
  96. line-height: 1.4;
  97. font-weight: 300;
  98. }
  99. .pre {
  100. background-color: antiquewhite;
  101. border-radius: 4px;
  102. }
  103. </style>
  104. </head>
  105. <body id="root">
  106. {% if is_login %}
  107. {% csrf_token %}
  108. {% endif %}
  109. <div class="ui tablet computer only padded grid">
  110. <div class="ui top fixed borderless fluid huge menu">
  111. <div class="ui container">
  112. <a href="/" class="header item"><img style="width: 7em;" src="{% static '/img.png' %}"/></a>
  113. <a href="/" class="item">主页</a>
  114. {% for item in category %}
  115. {# <li class="category_li"><a href="/category/{{ item.name }}?page=1">{{ item.name }}</a></li>#}
  116. <a class="{% if current_category != None and current_category == item.name %}
  117. active
  118. {% else %}
  119. {% endif %} item" href="/category/{{ item.name }}?page=1">{{ item.name }}</a>
  120. {% endfor %}
  121. <div class="right menu">
  122. <a href="/login" class="item"> <i class="icon share square"></i>
  123. Sign in</a>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. <div class="ui mobile only padded grid">
  129. <div class="ui top fixed borderless huge fluid menu">
  130. <a href="/" class="header item"><img style="width: 7em;" src="{% static '/img.png' %}"/></a>
  131. <div class="right menu">
  132. <div class="item">
  133. <button class="ui icon toggle basic button">
  134. <i class="content icon"></i>
  135. </button>
  136. </div>
  137. </div>
  138. <div class="ui vertical borderless fluid menu">
  139. <a href="/" class="item">主页</a>
  140. {% for item in category %}
  141. {# <li class="category_li"><a href="/category/{{ item.name }}?page=1">{{ item.name }}</a></li>#}
  142. <a class="{% if current_category != None and current_category == item.name %}
  143. active
  144. {% else %}
  145. {% endif %} item" href="/category/{{ item.name }}?page=1">{{ item.name }}</a>
  146. {% endfor %}
  147. <a href="/login" class="item"> <i class="icon share square"></i>
  148. Sign in</a>
  149. </div>
  150. </div>
  151. </div>
  152. <div class="ui grid stackable container">
  153. <div class="row" id="article">
  154. <div class="eleven wide column">
  155. <h1 class="ui large header">
  156. <div class="content">{{ article.title }}</div>
  157. </h1>
  158. <div class="ui comments" style="margin-top: 0">
  159. <div class="comment">
  160. <a class="avatar">
  161. <img src="/user_avatar/{{ article.user_id }}">
  162. </a>
  163. <div class="content">
  164. <a class="author">{{ article.user__first_name }}{{ article.user__last_name }}</a>
  165. <div class="metadata">
  166. <div class="date">发布于: {{ article.created_time|days_until }}</div>
  167. </div>
  168. <div class="text">hava a nice day.</div>
  169. </div>
  170. </div>
  171. </div>
  172. {% autoescape off %}
  173. {{ article.html_text }}
  174. {% endautoescape %}
  175. <div class="ui hidden divider"></div>
  176. </div>
  177. <div class="four wide right floated column">
  178. <h4 class="ui header">搜索</h4>
  179. <div id="search" class="ui category search">
  180. <div class="ui icon input">
  181. <input class="prompt" type="text" placeholder="搜索">
  182. <i class="search icon"></i>
  183. </div>
  184. </div>
  185. <h4 class="ui header">归档</h4>
  186. <div class="ui list">
  187. {% for record in records %}
  188. <a class="item" href="/date/{{ record.datetime }}?page=1">{{ record.datetime }}
  189. ({{ record.count }})</a>
  190. {% endfor %}
  191. </div>
  192. <h4 class="ui header">Top</h4>
  193. <div class="ui list">
  194. {% for tag in tags %}
  195. <a class="item" href="/tag/{{ tag.name }}?page=1">{{ tag.name }} ({{ tag.count }})</a>
  196. {% endfor %}
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. <footer style="margin-top: 50px" class="ui secondary segment">
  202. <div class="ui two column stackable grid">
  203. <div class="ten wide column">
  204. <img style="width: 8rem" src="{% static '/img.png' %}">
  205. <p> © 2023 - 2023 cybersicko.net - All Rights Reserved.</p>
  206. </div>
  207. <div class="six wide column">
  208. <div class="ui left aligned container" style="margin-top:10px">
  209. <a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=50019002503732"
  210. style="display:inline-block;text-decoration:none;height:20px;line-height:20px;"><img
  211. src="{% static '/备案图标.png' %}" style="float:left;"/>
  212. <p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;"> 渝公网安备
  213. 50019002503732号</p></a>
  214. <a rel="nofollow"
  215. href="http://beian.miit.gov.cn/publish/query/indexFirst.action"
  216. target="_blank"><p>皖ICP备2023011943号</p></a>
  217. </div>
  218. </div>
  219. </div>
  220. </footer>
  221. <script type="application/javascript" src="{% static 'js/jquery.min.js' %}"></script>
  222. <script type="application/javascript" src="{% static 'semantic.js' %}"></script>
  223. <script src="{% static 'highlightjs/highlight.min.js' %}"></script>
  224. <script type="application/javascript" src="{% static 'photoswipe/photoswipe.umd.min.js' %}"></script>
  225. <script type="application/javascript" src="{% static 'photoswipe/photoswipe-lightbox.umd.min.js' %}"></script>
  226. <script>
  227. $(document).ready(function () {
  228. $(".ui.toggle.button").click(function () {
  229. $(".mobile.only.grid .ui.vertical.menu").toggle(100);
  230. });
  231. $(".ui.dropdown").dropdown();
  232. });
  233. let imgs = $('#article').find('p>img')
  234. function getClass(width) {
  235. if (width > 35 && width < 150) {
  236. return 'ui small rounded image'
  237. } else if (width > 150 && width < 600) {
  238. return 'ui medium rounded image'
  239. } else if (width > 600) {
  240. return 'ui fluid rounded image'
  241. }
  242. }
  243. for (let i = 0; i < imgs.length; i++) {
  244. if ($(imgs[i]).attr('alt')) {
  245. let alt = $(imgs[i]).attr('alt')
  246. let src = $(imgs[i]).attr('src')
  247. $(imgs[i]).parent().html(`<a data-pswp-width="${alt.split(',')[0]}" data-pswp-height="${alt.split(',')[1]}" href="${src}"><img style="display: inline-block;" class="${getClass(alt.split(',')[0])}" width="${alt.split(',')[0]}" height="${alt.split(',')[1]}" data-magnify="gallery" data-src="${src}" src="${src}" data-href="${src}" "/></a>`)
  248. } else {
  249. let src = $(imgs[i]).attr('src')
  250. $(imgs[i]).parent().html(`<img style="display: inline-block;" class="ui fluid rounded image" src="${src}" />`)
  251. }
  252. }
  253. var lightbox = new PhotoSwipeLightbox({
  254. gallery: 'p',
  255. children: 'a[data-pswp-width]',
  256. // dynamic import is not supported in UMD version
  257. pswpModule: PhotoSwipe
  258. });
  259. lightbox.init();
  260. </script>
  261. <script>
  262. hljs.initHighlightingOnLoad();
  263. </script>
  264. </body>
  265. </html>