blog.html 11 KB

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