抱歉,您的浏览器无法访问本站

本页面需要浏览器支持(启用)JavaScript


了解详情 >

如何写出漂亮的博客,参考网络上好的写法,个人心得的积累。

1.标题

1.1 标题间隔

大的标题之间使用分隔符

1.2 段落小标题

讨论小标题分类。比如优点、缺点,可以在标题前加❀这样的,美观方便与正文内容区分。

♦例:

​ ❀优点
​ 12345
​ ❀缺点
​ 67890


2.列举说明

2.1 短列举,短说明

使用table格式

参数说明
thisthis指针
public访问权限修饰符公共
protected访问权限修饰符保护

2.2 短列举,长说明

使用加粗+代码行的格式 进行列举。
shift+回车段落换行缩进进行描述。
参数之间使用双回车空行或者回车段落间隔。

♦例:

data
The object passed from the other window.

origin
The origin of the window that sent the message at the time postMessage was called. This string is the concatenation of the protocol and “😕/”, the host name if one exists, and “:” followed by a port number if a port is present and differs from the default port for the given protocol. Examples of typical origins are https://example.org (implying port 443), http://example.net (implying port 80), and http://example.com:8080. Note that this origin is not guaranteed to be the current or future origin of that window, which might have been navigated to a different location since postMessage was called.

source
A reference to the window object that sent the message; you can use this to establish two-way communication between two windows with different origins.

2.3 关键列举,长说明

关键列举可以在列举取出列举的关键字,并且将列举标题话。一些命令行的语句。

♦例:

2.4 init

1
$ hexo init [folder]

新建一个网站。如果没有设置 folder ,Hexo 默认在目前的文件夹建立网站。

This command is a shortcut that runs the following steps:

  1. Git clone hexo-starter including hexo-theme-landscape into the current directory or a target folder if specified.
  2. Install dependencies using a package manager: Yarn 1, pnpm or npm, whichever is installed; if there are more than one installed, the priority is as listed. npm is bundled with Node.js by default.

2.5 new

1
$ hexo new [layout] <title>

新建一篇文章。如果没有设置 layout 的话,默认使用 _config.yml 中的 default_layout 参数代替。如果标题包含空格的话,请使用引号括起来。

1
$ hexo new "post title with whitespace"
参数描述
-p, --path自定义新文章的路径
-r, --replace如果存在同名文章,将其替换
-s, --slug文章的 Slug,作为新文章的文件名和发布后的 URL

默认情况下,Hexo 会使用文章的标题来决定文章文件的路径。对于独立页面来说,Hexo 会创建一个以标题为名字的目录,并在目录中放置一个 index.md 文件。你可以使用 --path 参数来覆盖上述行为、自行决定文件的目录:

1
hexo new page --path about/me "About me"

以上命令会创建一个 source/about/me.md 文件,同时 Front Matter 中的 title 为 "About me"

评论