-
Notifications
You must be signed in to change notification settings - Fork 586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
主题的所有排版失效 #289
Comments
好像是因为jsdelivr的问题 |
jsdelivr彻底凉了,导致CSS样式表无法加载,部分JS库也无法加载。 对于您自己的站点,要彻底解决该问题,请进入sakura主题设置→CDN,勾选'本地调用前端库(lib.js、lib.css)',和'本地调用主题 js、css 文件(sakura-app.js、style.css)'这两个选项。保存并应用。 对于他人的站点,请联系或者留下评论给博主,让他们手动开启这两个选项。 最后,实在没办法的办法就是浏览博客的时候始终使用代理等办法。 |
欢迎pr,把全部资源移到本地(狗头 |
感谢! |
已经在一个一个转到本地了(滑稽) |
另外还有一个问题,就是就算勾选了这两个选项,还是有些资源会从访问不到的地方获取,比如切换夜间主题和'Discovery'左边的树叶形状图标一直加载不出来。虽然说不影响网页使用,但是网页的加载进度条会一直显示直到加载失败。 |
批量替换jsdelivr资源镜像的方法在wp_content/themes目录下运行: sed -i "s/cdn.jsdelivr.net/jsdelivr.2heng.xin/g" `grep -rl 'cdn.jsdelivr.net' Sakura` 其中 # 缓存路径配置
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=CACHE:10m inactive=7d max_size=1g;
# referer 白名单
map $http_referer $jsdelivr_allow_referer {
default 0;
"~2heng.xin" 1;
"~mashiro.top" 1;
}
map $jsdelivr_allow_referer $jsdelivr_disallow_referer {
0 1;
1 "";
}
server {
listen 443 ssl http2;
server_name jsdelivr.2heng.xin;
# ssl 配置
ssl_certificate ~/.acme.sh/mashiro/fullchain.cer;
ssl_certificate_key ~/.acme.sh/mashiro/mashiro.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!MEDIUM:!LOW:!aNULL:!NULL:!SHA;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
# 关闭日志
access_log off;
# 指定 DNS
resolver 8.8.8.8;
if ($jsdelivr_disallow_referer) {
return 403 "The referer domain is not allowed to access this resource.";
}
location / {
proxy_redirect off;
proxy_pass https://fastly.jsdelivr.net;
proxy_cache_revalidate on;
proxy_set_header Host cdn.jsdelivr.net;
proxy_cache CACHE;
# 客户端的缓存时长
proxy_cache_valid 200 1h;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_lock on;
# 服务器端的缓存时长
expires 1h;
}
} 以上需要在境外服务器上配置。如果没有海外服务器需要使用我的镜像,请通过QQ联系我。 |
参见 #290 |
在几天之前,Sakura的主题突然无法正常使用,具体表现为所有排版都消失,页面变回类似ie兼容模式的风格。
切换为其他预设主题能正常展示主题。
下载全新的3.4.0Sakura主题并安装仍会遇见排版问题。
更改php版本(72->80)也无效。
升级wp无效。
bug 重现步骤
未在过去的几周内对blog有任何操作。
我自己的blog(https://www.mushin.top/)
![image](https://user-images.githubusercontent.com/97760035/170194416-35eadf3e-0038-4298-a4b1-51613a319c13.png)
另一位的blog(http://yorunina.cn/)
![image](https://user-images.githubusercontent.com/97760035/170194600-5b16bbb0-066c-4a20-a1eb-227ee26b5492.png)
系统信息
The text was updated successfully, but these errors were encountered: