中文等宽字体,一个中文字符等宽两个英文字符,Mac下很多字体( Menlo, Monaco, Courier New, Source Code Pro )没有严格遵循或者说达不到这个标准, 它们不包括CJK的字库,有的时候用一些 markdown table formatter 会导致不整齐,其实并不是排列不整齐,而是字体的宽度不同
Read more »

GItlens

GitLens 可以在你的代码编辑区看到当前行的git log里面的修改情况,体验非常惊艳,开箱即用不用什么配置

Introduction from official website:

GitLens supercharges the Git capabilities built into Visual Studio Code. It helps you to visualize code authorship at a glance via Git blame annotations and code lens, seamlessly navigate and explore Git repositories, gain valuable insights via powerful comparison commands, and so much more.

Official website:
https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens

Installation

Open Visual Studio Code, press F1, type Extensions: install then search for rest-client.

screenshot :

image-20200110084853409

Rest Client for Vscode

Rest Client for Vsocde record all the request in plain text

  • It can easily be managed by version control system via git
  • Define the variables in the context to resue both
  • Code hinting for the key prarameters

Installation

  1. Open Visual Studio Code, press F1, type ext install then search for rest-client.
  2. Create a new file called rest-test.http and cover the sample as below, replace the value with your own.

Sample

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
@Host=disqus.com
@forum=shortname
@api_key=apikey
@thread=ident:technology%2F2019%2F12%2F10%2Flearning-how-to-reverse-proxy-disqus-api-in-nginx%2F

GET https://{{Host}}/3.0/threads/listPosts.json?forum=shortname&thread=ident:technology%2F2019%2F12%2F10%2Flearning-how-to-reverse-proxy-disqus-api-in-nginx%2F&api_key=apikey HTTP/1.1
Host: disqus.com
Connection: close
User-Agent: Paw/3.1.10 (Macintosh; OS X/10.15.2) GCDHTTPRequest

###

GET https://{{Host}}/3.0/threads/listPosts.json Http/1.1
?forum={{forum}}
&thread={{thread}}
&api_key={{api_key}}

Screeshot
Rest Client

To be continue

Reference

Testing your API with REST Client
https://res.cloudinary.com/practicaldev/image/fetch/s--F1ngOkbZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://techwatching.dev/posts/images/restclient_swapi_2.png
REST Client
https://marketplace.visualstudio.com/items?itemName=humao.rest-client
Gitlens
https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens

Hmmmm, To be continue …

Disqus 对于静态站点着实好用,设计理念也能把言论处理的复杂度隔离开来 …
但是需要实现Disqus API的反向代理,于是乎开始了复习和整理 Nginx 反向代理的旅程

URL && URI

在做Location过滤前首先得了解什么是 URL 和 URI

A Uniform Resource Locator (URL), colloquially termed a web address,[1] is a reference to a web resource that specifies its location on a computer network and a mechanism for retrieving it. A URL is a specific type of Uniform Resource Identifier (URI),[2][3] although many people use the two terms interchangeably.[4][a] URLs occur most commonly to reference web pages (http), but are also used for file transfer (ftp), email (mailto), database access (JDBC), and many other applications.

Most web browsers display the URL of a web page above the page in an address bar. A typical URL could have the form http://www.example.com/index.html, which indicates a protocol (http), a hostname (www.example.com), and a file name (index.html).

A Uniform Resource Locator (URL) is a URI that specifies the means of acting upon or obtaining the representation of a resource, i.e. specifying both its primary access mechanism and network location. For example, the URL http://example.org/wiki/Main_Page refers to a resource identified as /wiki/Main_Page, whose representation, in the form of HTML and related code, is obtainable via the Hypertext Transfer Protocol (http:) from a network host whose domain name is example.org.

You can refer to the origin
https://en.wikipedia.org/wiki/URL
https://en.wikipedia.org/wiki/Uniform_Resource_Identifier

Nginx Location

Nginx 用 Location 的这个语法来匹配 URI
Locaiton 的匹配是自上而下以匹配项最多的那条规则为准,只有后面的正则表达式没有匹配到时,这一条才会采用当前rule

Symbole Sample Remark
= Location = / {} 精准匹配,匹配 https://leonvision.online/
~ Location ~ /finance/ {} 区分大小写的匹配规则,匹配Finance这个分类:https://leonvision.online/finance
^~ Location ^~ /finance/ {} 匹配以finance开头的URL
~* Locaiton ~* /finance/ {} 不区分大小写的匹配规则 |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
localtion / {
# 所有请求都匹配以下规则
# 因为所有的地址都以 / 开头,所以这条规则将匹配到所有请求
}

location = / {
# 精确匹配 / ,后面带任何字符串的地址都不符合
}

localtion /api {
# 匹配任何 /api 开头的URL,包括 /api 后面任意的, 比如 /api/getList
# 匹配符合以后,还要继续往下搜索
# 只有后面的正则表达式没有匹配到时,这一条才会采用这一条
}

localtion ~ /api/abc {
# 匹配任何 /api/abc 开头的URL,包括 /api/abc 后面任意的, 比如 /api/abc/getList
# 匹配符合以后,还要继续往下搜索
# 只有后面的正则表达式没有匹配到时,这一条才会采用这一条
}

Nginx Cross-Origin Resource Sharing(代理跨域转发)

Scenario

本地启动了一个前后端分离的WEB应用,端口为:3000,可以通过 http://127.0.0.1:3000 访问前端页面,页面中有些Ajax请求的地址为 http://127.0.0.1:3000/api/getList ,一般情况下肯定是404或者请求失败

这种后端服务的接口存放在于其他的服务器中,比如在公司内网可以通过 http://172.30.1.123:8081/api/getList 访问到测试环境中的服务接口。这种情况的请求就涉及到端口不一样的跨域了,那么我们可以利用Nginx代理请求。

Nginx Configuration

Config it in {NGINX_ROOT}/nginx.conf

1
2
3
4
5
6
7
8
9
10
11
12
server {
    listen  80;
    server_name 127.0.0.1;

    location / {
        proxy_pass  http://127.0.0.1:3000;
    }

    location ~ /api/ {
        proxy_pass  http://172.30.1.123:8081;
    }
}

Nginx is lisening in port 80,将 http://127.0.0.1 的所有请求服务转发到 127.0.0.1 端口为 3000;
http://127.0.0.1/api/ 或者 http://127.0.0.1/api/getList 请求转发到 http://172.30.1.123:8081

Scenario for Disqus

Assign your domain name(https://disqus.leonvision.online) to your host
and dset the header to destination service.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;

server_name disqusproxy.leonvision.online;

# ECDSA
ssl_certificate /path/to/ssl/disqusproxy.leonvision.online_ecc/fullchain.cer;
ssl_certificate_key /path/to/ssl/disqusproxy.leonvision.online_ecc/disqusproxy.leonvision.online.key;

ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
ssl_prefer_server_ciphers on;

location ~ / {
proxy_pass https://disqus.com/api$request_uri;

# proxy_set_header Host $Host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header Referer https://disqus.com;
proxy_set_header Origin https://disqus.com;

proxy_redirect off;

add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-S
ince,Cache-Control,Content-Type,Authorization';

}

}
Symbole Remark
proxy_set_header 改变HTTP的请求头
Host destination Host name
X-Real-IP 请求的真实IP
X-Forwarded-For 请求是由谁发起的
Referer 发起请求方的URI
Origin 发起请求方的domain

*Reference *
Disqus API 反向代理

Rewrite

TBC

Trace the log to debug in Nginx

Customize the log format for proxy

1
2
3
4
5
6
7
8
9
10
11
http {
...
log_format proxy_disqus_logging '[$time_local] $remote_addr - $remote_user - $server_name to: $upstream_addr : $request upstream_response_time $upstream_response_time msec $msec request_time $request_time'
' - http_referer: $http_referer - http_host $http_host '
'- https://disqus.com/api + request_uri: https://disqus.com/api$request_uri - body_bytes_sent: $body_bytes_sent';

server {
...
access_log /path/to/api_logging.log proxy_disqus_logging;
}
}

We can google more variable in Nginx for diefferent Scenario.

Tail the real time log to debug the configuration of Nginx

tail -f /var/log/nginx/api_logging.log

Http Response Code

Code Remark
301 永久转发
302 临时转发
400 服务器不理解请求的语法
404 服务器无法找到请求的页面
500 服务器内部错误,无法处理请求
200 服务器已成功处理了请求并返回了页面

虽然反向Disqus API代理成功,但是博主碰到github page的又一个限制Header不允许多个origin,还需要进一步调整成品,博主困了,未完待续 (To be continue)

Reference

通过 Nginx 代理转发配置实现跨域
https://www.thinktxt.com/nginx/2017/03/06/cross-domain-by-nginx-proxy-setting.html
nginx配置location总结及rewrite规则写法
https://segmentfault.com/a/1190000002797606
nginx配置文件中$request_uri到底是指的url里哪部分
https://blog.csdn.net/cn_yaojin/article/details/80334604
Nginx Resolver
https://www.nginx.com/resources/wiki/modules/domain_resolve/
Nginx Resolver without IPV6
https://ms2008.github.io/2018/01/09/nginx-resolver/
Disqus API 反向代理
https://medium.com/cnhinata/disqus-api-%E5%8F%8D%E5%90%91%E4%BB%A3%E7%90%86-70d11d8e39af
Nginx 变量定义
https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/log-format/

这是一份之前给初级期权学习者讲的学习指南PPT页
整体的过滤风格就是尽量风险相对可控,可以根据根据关键字Google一下后学习一下

  1. 什么是美式期权(Option)

    1. 100 shares per contract
    2. Naked call && naked put
  2. 买方期权的基本特点

    1. Limited risk
    2. High leverage
    3. Time value decay
  3. 期权的波动率和Greeks

    1. Implied Volatility
    2. Theta && Delta
    3. Implied Vol / history Vol
  4. 期权的基本操作

    1. Buy the naked call && put
    2. Exercise the option
    3. Roll the option
  5. 常用的简单的期权组合(Debt && Protection Strategies)

    1. Covered Call
    2. Bull Call
    3. Bear Put
    4. Long Straddle

学习型的投资者可以加入我的讨论组进行交流讨论

Finance Group in Telegram : My Financial Telegram Group
Finance Group in Discord : My Financial Discord Group
微信讨论群可以关注微信公众号: iLeonVision 发信息跟我要进群二维码


趋势投资需要注意进行窗口管理,而主动地管理US Calendar Effect来进行买卖时机的判断显得颇具预见性,并且增加了买卖的确定性

Monthly Report

美国每个月初都会有周期性的数据密集发布,引起市场剧烈波动,这种周期性的数据发布机制有利于提高透明度,让市场有机会修正以进一步拟合经济现状,同时提升了趋势交易的流动性

作为短线交易者在上个月底的时候就需要提前对下月初的持仓和方向进行权衡,及时调整仓位控制风险


Date Indicator
每个月第一个工作日 ISM - Manufacturing Index - Institute of Supply Management Manufacturing Index
每个月第一个星期三 ADP - National Enployment Reports
每个月第一个周五 NFP - Nonfarm Payroll
每个月第一周 ISM Non-Manufacturing PMI
每个月15号左右 US Retail Sale

ISM Manufacturing Index

ISM Manufacturing Index : Institute of Supply Management Manufacturing Index
Rating :4 stars
Publish Date:在相应月份结束后第一个工作日上午10点整(EST - 5:00)
Frequency:Monthly
Agency:Institute of Supply Management(美国供应管理协会)
修正:不做月度修改,但是每年的一月份对季节调整因素进行评估,这可能导致所有数据的变化

Tips:
似乎在ISM数据发布之前会发布 美国10月芝加哥PMI 作为前瞻性参考

Reference

ISM指数
https://wiki.mbalib.com/wiki/ISM指数
ISM Report
https://www.instituteforsupplymanagement.org/ISMReport/MfgROB.cfm?SSO=1

ADP National Enployment Reports

Rating : 3 stars
Frequency:Monthly
Agency:ADP Research Institute
Publish Date:一般在每个月的第一个周三晚(夏令时20:15,冬令时21:15)

The ADP National Employment Report® is published monthly by the ADP Research Institute® in close collaboration with Moody’s Analytics and its experienced team of labor market researchers. The ADP National Employment Report provides a monthly snapshot of U.S. nonfarm private sector Employment based on actual transactional payroll data.

ADP National Enployment Reports 是在非农数据公布的前两天公布的,对非农数据有指引作用,人称“小非农” ,交易上倾向于根据小非农的数据来押注非农数据方向

Reference
ADP National Enployment Reports
https://www.adpemploymentreport.com

NFP

NFP : Nonfarm Payroll
Rating : 5 stars
Frequency:Monthly
Publish Date :每月第一周周五(夏令时20:30、冬令时21:30)
Agency:美国劳工部劳动统计局

非农数据,是指非农业就业人数、就业率和失业率这三个数值,是反映美国非农业人口的就业状况的数据指标,是美联储衡量国家经济、调整货币政策的重要依据

Reference
Nonfarm payrolls
https://en.wikipedia.org/wiki/Nonfarm_payrolls

US Retail Sale

US Retail Sale : 美国核心零售销售月率
Rating : 4 stars
Publish Date : 每个月15号前后公布上个月数据
Agency: 美国商务部

核心零售销售额是根据美国各种类型和规模的零售商店(不含汽车销售商店)抽样调查中所获得的零售商所售出的所有消费品销售额变动而作出的月度衡量。 它是消费开支的重要指标,并与消费者信心指数有关,被认为是美国经济的速度指标。
如果该指标比预期更高,则应认为美元强势/看涨,而如果该指标比预期更低,则应认为美元弱势/看跌。

ISM Non-Manufacturing PMI

ISM Non-Manufacturing PMI :ISM非制造业PMI
Rating : 3 stars
Agency: Institute for supply management
Publish Date : 每个月第一周

供应管理研究所(ISM)非制造业指数(也称为ISM服务业)所跟踪的是上月发生的非制造业活动的数量。
任何超过50的指数表示扩大,小于50的表示缩小。
它对于GDP的影响比ISM制造业指数的要小得多。
如果该指标比预期更高,则应认为美元强势/看涨,而如果该指标比预期更低,则应认为美元弱势/看跌。

在美国,非制造业在经济中的比重高达75%以上,因此相关企业的就业趋势、新增订单及价格的变化对于观测美国经济整体变化也是不可或缺的。为了满足这一需求,ISM这一代表全国的公司采购经纪人的组织从1998年6月开始发布自己所编制的指数。尽管一开始,这项数据并没有引起太多人的足够重视,但随着时间的推移,经济学家以及政客们开始越来越关注这份公布及时且有助于预测重要经济指标(例如:通胀数据、就业数据)变化的经济指标。该指数有10个分指数,其中商业活动指数最为重要,其它9个分指数是新订单,供应商交货时间,就业,存货,物价,未完成订单,新出口订单,进口以及预期存货。

ISM每月将调查问卷发给17个行业的370多个采购经纪人,包括法律服务、娱乐、不动产、交通、保险、运输、银行以及宾馆。每个行业被调查公司所占的比例取决于该部门对GDP的贡献率。被调查者要求回答他们对以下所列出的对象的真实感受(高涨、冷清还是没变)

Annually Report


Date Report
每半年一次 Federal Reserve System Monetary Policy Report

Federal Reserve System Monetary Policy Report

Federal Reserve System Monetary Policy Report : 美联储货币政策报告
Rating: 2 stars
Agency: Federal Reserve
Publish Date : 每半年一次

美联储(FED)货币政策报告是由美联储每六个月向国会提交的一份书面报告:包括负责银行业,住房和城市管理的参议院委员会,以及负责金融服务的众议院委员会。

该报告由三部分组成。第一部分包含对影响本国货币汇率的当前经济和金融发展的评估。它还提供了劳动力市场状况、GDP动态和GDP变化特征的描述,以及经济稳定性的评估和银行业发展的数据。

该报告的第二部分包括对国家货币政策的描述:采取的措施、对这些措施的解释以及实施措施的效率。在该报告中,监管机构描述了短期利率的变化和量化宽松的措施,以及国家外汇储备状况和金融体系的平衡。美国货币政策是由FOMC(联邦公开市场委员会)制定,旨在保持物价稳定、经济增长、充分就业和国际贸易的稳定性。

在第三部分中,美联储根据对当前事态发展的分析,对通货膨胀、失业率和经济增长情况提供了简要展望。

美联储报告是公开的。根据报告内容,经济学家试图预测美联储近期的利率变化并评估美国通货膨胀和经济前景。这份报告的发表对美元报价的影响轻微,因为其中包含的数据是事先知道的,美联储提供的解读也是可以预测的。

To be continues


学习型的投资者可以加入我的讨论组进行交流讨论

Finance Group in Telegram : My Financial Telegram Group
Finance Group in Discord : My Financial Discord Group
微信讨论群可以关注微信公众号: iLeonVision 发信息跟我要进群二维码


Reference

monetary policy
https://www.federalreserve.gov/monetarypolicy.htm

Calendar Effect
https://en.wikipedia.org/wiki/Calendar_effect

CC licenses usually used

CC BY(署名)
CC BY-SA(署名-相同方式共享)
CC BY-ND(署名-禁止演绎)
CC BY-NC(署名-非商业性使用)
CC BY-NC-SA(署名-非商业性使用-相同方式共享 )
CC BY-NC-ND(署名-非商业性使用-禁止演绎)
关于以上协议的解释详见 https://creativecommons.org/licenses/

License of this Blog (此博客的授权证书)

This blog(Https://leonvision.online) licensed on CC BY-NC-ND 4.0 (此博客授权在 CC BY-NC-ND 4.0)
License_url : https://creativecommons.org/licenses/by-nc-nd/4.0/

CC BY-NC-ND 4.0 的摘录

You are free to:

Share — copy and redistribute the material in any medium or format
The licensor cannot revoke these freedoms as long as you follow the license terms.

Under the following terms:

Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

NonCommercial — You may not use the material for commercial purposes.

NoDerivatives — If you remix, transform, or build upon the material, you may not distribute the modified material.

No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.

Notices:

You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation.
No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.

Enable the post footprint in the {next}/_config.yml

creative_commons:
license: by-nc-nd
sidebar: true
post: true
language: deed.en

Markdown 版本的 CC BY-NC-ND 4.0

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
### You are free to:   
Share — copy and redistribute the material in any medium or format
The licensor cannot revoke these freedoms as long as you follow the license terms.

### Under the following terms:
**Attribution** — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

**NonCommercial** — You may not use the material for commercial purposes.

**NoDerivatives** — If you remix, transform, or build upon the material, you may not distribute the modified material.

**No additional restrictions** — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.

### Notices:
You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation.
No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.

Hexo is flexible blog system and Next comes with bundle of extensions to make it easier to use hexo blog.

Component Version
hexo 4.2
hexo-theme-next 7.7

Hexo Init

$ hexo init # Initial the project
$ npm install # download the independencies
$ tree ./ -L 1 # Just review the file tree
$ hexo g # Generate the html
$ hexo s # Start the server
$ code _config.yml

1
2
3
4
deploy:
type: git
repo: # your github repo
branch: master

Custom Domain Name

add a new file “CNAME” under the folder /public/
add your domain name as the content

1
$ echo "domain name" > ./public/CNAME

Custom Theme

$ git clone https://github.com/theme-next/hexo-theme-next.git themes/theme_next
change the content in the _config.yml

1
theme: theme_next

$ hexo clean # clean public/

Link to the homepage : https://theme-next.org

Google Adsense

  • Add a file source/_data/header.swig.
  • past the from google adsense on it
  • uncomment the line in themes/theme_next/_config.yml
    1
    2
    3
    4
    5
    6
    # Define custom file paths.
    # Create your custom files in site directory `source/_data` and uncomment needed files below.
    custom_file_path:
    #head: source/_data/head.swig
    header: source/_data/header.swig
    #sidebar: source/_data/sidebar.swig

more detail in google-analytics-and-adsense-in-hexo

Comment System

Disqus

Disqus can allow the anonymous, but it can not use in China.

Add Comments Section to Your Hexo Blog

DisqusJS can help us to go through the whole world
https://theme-next.org/docs/third-party-services/comments

Valine

This is good enough to approach it.

https://juejin.im/post/5d790e706fb9a06af8250665

delete the comment on valine

登录Leancloud>选择你创建的应用>存储>选择ClassComment

Hexo Editor - Typora

Typora is a what you see is what you get system.

Here is my another tutorial
https://leonvision.online/technology/wysiwyg-markdown-editor-typora/

or use evernote for China to edit the markdown

Global Avatar

Add the url into the Avatar section in the _config
Refer to the link as below:
https://en.gravatar.com/emails/

Search

Enable the local serach in the _config.yml of theme-next

local_search:
  enable: true

Google Analysis

Enable in {theme/to/next}/_config.yml

google_analytics:
  tracking_id: UA-number
  localhost_ignored: false

and also using the google tag manager to integrate the google analysis is better choice.

RSS Feed

Installation

1
npm install hexo-generator-feed --save

Configuration
In {ROOT}/themes/theme_next/_config.yml

1
2
social:
RSS: /atom.xml || rss

Categories & Tags

Only posts support the use of categories and tags. Categories apply to posts in order, resulting in a hierarchy of classifications and sub-classifications. Tags are all defined on the same hierarchical level so the order in which they appear is not important.

Example

1
2
3
4
5
6
7
categories:
- Sports
- Baseball
tags:
- Injury
- Fight
- Shocking

The classification records in the front-matter of the the source of markdown file
https://raw.githubusercontent.com/qzi/qzi.github.io/hexo/source/_posts/technology/hexo-go.md

Front-matter is a block of YAML or JSON at the beginning of the file that is used to configure settings for your writings. Front-matter is terminated by three dashes when written in YAML or three semicolons when written in JSON.
https://hexo.io/docs/front-matter.html

Configuration

Configuration in the [hexo_project]/[themes]/[next]/_config.yml

1
2
3
4
5
6
7
# External url should start with http:// or https://
menu:
home: / || home
about: /about/ || user
tags: /tags/ || tags
categories: /categories/ || th
archives: /archives/ || archive

Enhance Image Reference

Installation
$ npm i –save hexo-asset-link

Markdown Syntax

1
2
![Rest Client](./my-favorite-extensions-for-visual-studio-code/rest-client.jpg)
![Rest Client](my-favorite-extensions-for-visual-studio-code/rest-client.jpg)

Reference
Image to Hexo
https://liolok.github.io/zh-CN/How-to-Add-Image-to-Hexo-Blog-Post/

Post Excerpt

Manually add more excerpt in the front-matter of the markdown file

1
2
3
4
5
---
title: 中文等宽字体(Monospace Chinese Font Family)
date: 2019-12-26 00:52:18
excerpt: ' 中文等宽字体,一个中文字符等宽两个英文字符,Mac下很多字体( Menlo, Monaco, Courier New, Source Code Pro )没有严格遵循或者说达不到这个标准, 它们不包括CJK的字库,有的时候用一些 markdown table formatter 会导致不整齐,其实并不是排列不整齐,而是字体的宽度不同 '
---

Configuration

Configuration in the [hexo_project]/[themes]/[next]/_config.yml

1
2
3
4
5
6
# Automatically excerpt description in homepage as preamble text.
excerpt_description: true

# Read more button
# If true, the read more button will be displayed in excerpt section.
read_more_btn: true

Refer to https://hexo.io/docs/tag-plugins#Post-Excerpt

Mermaid Surpport for Diagram

Hexo Next already supported the mermaid nested.
https://github.com/theme-next/theme-next.org/blob/source/source/docs/tag-plugins/mermaid.md

Next use its own tag system to convert the diagram. so we need to fixed it aligning the common markdown practice.

npm install hexo-filter-mermaid-diagrams save

This filter will convert the indicator '''mermaid to <pre class="mermaid">, and then mermaid.js will filter the elememet and redender them.

Embed Video

Just copy the code of the html in YouTube and add YouTube video in Hexo-markdown

1
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/E46_veB0DPU" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Force to Refresh the Browser

Presss Shift + Command + R to force to refresh the browser(Chrome) to test the result in Mac

Presss Option + Command + R to force to refresh the browser(Safari) to test the result in Mac

Reference:

Hexo backup
https://blog.itswincer.com/posts/7efd2818/

Add google adsense
https://juejin.im/post/5c95d230e51d45124e35cef6

Third party for theme next
https://theme-next.iissnan.com/third-party-services.html

Wirit the post
https://hexo.io/zh-cn/docs/writing.html

Front-matter
https://hexo.io/docs/front-matter.html

asset folder
https://hexo.io/docs/asset-folders