核心提示:一、介绍1.Hexo is A fast, simplepowerful blog framework. You write posts in?Markdown?(or other languages...
一、介绍
1.Hexo is A fast, simple & powerful blog framework. You write posts in?Markdown?(or other languages) and Hexo generates static files with a beautiful theme in seconds.
二、工程文件介绍
1、Hexo生成的工程文件目录如下。
// node_modules:是依赖包 public:存放的是生成的页面 scaffolds:命令生成文章等的模板 source:用命令创建的各种文章 themes:主题 _config.yml:整个博客的配置 db.json:source解析所得到的 package.json:项目所需模块项目的配置信息 // //
三、_config.yml文件介绍
// # Hexo Configuration ## Docs: https://hexo.io/docs/configuration.html ## Source: https://github.com/hexojs/hexo/ # Site,参数说明:title 网站标题;subtitle 网站副标题;description 网站描述,在搜索引擎中可被搜索的信息,
可以配置描述关键字;author 作者姓名;language 网站语言;timezone 网站时区; # 默认使用电脑本地时区,可以用时区表指定,如America/New_York,UTC等。 title: Binglumeng's Blog subtitle: Just do what you want ! author: 冰路梦 language: timezone: # URL ## If your site is put in a subdirectory, set url as 'https://yoursite.com/child' and root as '/child/' # 参数说明:url 网址;root 网址根目录,要是网站存放在子目录,这里就要配置到子目录路径,
如url是https://binglumeng.github.io ,而https://binglumeng.github.io/blog才是文件路径,那么root就要设置为/blog/; # permalink 文章永久链接格式,:year/:month/:day/:title/ ;permalink_defaults 永久链接中各部分的默认值。 url: https://binglumeng.github.io/ # root就是网址路径path root: /binglumeng/ permalink: :year/:month/:day/:title/ permalink_defaults: # Directory 目录参数说明:source_dir 资源文件夹,用于存放内容,默认值source;public_dir 公共文件夹,
存放生成的站点文件,默认值public; # tag_dir 标签文件夹 默认值tag;archive_dir 归档文件夹 默认值archives;category_dir 分类文件夹,默认值categories; # code_dir include code 文件夹,默认值 downloads/code ;i18n_dir 国际化文件夹 ,默认值 :lang ;
skip_render 跳过指定的渲染,可以使用glob表达式来匹配路径。 source_dir: source public_dir: public tag_dir: tags archive_dir: i_dont_wanna_use_default_archives category_dir: categories code_dir: downloads/code i18n_dir: :lang skip_render: # Writing 文章相关参数:new_post_name 新文章文件名 ,默认值:title.md ; # default_category 预设布局,默认值 post ; # auto_spacing 中英文之间加入空格,默认 false; # titlecase 把标题转换为title case 默认值 false; # external_link 新标签中打开链接 ,默认值 true; # filename_case 把文件名转换为(1)小写或(2)大写。默认值0; # render_drafts 显示草稿,默认值false; # post_asset_folder 启动Asset文件夹,默认值false; # relative_link 把链接改为与根目录的相对路径位置,默认值false; # future 显示未来的文章,默认值true; # highlight 代码块设置 new_post_name: :title.md # File name of new posts default_layout: post titlecase: false # Transform title into titlecase external_link: true # Open external links in new tab filename_case: 0 render_drafts: false post_asset_folder: true relative_link: false future: true highlight: enable: true line_number: true auto_detect: true tab_replace: # Category & Tag 分类和标签 ,default_categorty 默认分类,默认值 uncategorized; # category_map 分类别名;tag_map 标签别名 default_category: uncategorized category_map: tag_map: # Date / Time format 日期时间格式 date_format 日期格式 ,默认是YYYY-MM-DD ;time_format 时间格式 ,H:mm:ss ## Hexo uses Moment.js to parse and display date ## You can customize the date format as defined in ## https://momentjs.com/docs/#/displaying/format/ date_format: YYYY-MM-DD time_format: HH:mm:ss # Pagination 分页 per_page 每页显示的文章数,0表示关闭分页。默认值10; # pagination_dir 分页目录,默认值page ## Set per_page to 0 to disable pagination per_page: 10 pagination_dir: page # Extensions 扩展,theme 当前主题的名称 ,false表示禁止使用主题。 ## Plugins: https://hexo.io/plugins/ ## Themes: https://hexo.io/themes/ theme: binglumeng # Deployment 部署的设置 ## Docs: https://hexo.io/docs/deployment.html deploy: type: git repo: https://github.com/ branch: master //