Browse Source

Update

master
186526 7 months ago
parent
commit
24367743a9
Signed by: 186526 GPG Key ID: C7EB1E6B8CC5E51D
18 changed files with 2296 additions and 56 deletions
  1. 13
      .postcssrc.js
  2. 5
      _config.yml
  3. 6
      package.json
  4. 2
      source/_data/links.yml
  5. 2
      source/_posts/pwa-transformation.md
  6. 11
      source/_posts/run-with-aka.md
  7. 4
      source/about/index.md
  8. 10
      source/links/new.md
  9. 4
      themes/suka/layout/_plugin/comment/valine/main.ejs
  10. 42
      themes/suka/layout/layout.ejs
  11. 8
      themes/suka/package.json
  12. 20
      themes/suka/scripts/.postcssrc.js
  13. 15
      themes/suka/scripts/index.js
  14. 45
      themes/suka/scripts/postcss.js
  15. 2085
      themes/suka/source/css/fonts/noto.min.scss
  16. 20
      themes/suka/source/sw.js
  17. 26
      themes/suka/src/css/main.css
  18. 34
      themes/suka/yarn.lock

13
.postcssrc.js

@ -2,9 +2,20 @@ const cssnano = require('cssnano')
const autoprefixer = require('autoprefixer')
module.exports = {
plugins: [
autoprefixer(
{
browsers: ['ie >= 11']
}
),
require('postcss-nested'),
(()=>{
console.log('PostCSS Running...');
return require('postcss-css-variables')({
preserve:false,
});
})(),
cssnano({
preset: 'default',
}),
autoprefixer()
]
}

5
_config.yml

@ -124,11 +124,6 @@ feed:
content_limit:
content_limit_delim: " "
node_sass:
includePaths:
- "node_modules"
outputStyle: compressed
clean_css:
exclude:
- "css/*.min.css"

6
package.json

@ -27,15 +27,17 @@
"hexo-html-minifier": "^1.0.0",
"hexo-renderer-ejs": "^1.0.0",
"hexo-renderer-marked": "^3.0.0",
"hexo-renderer-sass": "^0.4.0",
"hexo-renderer-stylus": "^2.0.0",
"hexo-server": "^2.0.0",
"hexo-theme-landscape": "^0.0.3",
"hexo-uglify": "^2.0.0",
"node-fetch": "^2.6.1",
"node-sass": "^4.5.3",
"postcss": "^8.2.8",
"postcss-css-variables": "^0.17.0",
"postcss-load-config": "^3.0.1",
"postcss-nested": "^5.0.5",
"spectre.css": "^0.5.9",
"yarn": "^1.22.10"
}
}
}

2
source/_data/links.yml

@ -27,7 +27,7 @@
img: "https://cdn.jsdelivr.net/gh/ZikinCDN/[email protected]/2021/logo.jpg"
"Lam的闲聊客栈":
url: "https://blog.lamgc.moe"
text: "\"咸鱼佬\",\"闲聊\",\"技术讨论\",\"知识分享\""
text: "老咸鱼了 :P"
img: "https://blog.lamgc.moe/wp-content/uploads/2021/02/QQ%E5%9B%BE%E7%89%8720210212220847.jpg"
"申请友链":
url: "/links/new.html"

2
source/_posts/pwa-transformation.md

@ -85,7 +85,7 @@ thumbnail: https://cdn.jsdelivr.net/npm/[email protected]/toc/pwa/pwa.svg
`PWA` 简单、易读的名称,在没有足够空间时使用。
#### `shart_url`
#### `start_url`
用户启动时所加载的URL。

11
source/_posts/run-with-aka.md

@ -10,13 +10,20 @@ tags:
- WebSite
---
{% note warning %}
### 警告
AKA 将会在近期使用 [`sw2express`](https://git.186526.xyz/186526/sw2express) 进行重构。
KV 所存储的数据类型将不会兼容于旧版,届时会发布数据转换脚本。
{% endnote %}
> [AKA](https://github.com/186526/aka) (Also Known As) 是一个简洁,快速,前后端分离,运行于 `Cloudflare` 的短网址服务。
> <!-- more -->
> Demo: [186.rip](https://186.rip)
AKA 分别有两个 `Worker` 组成,分别是其的的前端以及后端,你需要在本地安装 `node > 12` 的环境来支持其部署。
<!-- more -->
## 本次部署所用环境
本次教程使用 `node v12.19.0` `wrangler 1.12.3` `Debian GNU/Linux 10 (buster) in a Docker Container , The Host uses Archlinux`

4
source/about/index.md

@ -3,5 +3,5 @@ title: 关于我
date: 2020-12-19 23:04:55
hide_license: true
---
Arknights / 24岁,是学生(破真 / 啥都不会 / Arch Linux / Love Javascript / A developer
[![186526's github stats](https://github-readme-stats.vercel.app/api?username=186526&count_private=true)](https://github.com/186526)
Arknights / 一般路过音游人 / 咱就一看动漫的 / 24岁,是一般普通屑学生(破真 / 啥都不会 / Arch Linux / Love JavaScript / A developer
[![186526's github stats](https://github-readme-stats.vercel.app/api?username=186526&count_private=true)](https://github.com/186526)

10
source/links/new.md

@ -10,7 +10,9 @@ hide_license: true
2. 不能使用免费域名(包括但不限于tk,ml,cf,ga,gq等,github.io,vercel.app等不包含在其中
3. 在下方评论申请或 Email `[email protected]`
name: 186526's Blog
url: "https://blog.186526.xyz"
text: ["啥都不会的屑","Arch Linux","吹水大师"]
img: https://i.186526.xyz/avatar
```yaml
"186526's Blog":
url: "https://blog.186526.xyz"
text: ["啥都不会的屑","Arch Linux","吹水大师"]
img: 'https://i.186526.xyz/avatar'
```

4
themes/suka/layout/_plugin/comment/valine/main.ejs

@ -16,7 +16,7 @@
var a = document.createElement("script"),d = document;
a.src = "https://cdn.jsdelivr.net/npm/@waline/[email protected]/dist/Waline.min.js";
(d.head || d.body).appendChild(a);
whenAvailable("Waline", () => {
whenAvailable("Waline", function(){
const Valine = Waline;
new Valine({
el: '#vcomments',
@ -53,7 +53,7 @@
document.dispatchEvent(new window.Event("LoadValine"));
valinedo();
if(!window.whenAvailable){
let whenAvailable = (name, callback) => {
let whenAvailable = function(name, callback){
var interval = 100;
window.setTimeout(function () {
if (window[name]) {

42
themes/suka/layout/layout.ejs

@ -5,18 +5,38 @@
<body>
<script type="text/javascript">
var ms_ie = false;
var ua = window.navigator.userAgent;
var old_ie = ua.indexOf('MSIE ');
var new_ie = ua.indexOf('Trident/');
if ((old_ie > -1) || (new_ie > -1)) {
ms_ie = true;
}
(function(){
function getBroswer(){
var sys = {};
var ua = navigator.userAgent.toLowerCase();
var s;
(s = ua.match(/edge\/([\d.]+)/)) ? sys.edge = s[1] :
(s = ua.match(/rv:([\d.]+)\) like gecko/)) ? sys.ie = s[1] :
(s = ua.match(/msie ([\d.]+)/)) ? sys.ie = s[1] :
(s = ua.match(/firefox\/([\d.]+)/)) ? sys.firefox = s[1] :
(s = ua.match(/chrome\/([\d.]+)/)) ? sys.chrome = s[1] :
(s = ua.match(/opera.([\d.]+)/)) ? sys.opera = s[1] :
(s = ua.match(/version\/([\d.]+).*safari/)) ? sys.safari = s[1] : 0;
if ( ms_ie ) {
document.body.innerHTML = '<div class="toast">去他妈的Internet Explorer,请使用现代浏览器访问该站点,例如<a href="http://aka.186526.xyz/Chrome">Chrome</a>、<a href="http://aka.186526.xyz/Firefox">Firefox</a>。</div>'+document.body.innerHTML;
}
if (sys.edge) return { broswer : "Edge", version : sys.edge };
if (sys.ie) return { broswer : "IE", version : sys.ie };
if (sys.firefox) return { broswer : "Firefox", version : sys.firefox };
if (sys.chrome) return { broswer : "Chrome", version : sys.chrome };
if (sys.opera) return { broswer : "Opera", version : sys.opera };
if (sys.safari) return { broswer : "Safari", version : sys.safari };
return { broswer : "", version : "0" };
}
var broswerUA = getBroswer();
if ( broswerUA.broswer == "IE" ) {
document.body.innerHTML = '<div class="toast">去他妈的Internet Explorer,请使用现代浏览器访问该站点,例如<a href="http://aka.186526.xyz/Chrome">Chrome</a>、<a href="http://aka.186526.xyz/Firefox">Firefox</a>。</div>'+document.body.innerHTML;
}else if(broswerUA.broswer == "chrome" && broswerUA.version <= 60 ){
document.body.innerHTML = '<div class="toast">摆脱旧版Chrome,请使用新版<a href="http://aka.186526.xyz/Chrome">Chrome</a>访问该站点。</div>'+document.body.innerHTML;
}
})()
</script>
<% if (theme.comment.use === 'facebook') { %>

8
themes/suka/package.json

@ -38,12 +38,16 @@
"cssnano": "^4.1.10",
"node-prismjs": "0.1.2",
"postcss": "^8.2.8",
"postcss-css-variables": "^0.17.0",
"postcss-load-config": "^3.0.1",
"postcss-nested": "^5.0.5",
"prismjs": "^1.17.1",
"qr-image": "3.2.0",
"spectre.css": "^0.5.9"
},
"browserslist":{
"browsers": ["Chrome >= 49"]
"browserslist": {
"browsers": [
"Chrome >= 49"
]
}
}

20
themes/suka/scripts/.postcssrc.js

@ -1,7 +1,17 @@
const cssnano = require('cssnano')
const autoprefixer = require('autoprefixer')
module.exports = {
// plugins: {
// autoprefixer: {
// browsers: ['>= chrome 49']
// }
// }
plugins: [
autoprefixer(),
require('postcss-nested'),
cssnano({
preset: 'default',
}),
(()=>{
console.log('POSTCSS Loading');
return require('postcss-css-variables')({
preserve:false,
});
})()
]
}

15
themes/suka/scripts/index.js

@ -40,4 +40,17 @@ hexo.extend.helper.register('console', function () {
if ((/3.[89]/).test(hexo.version)) {
hexo.extend.filter.unregister('after_render:html', require('../../../node_modules/hexo/lib/plugins/filter/meta_generator'));
}
}
/**
* note.js | https://theme-next.org/docs/tag-plugins/note/
*/
function postNote(args, content) {
return `<div class="note ${args.join(" ")}">
${hexo.render.renderSync({text: content, engine: "markdown"}).split("\n").join("")}
</div>`;
}
hexo.extend.tag.register("note", postNote, {ends: true});
hexo.extend.tag.register("subnote", postNote, {ends: true});

45
themes/suka/scripts/postcss.js

@ -2,14 +2,41 @@
var postcss = require('postcss');
var postcssrc = require('postcss-load-config');
//const config = require('./.postcssrc.js');
async function postcssdo(data) {
return await postcssrc()
.then(({ plugins, options }) => {
return postcss(plugins).process(data.text, options)
})
.then((result) => result.css)
var sass = require('node-sass')
const dosass = (ext) => function (data) {
var config = {
includePaths: ["node_modules"],
data: data.text,
file: data.path,
outputStyle: 'nested',
sourceComments: false,
indentedSyntax: (ext === 'sass')
};
try {
// node-sass result object:
// https://github.com/sass/node-sass#result-object
var result = sass.renderSync(config)
// result is now Buffer instead of String
// https://github.com/sass/node-sass/issues/711
return result.css.toString()
} catch (error) {
console.error(error.toString())
throw error
}
}
function postcssdo(ext) {
return async(data)=>{
const css = dosass(ext)(data);
const { plugins, options } = await postcssrc();
const result = await postcss(plugins).process(css, options);
return result.css;
}
}
hexo.extend.renderer.register('css', 'css', postcssdo)
hexo.extend.renderer.register('scss', 'css', postcssdo('scss'))
hexo.extend.renderer.register('sass', 'css', postcssdo('sass'))
hexo.extend.renderer.register('css', 'css', postcssdo('css'))

2085
themes/suka/source/css/fonts/noto.min.scss
File diff suppressed because it is too large
View File

20
themes/suka/source/sw.js

@ -9,7 +9,7 @@ const { CacheFirst, NetworkFirst, NetworkOnly, StaleWhileRevalidate } = strategi
const { ExpirationPlugin } = expiration;
const { CacheableResponsePlugin } = cacheableResponse;
const cacheSuffixVersion = '-210413a',
const cacheSuffixVersion = '-210418a',
// precacheCacheName = core.cacheNames.precache,
// runtimeCacheName = core.cacheNames.runtime,
maxEntries = 100;
@ -229,10 +229,24 @@ routing.registerRoute(
routing.registerRoute(
/.*blog\.186526\.xyz/,
new StaleWhileRevalidate({
cacheName: 'blog-' + cacheSuffixVersion,
})
);
routing.registerRoute(
/.*localhost/,
new StaleWhileRevalidate({
cacheName: 'blog-' + cacheSuffixVersion,
})
);
/*
* Default - Serve as it is
* StaleWhileRevalidate
*/
routing.setDefaultHandler(
new StaleWhileRevalidate()
);
new NetworkOnly()
);

26
themes/suka/src/css/main.css

@ -1268,4 +1268,30 @@ a.timeline-tile-title span:hover {
}
.link-img img {
border-radius: .5rem;
}
#post-content .note {
padding: 15px;
margin-bottom: 20px;
border-radius: .4rem;
border: 1px solid var(--timeline);
border-left-width: .25em;
}
#post-content .note.default {
border-left-color: #777
}
#post-content .note.primary {
border-left-color: #6f42c1
}
#post-content .note.info {
border-left-color: #428bca
}
#post-content .note.success {
border-left-color: #5cb85c
}
#post-content .note.warning {
border-left-color: #f0ad4e
}
#post-content .note.danger {
border-left-color: #d9534f
}

34
themes/suka/yarn.lock

@ -1270,7 +1270,7 @@ [email protected]^3.1.1:
resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==
[email protected]^1.0.2, [email protected]^1.0.5:
[email protected]^1.0.2, [email protected]^1.0.3, [email protected]^1.0.5:
version "1.0.5"
resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
@ -1493,7 +1493,7 @@ [email protected]^3.0.0, [email protected]^3.0.2:
assign-symbols "^1.0.0"
is-extendable "^1.0.1"
[email protected]^3.0.0:
[email protected]^3.0.0, [email protected]^3.0.1:
version "3.0.2"
resolved "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==
@ -3308,6 +3308,16 @@ [email protected]^4.0.1:
postcss "^7.0.0"
postcss-value-parser "^3.0.0"
[email protected]^0.17.0:
version "0.17.0"
resolved "https://registry.npmjs.org/postcss-css-variables/-/postcss-css-variables-0.17.0.tgz#56cba1d9f0360609136cfbfda8bbd2c1ed2e4082"
integrity sha512-/ZpFnJgksNOrQA72b3DKhExYh+0e2P5nEc3aPZ62G7JLmdDjWRFv3k/q4LxV7uzXFnmvkhXRbdVIiH5tKgfFNA==
dependencies:
balanced-match "^1.0.0"
escape-string-regexp "^1.0.3"
extend "^3.0.1"
postcss "^6.0.8"
[email protected]^4.0.2:
version "4.0.2"
resolved "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-4.0.2.tgz#1fbabd2c246bff6aaad7997b2b0918f4d7af4033"
@ -3406,6 +3416,13 @@ [email protected]^4.0.2:
postcss "^7.0.0"
postcss-selector-parser "^3.0.0"
[email protected]^5.0.5:
version "5.0.5"
resolved "https://registry.npmjs.org/postcss-nested/-/postcss-nested-5.0.5.tgz#f0a107d33a9fab11d7637205f5321e27223e3603"
integrity sha512-GSRXYz5bccobpTzLQZXOnSOfKl6TwVr5CyAQJUPub4nuRJSOECK5AqurxVgmtxP48p0Kc/ndY/YyS1yqldX0Ew==
dependencies:
postcss-selector-parser "^6.0.4"
[email protected]^4.0.1:
version "4.0.1"
resolved "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-4.0.1.tgz#8b35add3aee83a136b0471e0d59be58a50285dd4"
@ -3525,7 +3542,7 @@ [email protected]^3.0.0:
indexes-of "^1.0.1"
uniq "^1.0.1"
[email protected]^6.0.2:
[email protected]^6.0.2, [email protected]^6.0.4:
version "6.0.4"
resolved "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.4.tgz#56075a1380a04604c38b063ea7767a129af5c2b3"
integrity sha512-gjMeXBempyInaBqpp8gODmwZ52WaYsVOsfr4L4lDQ7n3ncD6mEyySiDtgzCT+NYC0mmeOLvtsF8iaEf0YT6dBw==
@ -3564,6 +3581,15 @@ [email protected]^4.0.2, [email protected]^4.1.0:
resolved "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz#443f6a20ced6481a2bda4fa8532a6e55d789a2cb"
integrity sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==
[email protected]^6.0.8:
version "6.0.23"
resolved "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz#61c82cc328ac60e677645f979054eb98bc0e3324"
integrity sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==
dependencies:
chalk "^2.4.1"
source-map "^0.6.1"
supports-color "^5.4.0"
[email protected]^7.0.0, [email protected]^7.0.1, [email protected]^7.0.17, [email protected]^7.0.27, [email protected]^7.0.32:
version "7.0.35"
resolved "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz#d2be00b998f7f211d8a276974079f2e92b970e24"
@ -4281,7 +4307,7 @@ [email protected]^2.0.0:
resolved "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=
[email protected]^5.3.0:
[email protected]^5.3.0, [email protected]^5.4.0:
version "5.5.0"
resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
Loading…
Cancel
Save