huww98 / MyBlog

My personal blog. Based on ASP.NET Core, MySQL, Bootstrap

Home Page:https://www.huww98.cn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MyBlog

Developed for my personal blog (and as a practice). Deployed at https://www.huww98.cn

Based on ASP.NET Core, MySQL, Bootstrap

Features

  • Markdown based article editing and comments. Frontend render using remarkable at editing time, Backend render using markdig after published
  • Use HtmlSanitizer. Cleans HTML to avoid XSS attacks.
  • Role based authorization, based on ASP.NET Core Identity
  • Login using QQ and GitHub OAuth.
  • Tree based article category
  • Code highlight with highlight.js
  • Ability to find uploaded but unused image
  • Mobile frendly (responsive)

Currently, it is lack of paging. I may add this once I got more article.

Development

  • Install MySQL
  • Open solution with Visual Studio
  • Configure OAuth:
    • right click MyBlog project,click Manage User secrets,输入相关信息,如:
      {
        "Authentication": {
          "QQ": {
            "AppId": "101xxxx9",
            "AppKey": "xxxxxxxxxxxxx"
          },
          "GitHub": {
            "ClientID": "3b0xxxxxxx66",
            "ClientSecret": "xxxxxxxxxxxxxxxxxxx"
          }
        }
      }
    • Or,delete AddQQ/AddGitHub in Startup.cs file.
  • Config Database connection: edit appsettings.json,Update ConnectionStrings.DefaultConnection with your MySQL connection string.

Deployment

OAuth configure and database connection string should be write to appsettings.Production.json file on server.

Build process I'm using:

dotnet publish --configuration Release --output ...

Run with:

dotnet MyBlog.dll

For more information, refer to

About

My personal blog. Based on ASP.NET Core, MySQL, Bootstrap

https://www.huww98.cn

License:MIT License


Languages

Language:C# 69.8%Language:HTML 29.0%Language:CSS 0.4%Language:Batchfile 0.3%Language:Shell 0.2%Language:PowerShell 0.1%Language:JavaScript 0.0%