blog.html 11 KB

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