Hexo+NexT博客搭建及美化(二)

该篇章主要讲解我的博客搭建的过程和主题美化流程(下)。

Hexo指定文件跳过渲染

1
2
3
skip_render: 
- "skipfiles/**/*" #跳过source下该匹配的所有文件
- "README.md" #跳过source的README.md文件,上传GitHub可以在主仓库展示
  • 尝试了好久,结果后来看了官网只是因为没有添加引号
1
2
3
4
5
skip_render: "mypage/**/*"
# 将会直接将 `source/mypage/index.html` 和 `source/mypage/code.js` 不做改动地输出到 'public' 目录
# 你也可以用这种方法来跳过对指定文章文件的渲染
skip_render: "_posts/test-post.md"
# 这将会忽略对 'test-post.md' 的渲染

但是!!!!还是不行,最后感谢一位大佬博客,我设置成了这样

image-20240428235405599

成功了!!!!image-20240428235441554

重点

每次修改东西后一定一定要hexo clean && hexo g && hexo s进行本地测试,然后没有问题再hexo clean && hexo g && hexo d上传GitHub渲染,不然后面遇到的问题你都不知道是出在哪儿。

tabs筛选框

解题

1
2
3
4
5
6
7
8
9
10
11
12
class Solution:
def lengthOfLongestSubstring(self, s: str) -> int:
record = set()
l = 0
res = 0
for r in range(len(s)):
while s[r] in record:
record.remove(s[l])
l += 1
record.add(s[r])
res = res if r - l + 1 < res else r - l + 1
return res
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class Solution {
public int lengthOfLongestSubstring(String s) {
Map<Character, Integer> record = new HashMap<>(); //记录已遍历的最长不重复连续子串
// 定义滑动窗口
int l = 0;
int r;
int res = 0;
for (r = 0; r < s.length(); r++){ //遍历字符
// 判断是否已记录,如果没有则添加,如果有,则在记录中删除并滑动left
while(record.containsKey(s.charAt(r))){ // 有,删除并滑动窗口
record.remove(s.charAt(l));
l += 1;
}
record.put(s.charAt(r), r);
// 已记录的和当前的滑动窗口长度选择较大的
res = r - l + 1 < res ? res : r - l + 1;
}

return res;


}
}
1