剛接觸 GitHub 的時候就開始在倉庫 bingoogolapple.github.io 裏建立 Issues 來記錄學習筆記,那時候我還不知道有 GitHub Pages,後來瞭解到了能夠經過 GitHub Pages 來搭建 我的博客站點,可是若是涉及到在文章裏嵌套圖片的話仍是比較麻煩的vue
經過 Issues 記錄學習筆記的優勢:git
Web - PC |
---|
![]() |
Web - Phone | Web - Phone | Web - Phone |
---|---|---|
![]() |
![]() |
![]() |
Phone | Phone | Phone |
---|---|---|
![]() |
![]() |
![]() |
1.安裝依賴github
flutter pub get
複製代碼
2.在瀏覽器中運行web
flutter run -d chrome
複製代碼
3.修改我的配置「bga_issue_blog/lib/utils/config.dart」chrome
class Config {
// 配置我的 GitHub 名稱
static final gitHubUsername = 'bingoogolapple';
// 根據 GitHub 名稱自動組裝存放 issues 的倉庫
static final repo = '$gitHubUsername/$gitHubUsername.github.io';
// 配置我的連接圖片映射
static final personalLinkMap = {
'images/github.png': 'https://github.com/bingoogolapple',
'images/git.png': 'https://bingoogolapple.gitbooks.io/bgalearningnotes-git',
};
// QQ 配置信息
static final qqTitle = 'BGA 系列\n';
static final qqDesc = '開源庫 QQ 羣';
static final qqQrImg = 'images/qq-group.png';
// 網站備案信息
static final webSiteInfo = '©2014 - ${DateTime.now().year} bingoogolapple\n蜀ICP備17023604號';
}
複製代碼
1.打包瀏覽器
dart build_web_preview.dart
複製代碼
2.發佈bash
拷貝「bga_issue_blog/docs」目錄裏的全部文件到「GitHub Pages」的根目錄下
並將「GitHub Pages」倉庫 PUSH 到 GitHub 上
複製代碼
1.在「GitHub Pages」根目錄下添加文件名爲「CNAME」的文件,文件內容就是你的二級域名,例如個人是app
www.bingoogolapple.cn
複製代碼
2.登陸你的域名控制檯添加域名解析學習
「記錄類型」選擇「CNAME」
「主機記錄」填「www」
「記錄值」填「GitHub用戶名.github.io」,例如個人是「bingoogolapple.github.io」
複製代碼