blog.html 10 KB

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