修改:最新页面功能改版

This commit is contained in:
xugaoyi 2020-03-02 22:41:02 +08:00
parent bbb4c017e8
commit c30c21408f
172 changed files with 364 additions and 204 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,30 +1,116 @@
const re = /.*\/(.*?)\.(html|md)/ const re = /.*\/(.*?)\.(html|md)/
export function getTopKPosts(posts, len) { export function getPagesList(posts) {
return posts console.log('------')
.filter(post => { let pagesList = {}
const { frontmatter } = post;
return frontmatter && frontmatter.permalink && frontmatter.title && frontmatter.article !== false; // 过滤非文章页
}) posts = filterNotArticle(posts)
.map(post => {
const execs = re.exec(post.relativePath) // 对页面数据二次处理和排序
return { const pages = posts.map(post => {
...post, const execs = re.exec(post.relativePath)
updateTimestamp: (new Date(post.lastUpdated || post.frontmatter.date)).getTime(), const date = new Date(post.frontmatter.date || post.lastUpdated)
filename: execs ? execs['1'] : '', const pathArr = post.relativePath.split('/')
formatDay: formatDate(new Date(post.lastUpdated || post.frontmatter.date))
} return {
}) ...post,
.sort((a, b) => b.updateTimestamp - a.updateTimestamp) updateTimestamp: date.getTime(), // 更新日期的时间戳
.slice(0,len) filename: execs ? execs['1'] : '',
formatDay: formatDate(date),
year: date.getFullYear(),
tag: /\./g.test(pathArr[0]) ? pathArr[1].split('.')[1] : pathArr[0] // 区分是单独合集的笔记还是文章
}
}).sort((a, b) => b.updateTimestamp - a.updateTimestamp)
// 根据年份对数据分组
let pageYearArr = []
let pageYearObj = {}
pages.forEach( page => {
// 全部
if (!pageYearObj[page.year]){
pageYearArr.push({
year: page.year,
pageList: [page]
})
pageYearObj[page.year] = page
} else {
pageYearArr.forEach(ele => {
if (ele.year == page.year){
ele.pageList.push(page)
}
})
}
// 按标签分组
//console.log(page.tag)
if (!pagesList[page.tag]) {
pagesList[page.tag] = []
} else {
}
})
// 根据标签分组
pagesList['全部'] = pageYearArr
console.log(pagesList)
} }
function formatDate(date) { // 日期格式化 // 按年份分组
function pageGrouping(){
}
export function getTopKPosts(posts, len) {
return handlePageData(
filterNotArticle(posts)
).slice(0,len)
}
// 过滤没有frontmatter数据的 和 非文章页面的
function filterNotArticle(posts){
return posts.filter(post => {
const { frontmatter } = post;
return frontmatter && frontmatter.permalink && frontmatter.title && frontmatter.article !== false;
})
}
// 页面数据的处理和排序
function handlePageData(posts){
return posts.map(post => {
const execs = re.exec(post.relativePath)
return {
...post,
updateTimestamp: (new Date(post.frontmatter.date || post.lastUpdated)).getTime(), // 更新日期的时间戳
filename: execs ? execs['1'] : '',
formatDay: formatDate(new Date(post.frontmatter.date || post.lastUpdated))
}
}).sort((a, b) => b.updateTimestamp - a.updateTimestamp)
}
// 日期格式化
function formatDate(date) {
if (!(date instanceof Date)) { if (!(date instanceof Date)) {
return return
} }
return `${date.getFullYear()}/${zero(date.getMonth() + 1)}/${zero(date.getDate())}` return `${date.getFullYear()}/${zero(date.getMonth() + 1)}/${zero(date.getDate())}`
} }
function zero(d) { // 补0
// 补0
function zero(d) {
return d.toString().padStart(2,'0') return d.toString().padStart(2,'0')
} }

View File

@ -1,6 +1,6 @@
--- ---
title: 《JavaScript教程》笔记 title: 《JavaScript教程》笔记
date: 2020-01-12 date: 2020-01-12 11:51:53
permalink: /pages/b002833e252f5727 permalink: /pages/b002833e252f5727
--- ---
<main aria-labelledby="main-title" class="home"> <main aria-labelledby="main-title" class="home">

View File

@ -1,6 +1,6 @@
--- ---
title: 《ES6 教程》笔记 title: 《ES6 教程》笔记
date: 2020-01-12 date: 2020-01-12 15:49:22
permalink: /pages/5966e7c94628d277 permalink: /pages/5966e7c94628d277
--- ---

View File

@ -1,6 +1,6 @@
--- ---
title: 《Vue》笔记 title: 《Vue》笔记
date: 2020-02-04 date: 2020-02-04 12:16:12
permalink: /pages/830b1fea836eee46 permalink: /pages/830b1fea836eee46
--- ---
<main aria-labelledby="main-title" class="home"> <main aria-labelledby="main-title" class="home">

View File

@ -1,6 +1,6 @@
--- ---
title: 《TypeScript 从零实现 axios》 title: 《TypeScript 从零实现 axios》
date: 2020-01-05 date: 2020-01-05 10:40:48
permalink: /pages/943193f9d25bc5fb permalink: /pages/943193f9d25bc5fb
--- ---

View File

@ -1,6 +1,6 @@
--- ---
title: 小程序笔记 title: 小程序笔记
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/236ec09c26876b59 permalink: /pages/236ec09c26876b59
--- ---
# 小程序笔记 # 小程序笔记

View File

@ -1,6 +1,6 @@
--- ---
title: new命令原理 title: new命令原理
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/8143cc480faf9a11 permalink: /pages/8143cc480faf9a11
--- ---
# new命令原理 # new命令原理

View File

@ -1,6 +1,6 @@
--- ---
title: ES5面向对象 title: ES5面向对象
date: 2019-12-25 date: 2020-02-22 10:35:43
permalink: /pages/b1af5cb8996363c5 permalink: /pages/b1af5cb8996363c5
--- ---
# ES5面向对象 # ES5面向对象

View File

@ -1,6 +1,6 @@
--- ---
title: ES6面向对象 title: ES6面向对象
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/1f4123be6f45abcd permalink: /pages/1f4123be6f45abcd
--- ---
# ES6面向对象 # ES6面向对象

View File

@ -1,6 +1,6 @@
--- ---
title: 多种数组去重性能对比 title: 多种数组去重性能对比
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/e808fba1fa8fbab2 permalink: /pages/e808fba1fa8fbab2
--- ---
# 多种数组去重性能对比 # 多种数组去重性能对比

View File

@ -1,6 +1,6 @@
--- ---
title: JS随机打乱数组 title: JS随机打乱数组
date: 2020-02-08 date: 2020-02-08 17:42:03
permalink: /pages/40b4db2d38ba85f2 permalink: /pages/40b4db2d38ba85f2
--- ---
# JS随机打乱数组 # JS随机打乱数组

View File

@ -1,6 +1,6 @@
--- ---
title: 判断是否为移动端浏览器 title: 判断是否为移动端浏览器
date: 2020-01-04 date: 2020-01-04 15:25:11
permalink: /pages/40f623be692cf8bc permalink: /pages/40f623be692cf8bc
--- ---
# 判断是否为移动端浏览器 # 判断是否为移动端浏览器

View File

@ -1,6 +1,6 @@
--- ---
title: 将一维数组按指定长度转为二维数组 title: 将一维数组按指定长度转为二维数组
date: 2020-02-23 date: 2020-02-23 13:49:31
permalink: /pages/f1acb712033ac8da permalink: /pages/f1acb712033ac8da
--- ---
# 将一维数组按指定长度转为二维数组 # 将一维数组按指定长度转为二维数组

View File

@ -1,6 +1,6 @@
--- ---
title: 防抖与节流函数 title: 防抖与节流函数
date: 2020-02-29 date: 2020-02-29 15:07:47
permalink: /pages/0f6a0ac99b62ede5 permalink: /pages/0f6a0ac99b62ede5
--- ---
# 防抖与节流函数 # 防抖与节流函数

View File

@ -1,6 +1,6 @@
--- ---
title: Vue项目开发前的一些准备工作 title: Vue项目开发前的一些准备工作
date: 2020-02-21 date: 2020-02-21 14:40:19
permalink: /pages/802a1ca6f7b71c59 permalink: /pages/802a1ca6f7b71c59
--- ---
# Vue项目开发前的一些准备工作 # Vue项目开发前的一些准备工作

View File

@ -1,6 +1,6 @@
--- ---
title: Vue CLi3 修改webpack配置 title: Vue CLi3 修改webpack配置
date: 2020-02-22 date: 2020-02-22 15:00:36
permalink: /pages/5d463fbdb172d43b permalink: /pages/5d463fbdb172d43b
--- ---
# Vue CLi3 修改webpack配置 # Vue CLi3 修改webpack配置

View File

@ -1,6 +1,6 @@
--- ---
title: Vue中的scoped和scoped穿透 title: Vue中的scoped和scoped穿透
date: 2020-02-23 date: 2020-02-23 10:54:23
permalink: /pages/c80d2751cf1f4268 permalink: /pages/c80d2751cf1f4268
--- ---
# Vue中的scoped和scoped穿透 # Vue中的scoped和scoped穿透

View File

@ -1,6 +1,6 @@
--- ---
title: Vue项目使用mock数据的几种方式 title: Vue项目使用mock数据的几种方式
date: 2020-02-26 date: 2020-02-26 14:06:58
permalink: /pages/bd1af2f75fd361fc permalink: /pages/bd1af2f75fd361fc
--- ---
# Vue项目使用mock数据的几种方式 # Vue项目使用mock数据的几种方式

View File

@ -1,6 +1,6 @@
--- ---
title: 常用meta整理 title: 常用meta整理
date: 2020-02-21 date: 2020-02-21 12:20:10
permalink: /pages/8309a5b876fc95e3 permalink: /pages/8309a5b876fc95e3
--- ---
# 常用meta整理 # 常用meta整理

View File

@ -1,6 +1,6 @@
--- ---
title: flex布局语法 title: flex布局语法
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/0a83b083bdf257cb permalink: /pages/0a83b083bdf257cb
--- ---
# flex布局语法 # flex布局语法

View File

@ -1,6 +1,6 @@
--- ---
title: flex布局案例-基础 title: flex布局案例-基础
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/ea6db1530c42ad51 permalink: /pages/ea6db1530c42ad51
--- ---
# flex布局案例-基础 # flex布局案例-基础

View File

@ -1,6 +1,6 @@
--- ---
title: flex布局案例-骰子 title: flex布局案例-骰子
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/eff61bc8b4f4695d permalink: /pages/eff61bc8b4f4695d
--- ---
# flex布局案例-骰子 # flex布局案例-骰子

View File

@ -1,6 +1,6 @@
--- ---
title: flex布局案例-圣杯布局 title: flex布局案例-圣杯布局
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/df9e7c7214fa5046 permalink: /pages/df9e7c7214fa5046
--- ---
# flex布局案例-圣杯布局 # flex布局案例-圣杯布局

View File

@ -1,6 +1,6 @@
--- ---
title: flex布局案例-网格布局 title: flex布局案例-网格布局
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/85b5a3fe218a34b7 permalink: /pages/85b5a3fe218a34b7
--- ---
# flex布局案例-网格布局 # flex布局案例-网格布局

View File

@ -1,6 +1,6 @@
--- ---
title: flex布局案例-输入框布局 title: flex布局案例-输入框布局
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/05cc577fb51c7998 permalink: /pages/05cc577fb51c7998
--- ---
# flex布局案例-输入框布局 # flex布局案例-输入框布局

View File

@ -1,6 +1,6 @@
--- ---
title: CSS3之transform过渡 title: CSS3之transform过渡
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/02d7f59d98d87409 permalink: /pages/02d7f59d98d87409
--- ---
# CSS3之transform过渡 # CSS3之transform过渡

View File

@ -1,6 +1,6 @@
--- ---
title: CSS3之animation动画 title: CSS3之animation动画
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/c2c0432138f6e042 permalink: /pages/c2c0432138f6e042
--- ---
# CSS3之animation动画 # CSS3之animation动画

View File

@ -1,6 +1,6 @@
--- ---
title: 「布局技巧」图片未加载前自动撑开元素高度 title: 「布局技巧」图片未加载前自动撑开元素高度
date: 2020-02-22 date: 2020-02-22 16:37:10
permalink: /pages/3d52574260725aea permalink: /pages/3d52574260725aea
--- ---
# 「布局技巧」图片未加载前自动撑开元素高度 # 「布局技巧」图片未加载前自动撑开元素高度

View File

@ -1,6 +1,6 @@
--- ---
title: 文字在一行或两行时超出显示省略号 title: 文字在一行或两行时超出显示省略号
date: 2020-02-23 date: 2020-02-23 15:07:08
permalink: /pages/42b66999cc27dc25 permalink: /pages/42b66999cc27dc25
--- ---
# 文字在一行或两行时超出显示省略号 # 文字在一行或两行时超出显示省略号

View File

@ -1,6 +1,6 @@
--- ---
title: 从box-sizing属性入手了解盒子模型 title: 从box-sizing属性入手了解盒子模型
date: 2020-02-27 date: 2020-02-27 17:08:48
permalink: /pages/20a978023139589d permalink: /pages/20a978023139589d
--- ---
# 从box-sizing属性入手了解盒子模型 # 从box-sizing属性入手了解盒子模型

View File

@ -1,7 +1,7 @@
--- ---
title: 混(Mixins) title: 混(Mixins)
date: 2020-02-23 date: 2020-02-23 15:47:03
permalink: /pages/bc1fe93547956f88 permalink: /pages/9f15c1a281d8bedb
--- ---
# stylus混入(Mixins) # stylus混入(Mixins)

View File

@ -1,6 +1,6 @@
--- ---
title: Git使用手册 title: Git使用手册
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/9a7ee40fc232253e permalink: /pages/9a7ee40fc232253e
--- ---

View File

@ -1,6 +1,6 @@
--- ---
title: Markdown使用教程 title: Markdown使用教程
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/ad247c4332211551 permalink: /pages/ad247c4332211551
--- ---
# Markdown使用教程 # Markdown使用教程

View File

@ -1,6 +1,6 @@
--- ---
title: npm常用命令 title: npm常用命令
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/61f2f95fd7da14fd permalink: /pages/61f2f95fd7da14fd
--- ---
# npm常用命令 # npm常用命令

View File

@ -1,6 +1,6 @@
--- ---
title: yaml语言教程 title: yaml语言教程
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/4e8444e2d534d14f permalink: /pages/4e8444e2d534d14f
--- ---
# yaml语言教程 # yaml语言教程

View File

@ -1,6 +1,6 @@
--- ---
title: GitHub高级搜索技巧 title: GitHub高级搜索技巧
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/4c778760be26d8b3 permalink: /pages/4c778760be26d8b3
--- ---
# GitHub高级搜索技巧 # GitHub高级搜索技巧

View File

@ -1,6 +1,6 @@
--- ---
title: GitHub Actions 实现自动部署静态博客 title: GitHub Actions 实现自动部署静态博客
date: 2019-12-27 date: 2019-12-27 11:44:41
permalink: /pages/6b9d359ec5aa5019 permalink: /pages/6b9d359ec5aa5019
--- ---
# GitHub Actions 实现自动部署静态博客 # GitHub Actions 实现自动部署静态博客

View File

@ -1,6 +1,6 @@
--- ---
title: GitHub Actions 定时运行代码:每天定时百度链接推送 title: GitHub Actions 定时运行代码:每天定时百度链接推送
date: 2019-12-30 date: 2019-12-30 21:23:00
permalink: /pages/f44d2f9ad04ab8d3 permalink: /pages/f44d2f9ad04ab8d3
--- ---
# GitHub Actions 定时运行代码:每天定时百度链接推送 # GitHub Actions 定时运行代码:每天定时百度链接推送

View File

@ -1,6 +1,6 @@
--- ---
title: nodejs递归读取所有文件 title: nodejs递归读取所有文件
date: 2019-12-26 date: 2019-12-26 15:57:32
permalink: /pages/117708e0af7f0bd9 permalink: /pages/117708e0af7f0bd9
--- ---
# nodejs递归读取所有文件 # nodejs递归读取所有文件

View File

@ -1,6 +1,6 @@
--- ---
title: 解决百度无法收录搭建在GitHub上的个人博客的问题 title: 解决百度无法收录搭建在GitHub上的个人博客的问题
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/41f87d890d0a02af permalink: /pages/41f87d890d0a02af
--- ---
# 解决百度无法收录搭建在GitHub上的静态博客的问题 # 解决百度无法收录搭建在GitHub上的静态博客的问题

View File

@ -1,6 +1,6 @@
--- ---
title: 使用Gitalk实现静态博客无后台评论系统 title: 使用Gitalk实现静态博客无后台评论系统
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/1da0bf9a988eafe5 permalink: /pages/1da0bf9a988eafe5
--- ---
# 使用Gitalk实现静态博客无后台评论系统 # 使用Gitalk实现静态博客无后台评论系统

View File

@ -1,6 +1,6 @@
--- ---
title: GitHub + jsDelivr + TinyPNG+ PicGo 打造稳定快速、高效免费图床 title: GitHub + jsDelivr + TinyPNG+ PicGo 打造稳定快速、高效免费图床
date: 2020-01-03 date: 2020-01-03 12:55:43
permalink: /pages/a5f73af5185fdf0a permalink: /pages/a5f73af5185fdf0a
--- ---
# GitHub + jsDelivr + TinyPNG+ PicGo 打造稳定快速、高效免费图床 # GitHub + jsDelivr + TinyPNG+ PicGo 打造稳定快速、高效免费图床

View File

@ -1,6 +1,6 @@
--- ---
title: 提高学习效率的策略 title: 提高学习效率的策略
date: 2020-01-04 date: 2020-01-04 11:54:14
permalink: /pages/a8692ab3bdcb4588 permalink: /pages/a8692ab3bdcb4588
--- ---
# 提高学习效率的策略 # 提高学习效率的策略

View File

@ -1,6 +1,6 @@
--- ---
title: 提高记忆的技巧 title: 提高记忆的技巧
date: 2020-01-03 date: 2020-01-03 14:34:48
permalink: /pages/996822b2a2ca6e3b permalink: /pages/996822b2a2ca6e3b
--- ---
# 提高记忆的技巧 # 提高记忆的技巧

View File

@ -1,6 +1,6 @@
--- ---
title: 自律小建议 title: 自律小建议
date: 2020-01-03 date: 2020-01-03 14:35:18
permalink: /pages/c3f302a03c8daf79 permalink: /pages/c3f302a03c8daf79
--- ---
# 自律小建议 # 自律小建议

View File

@ -1,6 +1,6 @@
--- ---
title: 处理问题的思路 title: 处理问题的思路
date: 2020-01-03 date: 2020-01-03 14:36:02
permalink: /pages/9ba2b8fb13de1957 permalink: /pages/9ba2b8fb13de1957
--- ---
# 处理问题的思路 # 处理问题的思路

View File

@ -1,6 +1,6 @@
--- ---
title: 面试问题集锦 title: 面试问题集锦
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/aea6571b7a8bae86 permalink: /pages/aea6571b7a8bae86
--- ---
# 面试问题集锦 # 面试问题集锦

View File

@ -1,6 +1,6 @@
--- ---
title: 英语基础 title: 英语基础
date: 2020-01-13 date: 2020-01-13 11:55:53
permalink: /pages/6f9525eecdd51d5a permalink: /pages/6f9525eecdd51d5a
--- ---
# 英语基础 # 英语基础

View File

@ -1,6 +1,6 @@
--- ---
title: 一个完美主义者的自我救赎 title: 一个完美主义者的自我救赎
date: 2020-01-16 date: 2020-01-16 15:15:27
permalink: /pages/2d615df9a36a98ed permalink: /pages/2d615df9a36a98ed
--- ---
# 一个完美主义者的自我救赎 # 一个完美主义者的自我救赎

View File

@ -1,6 +1,6 @@
--- ---
title: 学习网站 title: 学习网站
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/2e9ba3fa6e1ed0e9 permalink: /pages/2e9ba3fa6e1ed0e9
article: false article: false
--- ---

View File

@ -1,6 +1,6 @@
--- ---
title: 在线工具 title: 在线工具
date: 2020-01-12 date: 2020-01-12 11:39:41
permalink: /pages/9c2232288caaa8ec permalink: /pages/9c2232288caaa8ec
article: false article: false
--- ---
@ -13,11 +13,26 @@ article: false
| codepen | <https://codepen.io> | 在线代码编辑与演示 | | codepen | <https://codepen.io> | 在线代码编辑与演示 |
| codesandbox | <https://codesandbox.io/> | 用于快速Web开发的在线IDE | | codesandbox | <https://codesandbox.io/> | 用于快速Web开发的在线IDE |
## 字体图标 ## UI
| 名称 | 网址 | 描述 |
| -------- | --------------------------------- | ------------------ |
| iconfont | <https://www.iconfont.cn/> | 阿里巴巴矢量图标库 |
| undraw | <https://undraw.co/illustrations> | 免费的矢量插画 |
## Chrome 插件
| 名称 | 网址 | 描述 |
| ------------ | --------------------------------- | -------- |
| 谷歌访问助手 | <https://github.com/haotian-wang/google-access-helper> | 用于访问Google搜索、Chrome商店 |
| SetupVPN | Chrome商店 | 科学上网 |
| Hoxx VPN Proxy | Chrome商店 | 科学上网 |
| skyZIP™ Proxy | Chrome商店 | 科学上网 |
| 集装箱 | Chrome商店 | 科学上网 |
| 名称 | 网址 | 描述 |
| -------- | -------------------------- | ------------------ |
| iconfont | <https://www.iconfont.cn/> | 阿里巴巴矢量图标库 |
## Emoji表情 ## Emoji表情

View File

@ -1,6 +1,6 @@
--- ---
title: 友情链接 title: 友情链接
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/844eea1b2387fb96 permalink: /pages/844eea1b2387fb96
article: false article: false
--- ---

View File

@ -1,12 +1,14 @@
--- ---
title: 关于 title: 关于
date: 2019-12-25 date: 2019-12-25 14:27:01
permalink: /pages/81d9f505441078e0 permalink: /pages/81d9f505441078e0
sidebar: false sidebar: false
article: false article: false
--- ---
# 关于 # 关于
这是一个兼具博客文章、个人技能树、文档查找的个人网站主要内容是Web前端技术。如果你喜欢这个博客欢迎到[GitHub](https://github.com/xugaoyi/blog)点个Star、获取源码或者交换 [友链](/pages/844eea1b2387fb96/)。 这是一个兼具博客文章、个人技能树、文档查找的个人网站主要内容是Web前端技术。如果你喜欢这个博客欢迎到[GitHub](https://github.com/xugaoyi/blog)点个Star、获取源码或者交换 [友链](/pages/844eea1b2387fb96/)。
@ -15,6 +17,7 @@ article: false
<!-- <img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200217210849.gif"> --> <!-- <img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200217210849.gif"> -->
<img src='https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200103123203.jpg' alt='本人照片' style="width:106px;"> <img src='https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200103123203.jpg' alt='本人照片' style="width:106px;">
[更新日志](https://github.com/xugaoyi/blog/commits/master) [更新日志](https://github.com/xugaoyi/blog/commits/master)
## :email: 联系 ## :email: 联系
@ -37,4 +40,4 @@ article: false
} }
} }
} }
</script> </script>

View File

@ -1,12 +1,36 @@
--- ---
title: 最新 title: 最新
date: 2019-12-31 date: 2019-12-31 13:49:34
permalink: /pages/8818d4830dac5e2a permalink: /pages/8818d4830dac5e2a
sidebar: false sidebar: false
article: false # 不显示最近更新栏,以及不参与到最近更新文章数据计算 article: false # 不显示最近更新栏,以及不参与到最近更新文章数据计算
comment: false
--- ---
# 最近更新 <!-- <div class="tags">
{{getTags}}
<span class="active">全部</span>
<span>JavaScript文章</span>
<span>Vue文章</span>
<span>《JavaScript教程》笔记</span>
<span>《ES6 教程》笔记</span>
<span>JavaScript文章</span>
<span>Vue文章</span>
<span>《JavaScript教程》笔记</span>
<span>《ES6 教程》笔记</span>
<span>JavaScript文章</span>
<span>Vue文章</span>
<span>《JavaScript教程》笔记</span>
<span>《ES6 教程》笔记</span>
<span>JavaScript文章</span>
<span>Vue文章</span>
<span>《JavaScript教程》笔记</span>
<span>《ES6 教程》笔记</span>
<span>JavaScript文章</span>
<span>Vue文章</span>
<span>《JavaScript教程》笔记</span>
<span>《ES6 教程》笔记</span>
</div> -->
<ul class="page-guide-ul"> <ul class="page-guide-ul">
<li <li
@ -25,15 +49,16 @@ article: false # 不显示最近更新栏,以及不参与到最近更新文章
</div> </div>
<script> <script>
import { getTopKPosts } from '../.vuepress/theme/util/getTopKPosts' import { getTopKPosts, getPagesList } from '../.vuepress/theme/util/getTopKPosts'
export default { export default {
data() { data() {
return { return {
pagesList: {},
step: 20, step: 20,
posts: [], posts: [],
page: 1, page: 1,
num: 0, num: 0, // 页面数量
btnInfo: '加载更多', btnInfo: '加载更多',
showBtn: true, showBtn: true,
timeout: null, timeout: null,
@ -46,6 +71,9 @@ export default {
}, },
computed: { computed: {
getTags() {
getPagesList(this.posts)
},
topPublishPosts() { topPublishPosts() {
// return this.getTopKPosts(this.page * this.step) // return this.getTopKPosts(this.page * this.step)
return getTopKPosts(this.posts, this.page * this.step) return getTopKPosts(this.posts, this.page * this.step)
@ -53,6 +81,10 @@ export default {
}, },
methods: { methods: {
// getTopKPosts(num) { // 文章数据处理 // getTopKPosts(num) { // 文章数据处理
// const re = /.*\/(.*?)\.(html|md)/ // const re = /.*\/(.*?)\.(html|md)/
// return this.posts // return this.posts
@ -103,6 +135,26 @@ export default {
</script> </script>
<style scoped lang="stylus" rel="stylesheet/stylus"> <style scoped lang="stylus" rel="stylesheet/stylus">
.tags
margin 30px 0
span
vertical-align: middle;
margin: 4px 4px 10px;
padding: 5px 8px;
display: inline-block;
cursor: pointer;
border-radius: .25rem;
background: #E15B64;
color: #fff;
line-height: 13px;
font-size: 13px;
box-shadow: var(--box-shadow);
transition: all .5s;
&.active
transform: scale(1.2);
&:not(.active):hover
transform: scale(1.1);
.page-guide-ul { .page-guide-ul {
padding-left: 0; padding-left: 0;
} }

View File

@ -1,6 +1,6 @@
--- ---
title: ECMAScript 6 简介 title: ECMAScript 6 简介
date: 2020-01-12 date: 2020-01-12 15:45:35
permalink: /pages/f344d070a1031ef7 permalink: /pages/f344d070a1031ef7
--- ---
> 说明:本章内容为博主在原教程基础上添加自己的学习笔记,来源<http://es6.ruanyifeng.com/>,教程版权归原作者所有。 > 说明:本章内容为博主在原教程基础上添加自己的学习笔记,来源<http://es6.ruanyifeng.com/>,教程版权归原作者所有。

View File

@ -1,6 +1,6 @@
--- ---
title: let 和 const 命令 title: let 和 const 命令
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/c1edd70a6b7c7872 permalink: /pages/c1edd70a6b7c7872
--- ---
# let 和 const 命令 # let 和 const 命令

View File

@ -1,6 +1,6 @@
--- ---
title: 变量的解构赋值 title: 变量的解构赋值
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/b1ab10a62f7564da permalink: /pages/b1ab10a62f7564da
--- ---
# 变量的解构赋值 # 变量的解构赋值

View File

@ -1,6 +1,6 @@
--- ---
title: 字符串的扩展 title: 字符串的扩展
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/ca89eca8adeba5f4 permalink: /pages/ca89eca8adeba5f4
--- ---
# 字符串的扩展 # 字符串的扩展

View File

@ -1,6 +1,6 @@
--- ---
title: 字符串的新增方法 title: 字符串的新增方法
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/a650b4a0ebfc9350 permalink: /pages/a650b4a0ebfc9350
--- ---
# 字符串的新增方法 # 字符串的新增方法

View File

@ -1,6 +1,6 @@
--- ---
title: 正则的扩展 title: 正则的扩展
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/0473261a6ab0ee8c permalink: /pages/0473261a6ab0ee8c
--- ---
# 正则的扩展 # 正则的扩展

View File

@ -1,6 +1,6 @@
--- ---
title: 数值的扩展 title: 数值的扩展
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/5dfea9a0f2d1a392 permalink: /pages/5dfea9a0f2d1a392
--- ---
# 数值的扩展 # 数值的扩展

View File

@ -1,6 +1,6 @@
--- ---
title: 函数的扩展 title: 函数的扩展
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/8ed309d668b20264 permalink: /pages/8ed309d668b20264
--- ---
# 函数的扩展 # 函数的扩展

View File

@ -1,6 +1,6 @@
--- ---
title: 数组的扩展 title: 数组的扩展
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/e34009d60d8bc4b2 permalink: /pages/e34009d60d8bc4b2
--- ---
# 数组的扩展 # 数组的扩展

View File

@ -1,6 +1,6 @@
--- ---
title: 对象的扩展 title: 对象的扩展
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/b5e3e0a0ff6e9c25 permalink: /pages/b5e3e0a0ff6e9c25
--- ---
# 对象的扩展 # 对象的扩展

View File

@ -1,6 +1,6 @@
--- ---
title: 对象的新增方法 title: 对象的新增方法
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/e85e68947502cf90 permalink: /pages/e85e68947502cf90
--- ---
# 对象的新增方法 # 对象的新增方法

View File

@ -1,6 +1,6 @@
--- ---
title: Symbol title: Symbol
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/02c86eb2792f3262 permalink: /pages/02c86eb2792f3262
--- ---
# Symbol # Symbol

View File

@ -1,6 +1,6 @@
--- ---
title: Set 和 Map 数据结构 title: Set 和 Map 数据结构
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/0c21dae358fca16b permalink: /pages/0c21dae358fca16b
--- ---
# Set 和 Map 数据结构 # Set 和 Map 数据结构

View File

@ -1,6 +1,6 @@
--- ---
title: Proxy title: Proxy
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/f56ec2ab97d60483 permalink: /pages/f56ec2ab97d60483
--- ---
# Proxy # Proxy

View File

@ -1,6 +1,6 @@
--- ---
title: Reflect title: Reflect
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/74de3e45e4491e95 permalink: /pages/74de3e45e4491e95
--- ---
# Reflect # Reflect

View File

@ -1,6 +1,6 @@
--- ---
title: Promise 对象 title: Promise 对象
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/2810ae8985e9bd52 permalink: /pages/2810ae8985e9bd52
--- ---
# Promise 对象 # Promise 对象

View File

@ -1,6 +1,6 @@
--- ---
title: Iterator 和 for-of 循环 title: Iterator 和 for-of 循环
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/48df907ad3570f3d permalink: /pages/48df907ad3570f3d
--- ---
# Iterator 和 for...of 循环 # Iterator 和 for...of 循环

View File

@ -1,6 +1,6 @@
--- ---
title: Generator 函数的语法 title: Generator 函数的语法
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/718b48ed9ce0adce permalink: /pages/718b48ed9ce0adce
--- ---
# Generator 函数的语法 # Generator 函数的语法

View File

@ -1,6 +1,6 @@
--- ---
title: Generator 函数的异步应用 title: Generator 函数的异步应用
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/75af7031eb66847b permalink: /pages/75af7031eb66847b
--- ---
# Generator 函数的异步应用 # Generator 函数的异步应用

View File

@ -1,6 +1,6 @@
--- ---
title: async 函数 title: async 函数
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/3777253e65bac487 permalink: /pages/3777253e65bac487
--- ---
# async 函数 # async 函数

View File

@ -1,6 +1,6 @@
--- ---
title: Class 的基本语法 title: Class 的基本语法
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/e831e1593c82bbe0 permalink: /pages/e831e1593c82bbe0
--- ---
# Class 的基本语法 # Class 的基本语法

View File

@ -1,6 +1,6 @@
--- ---
title: Class 的继承 title: Class 的继承
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/83f8c3a0cd87dd83 permalink: /pages/83f8c3a0cd87dd83
--- ---
# Class 的继承 # Class 的继承

View File

@ -1,6 +1,6 @@
--- ---
title: Module 的语法 title: Module 的语法
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/efe2fb04eb8ac5fb permalink: /pages/efe2fb04eb8ac5fb
--- ---
# Module 的语法 # Module 的语法

View File

@ -1,6 +1,6 @@
--- ---
title: Module 的加载实现 title: Module 的加载实现
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/a79ca2e64ceae213 permalink: /pages/a79ca2e64ceae213
--- ---
# Module 的加载实现 # Module 的加载实现

View File

@ -1,6 +1,6 @@
--- ---
title: 编程风格 title: 编程风格
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/984bf549204bb266 permalink: /pages/984bf549204bb266
--- ---
# 编程风格 # 编程风格

View File

@ -1,6 +1,6 @@
--- ---
title: 读懂 ECMAScript 规格 title: 读懂 ECMAScript 规格
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/32c35f7651d6e58e permalink: /pages/32c35f7651d6e58e
--- ---
# 读懂 ECMAScript 规格 # 读懂 ECMAScript 规格

View File

@ -1,6 +1,6 @@
--- ---
title: 异步遍历器 title: 异步遍历器
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/16121351be68691b permalink: /pages/16121351be68691b
--- ---
# 异步遍历器 # 异步遍历器

View File

@ -1,6 +1,6 @@
--- ---
title: ArrayBuffer title: ArrayBuffer
date: 2020-01-12 date: 2020-02-09 16:00:29
permalink: /pages/a2ba314746bfdbdd permalink: /pages/a2ba314746bfdbdd
--- ---
# ArrayBuffer # ArrayBuffer

View File

@ -1,6 +1,6 @@
--- ---
title: 最新提案 title: 最新提案
date: 2020-01-12 date: 2020-02-09 16:00:30
permalink: /pages/7188882b8d65af1b permalink: /pages/7188882b8d65af1b
--- ---
# 最新提案 # 最新提案

View File

@ -1,6 +1,6 @@
--- ---
title: 装饰器 title: 装饰器
date: 2020-01-12 date: 2020-02-09 16:00:30
permalink: /pages/e97bc1e5626b082c permalink: /pages/e97bc1e5626b082c
--- ---
# 装饰器 # 装饰器

View File

@ -1,6 +1,6 @@
--- ---
title: 函数式编程 title: 函数式编程
date: 2020-01-12 date: 2020-02-09 16:00:30
permalink: /pages/1cf50330655efc69 permalink: /pages/1cf50330655efc69
--- ---
# 函数式编程 # 函数式编程

View File

@ -1,6 +1,6 @@
--- ---
title: Mixin title: Mixin
date: 2020-01-12 date: 2020-02-09 16:00:30
permalink: /pages/6a8e2dc558da1b39 permalink: /pages/6a8e2dc558da1b39
--- ---
# Mixin # Mixin

View File

@ -1,6 +1,6 @@
--- ---
title: SIMD title: SIMD
date: 2020-01-12 date: 2020-02-09 16:00:30
permalink: /pages/8e8f80f69b775a56 permalink: /pages/8e8f80f69b775a56
--- ---
# SIMD # SIMD

View File

@ -1,6 +1,6 @@
--- ---
title: 参考链接 title: 参考链接
date: 2020-01-12 date: 2020-02-09 16:00:30
permalink: /pages/ea6f3b870f6dab69 permalink: /pages/ea6f3b870f6dab69
--- ---
# 参考链接 # 参考链接

View File

@ -1,6 +1,6 @@
--- ---
title: 基础 title: 基础
date: 2020-01-12 date: 2020-01-12 11:49:16
permalink: /pages/0796ba76b4b55368 permalink: /pages/0796ba76b4b55368
--- ---

View File

@ -1,6 +1,6 @@
--- ---
title: 内置对象 title: 内置对象
date: 2020-01-12 date: 2020-01-12 11:49:16
permalink: /pages/74d2ab3fbfeaaa68 permalink: /pages/74d2ab3fbfeaaa68
--- ---

View File

@ -1,6 +1,6 @@
--- ---
title: 面向对象 title: 面向对象
date: 2020-01-12 date: 2020-01-12 11:49:16
permalink: /pages/659b5af5e2e704e0 permalink: /pages/659b5af5e2e704e0
--- ---

View File

@ -1,6 +1,6 @@
--- ---
title: 异步操作 title: 异步操作
date: 2020-01-12 date: 2020-01-12 11:49:16
permalink: /pages/d61b1cb4cdac1f63 permalink: /pages/d61b1cb4cdac1f63
--- ---

View File

@ -1,6 +1,6 @@
--- ---
title: DOM title: DOM
date: 2020-01-12 date: 2020-01-12 11:49:16
permalink: /pages/7d961b8030c6099e permalink: /pages/7d961b8030c6099e
--- ---

View File

@ -1,6 +1,6 @@
--- ---
title: 事件 title: 事件
date: 2020-01-12 date: 2020-01-12 11:49:16
permalink: /pages/10b2761db5a8e089 permalink: /pages/10b2761db5a8e089
--- ---

View File

@ -1,6 +1,6 @@
--- ---
title: 浏览器模型 title: 浏览器模型
date: 2020-01-12 date: 2020-01-12 11:49:16
permalink: /pages/bab4930124ad2c10 permalink: /pages/bab4930124ad2c10
--- ---
# 浏览器模型 # 浏览器模型

View File

@ -1,6 +1,6 @@
--- ---
title: 简介 title: 简介
date: 2020-01-05 date: 2020-01-05 10:15:07
permalink: /pages/e05dce83e5129785 permalink: /pages/e05dce83e5129785
--- ---
# 简介 # 简介

View File

@ -1,6 +1,6 @@
--- ---
title: 安装 TypeScript title: 安装 TypeScript
date: 2020-01-05 date: 2020-01-05 10:15:07
permalink: /pages/064e0f7b6b6142c8 permalink: /pages/064e0f7b6b6142c8
--- ---
# 安装 TypeScript # 安装 TypeScript

View File

@ -1,6 +1,6 @@
--- ---
title: 编写第一个 TypeScript 程序 title: 编写第一个 TypeScript 程序
date: 2020-01-05 date: 2020-01-05 10:15:07
permalink: /pages/c85249f40e7a3517 permalink: /pages/c85249f40e7a3517
--- ---
# 编写第一个 TypeScript 程序 # 编写第一个 TypeScript 程序

View File

@ -1,6 +1,6 @@
--- ---
title: 基础类型 title: 基础类型
date: 2020-01-05 date: 2020-01-05 10:17:47
permalink: /pages/28672e2743bbc3a7 permalink: /pages/28672e2743bbc3a7
--- ---
# 基础类型 # 基础类型

Some files were not shown because too many files have changed in this diff Show More