个人网站搭建第一天
- 首先在github上注册一个账号,下载Git到本地
- Git装好后,在git bash 中新建一个文件目录用来存放网站地址,执行命令mkdir my-site && cd my-site
- 在github中为网站建立一个仓库,命名为username.github.com.io,我的命名为elain.github.com.io
- 在gitbash中执行 git init 和git remote add origin https://github.com/username/username.github.io.git命令,注意用你的用户名替换username。
- 在网站目录下新建一个index.html的文件
<!DOCTYPE html>
<html>
<head>
<title>我的个人网站</title>
<!-- Add some style to your site, see http://getbootstrap.com for details -->
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
</head>
<body>
<h1>我的个人网站</h1>
<p>第一段,hello</p>
<p>第二段,哈哈</p>
</body>
</html>
(由于目前还没有考虑发布,域名暂时不买)
- 可以在本地查看文件,安装python2,执行python –m SimpleHTTPServer 8000,在浏览器中打开http://localhost:8000即可,如果你用的是Python3,执行python –m http.server 8000
最开始的一步就完成啦,明天继续!