huan11's Blog

website·Indexed 30 days ago

https://huan11.github.io

A personal blog featuring articles on AI tools, Test-Driven Development (TDD), and technical guides, including a tutorial on setting up a static blog using Git and Hugo.

Tokens
1.9K
Snippets
9
Records
15
Agent score
73%

What's inside huan11.github.io

  1. Set up a static blog using Hugo and GitHub Actions

    To set up a static blog using the Hugo framework and automate deployment via GitHub Actions, follow these steps: 1. Clone a base framework (e.g., sulv-hugo-papermod). 2. Initialize the theme via git submodules. 3. Run the Hugo server locally to preview. 4. Create a public GitHub repository and link it as the remote origin. 5. Push changes to trigger automatic deployment.
    # Step 1: Clone the framework
    git clone https://github.com/xyming108/sulv-hugo-papermod.git
    
    # Step 2: Download theme
    git submodule update --init
    
    # Step 3: Start Hugo server
    hugo server -D
    
    # Step 4: Set up GitHub upstream
    git remote add origin git@github.com:huan11/huan11.github.io.git
  2. Set up a static blog using the sulv-hugo-papermod framework

    You can quickly start a blog by reusing the sulv-hugo-papermod framework. The process involves cloning the repository, initializing the theme submodules, and running the local development server.
    # Step 1: Clone the framework repository
    git clone https://github.com/xyming108/sulv-hugo-papermod.git
    
    # Step 2: Download and initialize the theme submodules
    git submodule update --init
    
    # Step 3: Start the Hugo server to preview the site (including drafts)
    hugo server -D
  3. Set up a static blog using Hugo and GitHub Actions

    To set up a static blog using the Hugo framework and GitHub Actions for automatic deployment, ensure you have Git and Hugo installed. You can optionally use Typora as a markdown editor. The process involves cloning a framework, initializing themes, and configuring a public GitHub repository for deployment.
    # Step 1: Clone the framework repository
    git clone https://github.com/xyming108/sulv-hugo-papermod.git
    
    # Step 2: Download and initialize the theme
    git submodule update --init
    
    # Step 3: Start the Hugo server with drafts enabled
    hugo server -D
    
    # Step 4: Set up the GitHub upstream for automatic deployment
    git remote add origin git@github.com:huan11/huan11.github.io.git
  4. Install dependencies for a Hugo static blog

    To set up a static blog using Hugo, you need to install the following tools:

    • Git: Version control system for managing the blog source and deploying to GitHub.
    • Hugo: The static site generator used to build the blog.
    • Typora (Optional): A markdown editor for writing blog posts.
  5. Set up a static blog using Hugo and GitHub Actions

    To set up a static blog using the Hugo framework and automate deployment via GitHub Actions, follow these steps:

    1. Install Dependencies: Install Git and Hugo. An optional markdown editor like Typora is recommended.
    2. Initialize Project: Clone a starter framework (e.g., sulv-hugo-papermod), initialize git submodules to download the theme, and run the Hugo server with the -D flag to preview the site locally.
    3. Configure Deployment: Create a public GitHub repository and set it as the remote upstream. Push your content and configuration changes to trigger the GitHub Action for automatic deployment.
    # Step 1: Clone the framework
    git clone https://github.com/xyming108/sulv-hugo-papermod.git
    
    # Step 2: Download theme dependencies
    git submodule update --init
    
    # Step 3: Start Hugo server for local preview
    hugo server -D
    
    # Step 4: Set up GitHub remote and push
    git remote add origin git@github.com:huan11/huan11.github.io.git
    git push -u origin main
  6. Set up a static blog using Hugo and GitHub Actions

    To set up a static blog using the Hugo framework and automate deployment via GitHub Actions, ensure you have Git and Hugo installed. You can optionally use Typora as a markdown editor. The process involves cloning a starter framework, initializing themes, and configuring a public GitHub repository for automatic deployment.
    # Step 1: Clone the framework
    git clone https://github.com/xyming108/sulv-hugo-papermod.git
    
    # Step 2: Download the theme
    git submodule update --init
    
    # Step 3: Start the Hugo server
    hugo server -D
    
    # Step 4: Set up GitHub upstream for deployment
    git remote add origin git@github.com:huan11/huan11.github.io.git
  7. Deploy a Hugo blog to GitHub Pages

    To deploy your blog, create a public GitHub repository and link your local project to it as the remote origin. Once your content is pushed, you can configure GitHub Actions to automate the deployment process.
    # Set up the GitHub upstream remote
    git remote add origin git@github.com:huan11/huan11.github.io.git
    
    # Add content and push changes to GitHub
    git add .
    git commit -m "add my notes"
    git push
  8. Identify common code bad smells (Refactoring)

    Based on Uncle Bob's 'Refactoring: Improving the Design of Existing Code', common 'Bad Smells' in code that indicate a need for refactoring include: Mysterious Names, Duplicated Code, Long Functions, Long Parameter Lists, Global Data, Mutable Data, Divergent Change, Shotgun Surgery, Feature Envy, Data Clumps, Primitive Obsession, Repeated Switches, Loops, Lazy Elements, Speculative Generality, Temporary Fields, Message Chains, Middle Men, Insider Trading, Large Classes, Alternative Classes with Different Interfaces, Data Classes, Refused Bequests, and excessive Comments.
  9. Identify code bad smells (Zheng Ye list)

    The following list identifies common code bad smells for review and refactoring:

    1. Non-standard naming (命名不规范)
    2. Misuse of English (乱用英语)
    3. Duplicate code (重复代码)
    4. Long functions (长函数)
    5. Large classes (大类)
    6. Long parameter lists (长参数列表)
    7. Abuse of control statements (滥用控制语句)
    8. Lack of encapsulation (缺乏封装)
    9. Mutable data (可变的数据)
    10. Separation of variable declaration and assignment (变量声明与赋值分离)
    11. Chaotic dependencies (依赖混乱)
    12. Inconsistent code (不一致的代码)
    13. Outdated code style (落后的代码风格)
  10. Access Zhipu AI LLM platforms and documentation

    Zhipu AI provides several entry points for using their Large Language Models (LLM): the official experience platform for testing, comprehensive technical documentation for integration, and a collection of open-source models hosted on Hugging Face.