Hexo初始指南

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

1
2
3
4
#include <stdio.h>
int main() {
printf("hello world!\n");
}

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment

嵌入图片的操作探索

  • 这一种是标签插件
    hexo-renderer-marked 3.1.0+ 可以(可选)自动解析图片的文章路径,参考 本节 如何启用它。

“foo.jpg” 位于 http://example.com/2020/01/02/hello/foo.jpg。

默认(无选项)

自定义 class 属性 展示尺寸 title 和 alt 属性 dolor
  • 这一种是辅助函数
    image_tag
    插入图片。

<%- image_tag(path, [options]) %>
选项 描述
alt 图片的替代文字
class Class 名称
id ID
width 图片宽度
height 图片高度

  • 还有一种是使用markdown嵌入图片
    hexo-renderer-marked 3.1.0 引入了一个新的选项,其允许你无需使用 asset_img 标签插件就可以在 markdown 中嵌入图片

如需启用:

_config.yml
post_asset_folder: true
marked:
prependRoot: true
postAsset: true
启用后,资源图片将会被自动解析为其对应文章的路径。 例如: image.jpg 位置为 /2020/01/02/foo/image.jpg ,这表示它是 /2020/01/02/foo/ 文章的一张资源图片, 将会被解析为

  • Copyrights © 2024-2025 brocademaple
  • 访问人数: | 浏览次数:

      请我喝杯咖啡吧~

      支付宝
      微信