一、实验目的
- 熟悉Github网站
- 掌握Markdown语法
二、实验任务
- 注册Github账号
- 创建Gihub Pages repository
- 发布第一篇博客
- 学习Markdown
- 利用Hexo生成博客并部署到Github
三、实验步骤与结果
注册Github账号
账号:chenxuean创建Gihub Pages repository
Repository:chenxuean.github.io发布第一篇博客(并与同学一起互相修改):
如下图:利用Hexo生成博客并部署到Github
安装git
安装node
设置npm镜像为淘宝
npm install -g cnpm –registry=https://registry.npm.taobao.org安装hexo
npm install -g hexo-cli初始化站点
- hexo init myhexo
- cd myhexo
- npm install
浏览本地站点
hexo server修改配置文件_config.yml的deploy部分
deploy:
type: git
repository: https://github.com/chenxuean/chenxuean.github.io.git
branch: master配置site部分
title: 陈雪的博客
subtitle:
description:
author: 陈雪
language: zh-CN
timezone: Asia/Shanghai安装 hexo-deployer-git
npm install hexo-deployer-git –save配置git全局邮箱与名字
1)git config –global user.email “1119835543@qq.com”
2)git config –global user.name “chenxuean”最后:
生成博客:hexo generate
部署博客:hexo deploy
添加新文章
1)生成新文章
hexo new newblog
2)用编辑器修改文章:myhexo\source_posts\newblog.md
3)生成并发布到Github
hexo d -g- 实验结果:
四、实验小结
- 通过学习Github,学会了如何创建属于自己的一个博客。但是学的比较浅层,还需多加练习,深入学习。