Skip to content

Commit

Permalink
reset images's title and url
Browse files Browse the repository at this point in the history
  • Loading branch information
Zander Xue committed Dec 5, 2019
1 parent 4c6400a commit 218725c
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 18 deletions.
Binary file modified .DS_Store
Binary file not shown.
7 changes: 7 additions & 0 deletions README.md
@@ -1,4 +1,11 @@
# xuezenghui.com

[![Generator is Hugo](https://img.shields.io/badge/Generator%20is-Hugo-ff4088?&logo=hugo)](https://github.com/gohugoio/hugo)
[![Theme is MemE](https://img.shields.io/badge/Theme%20is-MemE-2a6df4?&logo=meme)](https://github.com/reuixiy/hugo-theme-meme)
[![Source on GitHub](https://img.shields.io/badge/Source%20on-GitHub-181717?&logo=github)](https://github.com/reuixiy/io-oi.me)
[![Built on Netlify](https://img.shields.io/badge/Built%20on-Netlify-00c7b7?&logo=netlify)](https://www.netlify.com/)
[![Hosted on IPFS](https://img.shields.io/badge/Hosted%20on-IPFS-65c2cb?&logo=ipfs)](https://ipfs.io/)

[个人博客](https://xuezenghui.com)

记录,分享,独处时光。
14 changes: 7 additions & 7 deletions config.toml
Expand Up @@ -80,7 +80,7 @@ uglyURLs = false
# 网站(默认值:baseURL)
website = "https://xuezenghui.com/"
# 推特
# twitter = "reuixiy"
# twitter = "xuezenghui"

# 相关文章
[related]
Expand Down Expand Up @@ -269,7 +269,7 @@ uglyURLs = false
# 站点信息

# 站点的 LOGO
siteLogo = ""
siteLogo = "/static/favicon.ico"
# 说明:用于 JSON-LD、Open Graph

# 站点的描述
Expand All @@ -278,7 +278,7 @@ uglyURLs = false
# Open Graph、Atom、RSS

# 站点的关键词
siteKeywords = ["技术博客", "前端"]
siteKeywords = ["技术博客", "前端", "Zander", "Zander Hsueh", "薛增辉"]
# 说明:如果留空([]),则会取站点的所有类别名、分
# 区名(如果按分区分类)作为默认值

Expand Down Expand Up @@ -578,7 +578,7 @@ uglyURLs = false
# 注意:只支持 HSL 颜色值

# 文章的内容宽度
postWidth = 38
postWidth = 34
# 说明:如果留空(""),则用 42 作为默认值
# 单位:em

Expand Down Expand Up @@ -707,10 +707,10 @@ uglyURLs = false
# 比如:/images/meme.jpg

# 是否开启
enableImageHost = false
enableImageHost = true

# 图片外链地址
imageHostURL = "https://example.com/"
imageHostURL = "https://xuezenghui.com/"

# 是否将 HTML 的头部元数据中的图片链接也替换为外链
headAlso = false
Expand All @@ -725,7 +725,7 @@ uglyURLs = false
# 比如:/videos/meme.mp4

# 是否开启
enableVideoHost = false
enableVideoHost = true

# 视频外链地址
videoHostURL = "https://xuezenghui.com/"
Expand Down
2 changes: 1 addition & 1 deletion content/posts/GraphQL.md
Expand Up @@ -28,7 +28,7 @@ comments: true
---

开始之前先推荐一个开放 API——美国太空探索技术公司 [SpaceX](https://www.spacex.com/) 提供的[开源 REST API](https://github.com/r-spacex/SpaceX-API),应有尽有的数据,详细完整的文档,还支持一键导入 Postman😏。
<img src="http://blog.xuezenghui.com/GraphQL/spaceX.jpeg" width=400>
<img src="http://blog.xuezenghui.com/GraphQL/spaceX.jpeg" width=400 title="大火箭🚀">

---

Expand Down
2 changes: 1 addition & 1 deletion content/posts/JavaScript 此间道理汝明了之?.md
Expand Up @@ -24,7 +24,7 @@ comments: true
1. [详解Object.create(null) | 掘金](https://juejin.im/post/5acd8ced6fb9a028d444ee4e)

### 慎用`delete`来删除对象的属性
- 🤔️:JavaScript V8 引擎内部机制导致`delete`操作会先耗费大量时间去检查对象中的各个属性,从而大大影响程序的执行速度。简单的方式是直接将不需要的属性设为`undefined`,但这种方式实际只保证了属性不显示,而不是真正意义上的..删除..,Lodash 的 [omit()](https://lodash.com/docs/4.17.15#omit) 方法实为最优解。
- 🤔️:JavaScript V8 引擎内部机制导致`delete`操作会先耗费大量时间去检查对象中的各个属性,从而大大影响程序的执行速度。简单的方式是直接将不需要的属性设为`undefined`,但这种方式实际只保证了属性不显示,而不是真正意义上的..删除..(会导致 [ESlint](https://eslint.bootcss.com/) 报错),Lodash 的 [omit()](https://lodash.com/docs/4.17.15#omit) 方法实为最优解。

- 🔗:
1. [Slow delete of object properties in JS in V8 | Stack Overflow
Expand Down
8 changes: 4 additions & 4 deletions content/posts/MongoDB 中的关联查询方式.md
Expand Up @@ -21,7 +21,7 @@ comments: true

aggregate 聚合其实是 MongoDB 提供的比较大的功能模块了,而关联多个集合需要用到的是`$lookup`,比如有作者集合 authors 和著作集合 books,作者与著作即为「一对多」的关联关系,使用引用式关联:

![author&book.png](http://blog.xuezenghui.com/agg&popu/author&book.png "集合authors与books")
![author&book.png](http://blog.xuezenghui.com/agg&popu/author&book.png "集合 authors 与 books")

> 因为技术栈是 Node.js + Express + Mongoose,以下代码示例也以此为基础,使用 express-generator 生成 demo 目录结构。
Expand Down Expand Up @@ -172,18 +172,18 @@ const bookSchma = new Schema({
#### 代码简洁度
大概知道了它们的使用方法和适用场景后再来看看其它方面,比如为什么要重构之前完成的 aggregate 接口🥶。刚入职经验不足拿来别人的代码就依葫芦画瓢,画出来的「瓢」是这样的:
<img src="http://blog.xuezenghui.com/agg&popu/aggregateAPI.png" width=400>
<img src="http://blog.xuezenghui.com/agg&popu/aggregateAPI.png" width=400 title="错误示例">

一方面是大量的回调函数,一方面是 aggregate 繁杂的写法,导致代码大量冗余,可读性也极差,现在重构后优雅的「葫芦」:
<img src="http://blog.xuezenghui.com/agg&popu/populateAPI.png" width=400>
<img src="http://blog.xuezenghui.com/agg&popu/populateAPI.png" width=400 title="正确示例">

#### 性能方面
看完了外表再说说内在——查询性能,populate 实际是`DBRef`[^4]的引用方式,相当于多构造了一层查询。比如有10条数据,在`find()`查询到了主集合内的10条数据后会再进行`populate()`引用的额外10条数据的查询,性能也相对的大打折扣了。而[这里](https://blog.csdn.net/rcjjian/article/details/81512762)有位大佬对`aggregate()``find()`进行了性能上的对比,结论也显而易见——比 find 查询速度都快的 aggregate 比关联查询的 find + populate 定是有过之而无不及了。

## 总结
||aggregation|populate|
|---|---|---|
|灵活性|⭐️⭐️⭐️⭐️⭐||
|灵活性|⭐️⭐️⭐️⭐️⭐|⭐️|
|反向关联|⭐️⭐️⭐️⭐️⭐️|⭐️⭐️|
|功能性|⭐️⭐️⭐️⭐️⭐️|⭐️⭐️⭐️|
|代码简洁度|⭐️|⭐️⭐️⭐️⭐️⭐️|
Expand Down
9 changes: 4 additions & 5 deletions content/posts/常用 CSS 样式总结.md
Expand Up @@ -13,7 +13,7 @@ comments: true
---
## 标题左右横线

![title_h.png](http://blog.xuezenghui.com/blog/common_css/title_h.png "效果图")
![title_h.png](/images/common-css:title-h.png "效果图")

```html
<div class="title"></div>
Expand Down Expand Up @@ -47,7 +47,7 @@ comments: true
```
## 微信小程序——多行文本展开/收起

![up&down.gif](http://blog.xuezenghui.com/common_css/up&down.gif "效果图")
![up&down.gif](/images/common-css:up&down.gif "效果图")

```html
<!-- .wxml文件 -->
Expand Down Expand Up @@ -106,10 +106,9 @@ Page({
}
)}
```
## 小程序——时间轴组件
## 微信小程序——时间轴组件
<img src="http://blog.xuezenghui.com/common_css/timeline.png" width="300">
<center>◎效果图</center>
<img src="/images/common-css:timeline.png" width="300" title="效果图">
### timeline 组件:
```html
Expand Down
Binary file modified static/.DS_Store
Binary file not shown.
Binary file added static/images/.DS_Store
Binary file not shown.
Binary file added static/images/common-css:timeline.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/common-css:title-h.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/common-css:up&down.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 218725c

Please sign in to comment.