Table of Contents
准备工作
创建github博客
域名绑定
更新博客
Home Web Front-end HTML Tutorial [iOS] 个人博客创建流程_html/css_WEB-ITnose

[iOS] 个人博客创建流程_html/css_WEB-ITnose

Jun 24, 2016 am 11:17 AM

最近自己瞎搞了一个个人博客,个人觉得还不错,决定把制作博客的过程写下来,帮助想要构建自己博客的朋友们。

准备工作

首先,我们需要在github上面创建一个账号。如果你还没有github账号,那么可以在首页进行快速注册

填写完成确定信息没有重复的情况下,点击下面的Sign up for Github按钮,然后跳转到新界面。新界面用来选择是否进行付费购买github的仓库加密服务,如果你希望托管在github上面的项目不是开源的,那么选择付费很有必要。

这里默认选择了free免费,我们滑动到网页下面选择绿色按钮就可以注册成功了。注册完成后进行界面内,我们可以通过右下角的New按钮进行邮箱认证,认证完成后点击认证链接跳转到这个界面

到了这一步,我们博客的准备工作就完成了。

创建github博客

我们点击上图的New repository创建新项目,项目名称必须为github名字.github.io,比如本文中的github名称为SindriLinGithubTest,那么新仓库的名字必须为SindriLinGithubTest .github.io

按照图上的信息填写之后,我们完成了博客仓库的搭建,接着要进行下一步的配置

2、第一次配置博客

3、创建博客页面

4、选择博客主题(生成css、html等文件帮我们构建博客,可以对这些文件进行修改)

5、在浏览器上访问SindriLinGithubTest.github.io地址

6、在博客仓库下面的文件中修改博客布局,显示内容等。通过博客显示内容和这些文件内容对比进行修改

现在你的博客已经搭建完毕,可以给你的好朋友看看了

7、怎么删除我们存在的仓库呢?如果我们要使用别人已存在的主题进行博客搭建,那么我们上面创建的仓库就要删除,删除仓库要在Settings里面删除

快速定制主题

通过上面的方式我们创建了自己的博客,但是对于不懂html/css的人(比如我)来说,定制博客是一个苦恼的问题。然而,现在我们不用再担心这个问题了。jekyllthemes是一个简单的静态博客网站工具,我们可以在这个网站上面寻找我们喜欢的主题下载后直接使用。

博主我现在使用的模板是其中的Twenty主题,点击你想要的主题,然后进行下载

下载之后我们要做的步骤如下

1、修改主题文件名为github名字.github.io

2、通过 github工具 上传到你的 github仓库 (注意仓库里面同名的博客仓库文件要删除),如果你没有也不想下载github工具,那么可以参考 这篇文章 来使用命令行上传文件到服务器

3、登录github网站修改包括index.html,_config.yml等博客布局文件(这里上传成功后github博客页面已经发生改变,根据页面信息到下面相应的文件中进行修改)

4、修改完成博客效果

域名绑定

现在博客虽然已经搭建好了,但是访问地址看起来总是不舒服的,我们想要通过指定的地址访问怎么办呢?我们需要拥有一个自己的域名,登录 万网 可以进行域名购买

我们在购买域名前输入想要的域名进行检测是否存在,如果域名处于可购买状态,我们注册万网账号,然后把域名加入购买清单,进行付款购买。博主已经购买了sindrilin.com这个域名(com价格比net贵,各位酌情购买。博主的域名是三年$149)

完成域名购买之后,我们还需要对域名进行解析,使之有效并且和我们的博客关联在一起

1、我们要进入产品管理界面,选择域名,然后对我们已经购买的域名进行解析

2、进入github pages界面,选择右上角的Pages Help,然后选择绑定博客DNS和域名

3、进行域名解析,纪录类型为A,主机纪录包括@、www两种,记录值为上面两个DNS中其中一个(这里我添加了两次解析)

4、打开github仓库,在博客仓库目录下新增文件,命名为CNAME,并且写入购买的域名

5、更改博客仓库的_config.yml配置,设置url为购买域名地址

6、保存配置后,点击仓库的Settings,如果出现链接地址是蓝色的,那么说明博客跟域名已经关联好了,等待几分钟就可以通过自己购买的域名进行访问

更新博客

正常来说,在我们下载的主题里面有个_posts文件夹,这里面存放的是博客文章,正常而言是md(markdown)格式。我的建议是不要删除这些文件,我们的博客可以在这些文件的格式上进行修改书写。

这里我使用的markdown编辑器是typora,个人觉得这个markdown编辑器简洁好用。选择_posts目录下随便一个md文件右键使用typora打开,文件中红框勾选起来的部分千万不要随意删除,可以进行修改。如果不小心删除了可能会导致博客无法显示或者你的博客页面错乱等问题

完成博客后,直接保存在_posts文件下,然后使用 github for mac ,然后提交修改,点击右上角的sync进行文件同步,再过一会博客就更新了。另外博客图片可以放在仓库的images文件下使用html语句进行获取

在完成上面的操作之后,正常来说我们已经搭建好了我们的博客和主题,在确认之前应该让你的朋友访问一下仓库域名确认,如果出现了

这就说明你的博客主题搭建失败,这个主题是没用的。那么这时候我们需要删除github上面的仓库

成功删除github上面托管的博客仓库之后,我们还需要移除本地github工具上面的博客文件

右键项目 -> Remove

完成之后我们下载新的主题,然后按照上面的方式重新提交,直到我们选择的主题能够访问为止

更多

由于本文创建的博客服务器位于github,在进行访问的时候加载速度可能不够高。如果是追求完美主义者,可以在万网上购买阿里的云服务器,然后找个会后台开发的小伙伴们一起开发共用服务器。

其他资源:

markdown语法

阿里云服务器购买

po主博客

po主仓库

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Difficulty in updating caching of official account web pages: How to avoid the old cache affecting the user experience after version update? Difficulty in updating caching of official account web pages: How to avoid the old cache affecting the user experience after version update? Mar 04, 2025 pm 12:32 PM

The official account web page update cache, this thing is simple and simple, and it is complicated enough to drink a pot of it. You worked hard to update the official account article, but the user still opened the old version. Who can bear the taste? In this article, let’s take a look at the twists and turns behind this and how to solve this problem gracefully. After reading it, you can easily deal with various caching problems, allowing your users to always experience the freshest content. Let’s talk about the basics first. To put it bluntly, in order to improve access speed, the browser or server stores some static resources (such as pictures, CSS, JS) or page content. Next time you access it, you can directly retrieve it from the cache without having to download it again, and it is naturally fast. But this thing is also a double-edged sword. The new version is online,

How do I use HTML5 form validation attributes to validate user input? How do I use HTML5 form validation attributes to validate user input? Mar 17, 2025 pm 12:27 PM

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

How to efficiently add stroke effects to PNG images on web pages? How to efficiently add stroke effects to PNG images on web pages? Mar 04, 2025 pm 02:39 PM

This article demonstrates efficient PNG border addition to webpages using CSS. It argues that CSS offers superior performance compared to JavaScript or libraries, detailing how to adjust border width, style, and color for subtle or prominent effect

What are the best practices for cross-browser compatibility in HTML5? What are the best practices for cross-browser compatibility in HTML5? Mar 17, 2025 pm 12:20 PM

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

What is the purpose of the <datalist> element? What is the purpose of the <datalist> element? Mar 21, 2025 pm 12:33 PM

The article discusses the HTML &lt;datalist&gt; element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

What is the purpose of the <progress> element? What is the purpose of the <progress> element? Mar 21, 2025 pm 12:34 PM

The article discusses the HTML &lt;progress&gt; element, its purpose, styling, and differences from the &lt;meter&gt; element. The main focus is on using &lt;progress&gt; for task completion and &lt;meter&gt; for stati

How do I use the HTML5 <time> element to represent dates and times semantically? How do I use the HTML5 <time> element to represent dates and times semantically? Mar 12, 2025 pm 04:05 PM

This article explains the HTML5 &lt;time&gt; element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

What is the purpose of the <meter> element? What is the purpose of the <meter> element? Mar 21, 2025 pm 12:35 PM

The article discusses the HTML &lt;meter&gt; element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates &lt;meter&gt; from &lt;progress&gt; and ex

See all articles