当前位置: 首页 > Web前端 > CSS

hexo+css创建自己的博客(build)

时间:2023-03-31 01:50:04 CSS

1.什么是hexo?Hexo是一个快速、简洁、高效的博客框架。使用Markdown(或其他渲染引擎)解析文章。主题生成静态网页。目前流行的vue和weex文档都是使用hexo框架实现的。2、hexo的安装在安装hexo之前,请确保电脑中已经安装了node和git。node安装方法一、直接安装node:ruby-e"$(curl-fsSLhttps://raw.githubusercontent.com/Homebrew/install/master/install)"方法二、先安装homebrew:/usr/bin/ruby-e"$(curl-fsSLhttps://raw.githubusercontent.com/Homebrew/install/master/install)"安装节点后:brewinstallnodegitinstallation首先安装自制软件:/usr/bin/ruby-e"$(curl-fsSLhttps://raw.githubusercontent.com/Homebrew/install/master/install)”然后安装git:brewinstallgithexoinstallnpminstall-ghexo-cli3.新建一个项目:hexoinit文件夹进入:cd文件夹>安装依赖包:npminstall新建文章:hexonewiOS-APIs(文件会在/source/_posts下)启动:hexoserver打开浏览器:http://localhost:4000/document/四、hexo配置配置文件为_config.yml参考:https://hexo.io/docs/configur...github:https://github.com/hexojs/hexo/Site(网站)网站标题:weex用户手动网站副标题:Weex中文手册网站说明说明:整理weex手册,包括常用特性、内置组件、内置模块、CSS单元、常用事件、NativeDOMAPIs、Weex实例变量、Web标准、JSService、Vue、进阶knowledge,迁移作者姓名author:lu.wei网站使用的语言language:SimplifiedChinese网站时区Hexo默认使用你电脑的时区。时区列表。例如:America/New_York、Japan和UTC。timezone:UTCURL(URL)如果您的网站存储在子目录中,例如http://yoursite.com/blog,那么请将您的url设为http://yoursite.com/blog,root设为/blog/。URLurl:https://github.com/stardew516...网站根目录root:/document/文章永久链接格式permalink::year/:month/:day/:title/默认值permalink_defaults:目录(directory)资源文件夹中的每个部分,这个文件夹用来存放内容。source_dir:源公用文件夹,该文件夹用于存放生成的站点文件。public_dir:公共标签文件夹tag_dir:标签归档文件夹archive_dir:归档类别文件夹category_dir:categoriesInclude代码文件夹code_dir:downloads/codeinternationalization(i18n)文件夹i18n_dir::lang跳过指定文件的渲染,可以使用glob表达式匹配路径。skip_render:Writing(article)新建文章的文件名new_post_name::title.md默认布局default_layout:post中英文之间加一个空格auto_spacing:false将标题转换为titlecasetitlecase:false在新标签页打开链接external_link:true将文件名转换为(1)小写或(2)大写filename_case:0显示草稿render_drafts:false启动资产文件夹post_asset_folder:true将链接更改为相对于根relative_link:false显示未来的文章future:True代码块设置突出显示:enable:trueline_number:trueauto_detect:truetab_replace:Homepagesetting(主页设置)1.path:博客索引页的根路径,默认为空2.per_page:每页显示的文章数,当为0,表示不分页3.order_by:排序,默认日期降序index_generator:path:''per_page:10order_by:-dateCategory&Tag(类别&标签)默认类别default_category:uncategorizedcategorynamecategory_map:标签别名tag_map:Date/Timeformat(日期/时间格式)hexo使用Moment.js解析显示时间。可以参考http://momentjs.com/docs/#/di...自定义日期格式。日期格式date_format:YYYY-MM-DD时间格式time_format:HH:mm:ssPagination(分页)每页显示的文章数量(0=关闭分页功能)per_page:10分页目录pagination_dir:pageExtensions(扩展)plugin:https://hexo.io/plugins/themes:https://hexo.io/themes/当前主题名称。值为false时禁用主题theme:landscapeDeployment(部署)参考:https://hexo.io/docs/deployme...部署部分的配置deploy:type:gitrepo:https://github.com/stardew516/documentbranch:mastermessage:hexo+css5.在github上部署Deploy:Installhexo-deployer-git:npminstallhexo-deployer-git--save_config.ymlConfigure#Deploymentsectionsettingsdeploy:type:gitrepo:https://github.com/stardew516/documentbranch:mastermessage:hexo+css终端进入目录,运行:hexodeploy