当前位置:网站首页>Serverless + domain name can also build a personal blog? Really, and soon

Serverless + domain name can also build a personal blog? Really, and soon

2022-08-11 07:47:00 Time standing still is not a brief history

一. 背景

作为技术人, I believe most people have the habit of taking notes.

I won't say much about the benefits of taking notes, And if you think you remember your notes pretty well, Maybe choose to post your notes to a blogging platform.

We usually work for professional reasons, Will be exposed to a lot of platform blogs: 列如: CSDN, 博客园, 简书, 知乎, 掘金等等.

Their advantages are many, 比如说: 功能强大, Comes with image server, 社交属性强, potential fans/By many and so on.

But platform-based blogging will be somewhat less personal/The core competitiveness of the team. Therefore, many bigwigs choose to use personal blogs or public accounts to promote their personal brands

There are better blogs: 柒’s Blog, 好好学Java

There is also a cost to setting up a personal blog

We usually set up a blog, There are many steps to prepare. 大致流程为: 购买服务器->申请域名->Domain name audit and website audit->Choose a blog system->Manually modify and deploy the blog system.

Each of these steps will take a lot of time, energy and even money to do something. I believe that many people are reluctant to engage in these things.
And recently discovered a super convenient and simple personal blog system——— jekyll

关于 jekyll

jekyll 是一个简单的免费的Blog生成工具,类似 WordPress. 官方网站
但是和 WordPress 不同的是,jekyll Is a tool for generating static web pages,不需要数据库支持.
And can cooperate with third-party services, 例如 Disqus. 最关键的是 jekyll 可以免费部署在 Gitee/Github上,And supports one piece builds. And there is no need for us to manually apply for a domain name

Without further ado, let's start using it~~~

二. 部署

基于 jekyll The built personal blog can be deployed in Gitee/GitHub 上, We deploy here mainly to Gitee 为例

The reason I think everyone is very clear: Gitee(码云) 他快啊. 说到这里, Suddenly remembered a line: 天下武功, 唯快不破.

如果之前没有申请Gitee的童鞋, 可以点击 这里 进行注册. 注册成功后, You can start the road to build our personal blog

The construction steps can be divided into: 拉取代码->Modify and upload configuration->Build and access. Below I will follow the steps to introduce how to quickly build a base Gitee+ jekyll 的个人博客

拉取代码

  1. 仓库地址https://gitee.com/TimePause/blog

  2. Copy this repository to your own repository
    in the upper right corner of the warehouse, 点击fork You can copy the code to your own repository; Another idea is to download the code directly, After editing, upload it to your new repository, Here I take the first way as an example

    image-20220709123438070

  3. Download the code from your own repository
    This can be done directly on the command line, 利用 git clone 自己仓库地址进行下载, 也可以通过idea/pycharm/vscode 等IDE工具来下载.
    这里以IDEAway to download the repository code as an example: 鼠标点击 File->Close Project

    image-20220709124109381

    Select after exiting the current project Get from VCS
    在这里插入图片描述
    Copy your warehouse address to the above
    image-20220708183128744

Modify and upload configuration

_config.yml

通过 _config.yml to modify the basic configuration

  1. 进入根目录下的 _config.yml

    image-20220708182534247

  2. 这里主要The following information has been modified, 如下图所示:

    • url : Gitee主页地址
    • baseurl: The relative address of the repository where the blog is located
    • description: 博客简介
    • text_skin: 主题颜色
    • highlight_theme: Font highlighting theme
      在这里插入图片描述

ps:

  1. url 和 baseurl 这两个参数可以通过 gitee View the admin page
    image-20220709124927889

  2. 第一次修改后, Modify again later text_skin和 highlight_theme时, Web page needs to be closed, 然后清理缓存, Then refresh to access.
    image-20220708214716965

locale.yml

  1. Modify copyright time information (Here if the pull is my code, 就不用改了, Because I have changed it~~~)
    There are many languages ​​for the localization configuration here for us to choose from, But if we need to display Simplified Chinese, Then just pay attention to the following configuration
    在这里插入图片描述
    顺便说一句: The localization configuration modified here can be found here _config.yml 来指定
    image-20220709130111849

  2. Submit and push the code to the specified repository
    image-20220708185429998

Build and access(gitee部署项目)

  1. 点击Gitee Pages
    在这里插入图片描述

  2. 身份认证

    经过第1步操作之后, We will find out if there is no real-name authentication before, authentication is required(This is the most time-consuming part)
    image-20220708185926878

    填写后, You will also need to upload relevant information such as ID photos

    image-20220708190155215

  3. 构建和部署
    Usually during working days, The review time is about a day(Not sure about the weekend, Might be later)
    审核成功之后, 再次点击 Gitee Pages, 会出现下面窗口
    在这里插入图片描述
    部署成功后, Just click on the address
    image-20220708190616650
    Click the hyperlink above to access
    image-20220709131005102

三. 使用

上传博客

  1. 将 .md (markdown) Format files are uploaded to 项目根目录下 的 _post 目录下

    image-20220709134159346

上传图片

  1. We usually upload pictures on our blog, Therefore, we need to manually place the image resources, 根目录/asserts/imgs/ 下.
    The access path of the image is: Personal blog website address/Image relative directory. 例如: https://timepause.gitee.io/blog/assets/imgs/chy/20220709/image-20220709134159346.png
    image-20220709135122068

ps : There are two things to say about the storage of images

  1. We can take the date as a directory, Then store by date. And this method is because the directory hierarchy is small, 图片可以直接显示
    image-20220709135233237

  2. If it's a team blog, You can use your own name+Time to store pictures for the directory
    在这里插入图片描述

四. 总结

This article mainly introduces how to base Gitee+jekyll 来快速搭建个人博客. And briefly introduced its configuration, How to use and deploy.
You are welcome to introduce other functions through the official website, 自己尝试哦. 如果觉得不错, Please also support us !


原网站

版权声明
本文为[Time standing still is not a brief history]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/223/202208110649406836.html