Skip to content

add custom head #289

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

Merged
merged 1 commit into from
Aug 10, 2017
Merged

add custom head #289

merged 1 commit into from
Aug 10, 2017

Conversation

OhYee
Copy link
Contributor

@OhYee OhYee commented Aug 10, 2017

用户可以在 Blog/sources/_date/head.yml 中直接添加head的内容
如:

css: "<link href='/css/My.css' rel='stylesheet' type='text/css' />"
js: "<script type='text/javascript' src='/js/My.js'></script>"

这样就可以直接添加自己需要的信息到头部了

代码来自于 Material Theme
说明文档
如果想要在站点添加自定义 font-face 或者统计代码(例如 Google Analytics)。
需要在 hexo 目录下的 source 文件夹内创建一个名为 _data(禁止改名)的文件夹,并在文件内创建一个名为 head.yml 的文件。
单个代码格式为:

Name: "put your code here"

代码将显示在 </head> 之前,
Name 将作为注释显示在代码上方。

@yscoder yscoder merged commit caf586e into yscoder:card Aug 10, 2017
@OhYee OhYee deleted the head branch August 15, 2017 03:19
triplekiller pushed a commit to triplekiller/hexo-theme-indigo that referenced this pull request Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants