chore(*): update posts
parent
060176f5eb
commit
8c37ec04e8
|
@ -1,54 +0,0 @@
|
|||
const cheerio = require('cheerio');
|
||||
|
||||
function addBanner(content) {
|
||||
const $ = cheerio.load(content, { decodeEntities: false });
|
||||
$('body > .section > .container').prepend(`
|
||||
<div id="icarus-notify-pre-release" class="notification is-warning">
|
||||
<button class="delete"></button>
|
||||
Now you are viewing the documentation of a pre-release version Icarus. Please be aware that content on this website are subject to change.
|
||||
</div>
|
||||
<script>
|
||||
!function () {
|
||||
function setCookie(name, value, days) {
|
||||
var expires = "";
|
||||
if (days) {
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
|
||||
expires = "; expires=" + date.toUTCString();
|
||||
}
|
||||
document.cookie = name + "=" + (value || "") + expires + "; path=/";
|
||||
}
|
||||
|
||||
function getCookie(name) {
|
||||
var nameEQ = name + "=";
|
||||
var ca = document.cookie.split(';');
|
||||
for (var i = 0; i < ca.length; i++) {
|
||||
var c = ca[i];
|
||||
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
||||
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function removeHtml(selector) {
|
||||
document.querySelector(selector).parentNode.removeChild(document.querySelector(selector));
|
||||
}
|
||||
|
||||
if (getCookie('icarus-notify-pre-release')) {
|
||||
removeHtml('#icarus-notify-pre-release');
|
||||
}
|
||||
if (document.querySelector('#icarus-notify-pre-release .delete')) {
|
||||
document.querySelector('#icarus-notify-pre-release .delete').addEventListener('click', function () {
|
||||
setCookie('icarus-notify-pre-release', true);
|
||||
removeHtml('#icarus-notify-pre-release');
|
||||
});
|
||||
}
|
||||
}();
|
||||
</script>
|
||||
`);
|
||||
return $.html();
|
||||
}
|
||||
|
||||
hexo.extend.filter.register('after_render:html', function (content, data) {
|
||||
return addBanner(content);
|
||||
});
|
|
@ -31,3 +31,5 @@ Finally, use the following command to start the Hexo local server and begin comp
|
|||
hexo s
|
||||
```
|
||||
> Don't forget to check out the [Getting Started](/hexo-theme-icarus/tags/Getting-Started/) series to help you master Icarus quickly! Also, you can fetch the [`site` branch](https://github.com/ppoffice/hexo-theme-icarus/tree/site) from the GitHub repository if you need more configuration examples.
|
||||
|
||||
<a style="background-color:black;color:white;text-decoration:none;padding:4px 6px;font-size:12px;line-height:1.2;display:inline-block;border-radius:3px" href="https://unsplash.com/@yazi0413?utm_medium=referral&utm_campaign=photographer-credit&utm_content=creditBadge" target="_blank" rel="noopener noreferrer" title="Download free do whatever you want high-resolution photos from Chandler Chen"><span style="display:inline-block;padding:2px 3px"><svg xmlns="http://www.w3.org/2000/svg" style="height:12px;width:auto;position:relative;vertical-align:middle;top:-1px;fill:white" viewBox="0 0 32 32"><title>unsplash-logo</title><path d="M20.8 18.1c0 2.7-2.2 4.8-4.8 4.8s-4.8-2.1-4.8-4.8c0-2.7 2.2-4.8 4.8-4.8 2.7.1 4.8 2.2 4.8 4.8zm11.2-7.4v14.9c0 2.3-1.9 4.3-4.3 4.3h-23.4c-2.4 0-4.3-1.9-4.3-4.3v-15c0-2.3 1.9-4.3 4.3-4.3h3.7l.8-2.3c.4-1.1 1.7-2 2.9-2h8.6c1.2 0 2.5.9 2.9 2l.8 2.4h3.7c2.4 0 4.3 1.9 4.3 4.3zm-8.6 7.5c0-4.1-3.3-7.5-7.5-7.5-4.1 0-7.5 3.4-7.5 7.5s3.3 7.5 7.5 7.5c4.2-.1 7.5-3.4 7.5-7.5z"></path></svg></span><span style="display:inline-block;padding:2px 3px">Chandler Chen</span></a>
|
|
@ -16,8 +16,13 @@ comment:
|
|||
notify: false
|
||||
verify: false
|
||||
placeholder: 快来评论吧
|
||||
meta:
|
||||
- name="robots";content="noindex, follow"
|
||||
plugins:
|
||||
gallery: true
|
||||
outdated-browser: true
|
||||
mathjax: true
|
||||
animejs: true
|
||||
back-to-top: true
|
||||
progressbar: true
|
||||
---
|
||||
作为静态网站生成器Hexo的一款主题,Icarus以简洁、现代和精美为设计理念。在灵活且强大的配置系统的助力下,用户可以自由实现单栏与多栏的灵活页面布局。同时,Icarus提供了丰富的插件与挂件供用户选择,让网站的个性化配置变得触手可及。此外,得力于全新设计的API,开发者可以更便捷地对Icarus进行深层定制。
|
||||
<!-- more -->
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 43f90c6da82fa3a2b64367eaf4308ea52078b9c1
|
||||
Subproject commit ab9dc95ffc3a461e2c3f64a0bc3dfd668733a8ed
|
Loading…
Reference in New Issue