博客搭建记录

博客搭建记录(EN)

Under the patient guidance of seniors and driven by course requirements, I successfully completed the journey of building my personal blog using GitHub and Hexo, publishing my first blog post. The entire process was filled with exploration and rewarding experiences:

During the preliminary preparation phase, I strictly followed the workflow: First, I downloaded and installed Node.js (verified by entering node -v and npm -v in the terminal), followed by installing Git (checked with git --version). These two tools formed the foundation for Hexo’s operation and code management. Next, I registered an account on GitHub’s official website with the username [your GitHub username], laying the groundwork for my blog’s online home.

In the local blog construction phase, I created a dedicated directory on my hard drive (e.g., D:\my-blog), globally installed Hexo via the command line (npm install -g hexo-cli), and confirmed the installation with hexo -v. After initializing the project with hexo init, seeing the default “Hello World” page at http://localhost:4000 sparked indescribable excitement! I then proceeded to personalize the configuration: opening the _config.yml file in a text editor, modifying title to my blog’s name, subtitle to a personalized tagline, and author to my pen name. After carefully comparing themes on Hexo’s official site, I finally cloned my preferred theme (e.g., git clone https://github.com/iissnan/hexo-theme-next themes/next) and updated the theme value in the configuration file.

During the content creation phase, I used hexo new "My First Blog" to generate a Markdown file in source/_posts, edited the content with Typora, and previewed the layout in real-time using hexo clean && hexo g && hexo s. Markdown’s simple syntax allowed me to focus purely on writing without formatting distractions.

The deployment phase was critical: I created a public repository named [username].github.io on GitHub, then configured SSH keys in Git Bash—generating a key pair with ssh-keygen and adding the full content of id_rsa.pub to my GitHub account’s SSH settings. Next, I modified the deploy section in Hexo’s configuration file, setting the repository URL to SSH format (git@github.com:[username]/[username].github.io.git) and the branch to main. When I ran hexo clean && hexo g && hexo d to complete deployment and saw my live blog at https://[username].github.io, the fatigue from debugging melted into pure accomplishment!

This practice not only equipped me with static blog-building skills but also deepened my appreciation for continuous output—just as seniors emphasized: “A blog’s vitality comes from its relentless flow of content.” Moving forward, I will persist in documenting technical insights and growth milestones, nurturing this self-built knowledge corner to thrive.