-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent.json
1 lines (1 loc) · 28.7 KB
/
content.json
1
[{"title":"Python3操作SQLite3","date":"2020-06-07T14:43:24.268Z","path":"2020/06/07/Python3操作SQLite3/","text":"Python3操作SQLite3 一、 连接/创建数据库1234567# connect_sqlite3.pyimport sqlite3DB_Name = 'test.db'# 连接数据库,如果不存在则会在当前目录创建test.db文件conn = sqlite3.connect(DB_Name)print(f'连接数据库{DB_Name}成功') 程序执行结果: 1连接数据库test.db成功 二、创建数据库表1234567891011121314151617181920212223242526272829303132# create_table_sqlite3.pyimport sqlite3 DB_Name = 'test.db'Table_Name = 'STUDENT'# 连接数据库,如果不存在则会在当前目录创建conn = sqlite3.connect(DB_Name)try: # 创建游标 cursor = conn.cursor() # 创建STUDENT表的SQL语句,默认编码为UTF-8 SQL = ''' CREATE TABLE %s ( SNO CHAR(10), SNAME VARCHAR(20) NOT NULL, PRIMARY KEY(SNO) ) ''' % (Table_Name) # 创建数据库表 cursor.execute(SQL) # 提交到数据库 conn.commit() print('创建数据库表%s成功' % (Table_Name))except Exception as e: print(e) # 回滚 conn.rollback() print('创建数据库表%s失败' % Table_Name)finally: # 关闭数据库 conn.close() 程序执行结果: 1创建数据库表STUDENT成功 三、增删改查操作1、插入数据123456789101112131415161718192021222324252627# insertData_sqlite3.pyimport sqlite3DB_Name = 'test.db'# 连接数据库,如果不存在则会在当前目录创建conn = sqlite3.connect(DB_Name)try: # 创建游标 cursor = conn.cursor() # 向STUDENT表插入数据的SQL语句 SQL = ''' INSERT INTO STUDENT VALUES('2016081111','张三'),('2016081112','李四'),('2016081113','王五'); ''' # 插入数据 cursor.execute(SQL) # 提交到数据库 conn.commit() print('插入数据到表STUDENT成功')except Exception as e: print(e) # 回滚 conn.rollback() print('插入数据到表STUDENT失败')finally: # 关闭数据库 conn.close() 程序执行结果为: 1插入数据到表STUDENT成功 2、查询数据123456789101112131415161718192021222324252627282930# selectData_sqlite3.pyimport sqlite3DB_Name = 'test.db'# 连接数据库,如果不存在则会在当前目录创建conn = sqlite3.connect(DB_Name)try: # 创建游标 cursor = conn.cursor() # 查询数据的SQL语句 SQL = ''' SELECT * FROM STUDENT; ''' # 查询数据 cursor.execute(SQL) # 获取一条数据 one = cursor.fetchone() print(one) # 获取所有数据 for row in cursor.fetchall(): print(row)except Exception as e: print(e) print('查询数据失败')finally: # 关闭数据库 conn.close() 程序执行结果为: 123('2016081111', '张三')('2016081112', '李四')('2016081113', '王五') 3、修改数据123456789101112131415161718192021222324252627282930313233343536373839# updateData_sqlite3.pyimport sqlite3DB_Name = 'test.db'# 连接数据库,如果不存在则会在当前目录创建conn = sqlite3.connect(DB_Name)try: # 创建游标 cursor = conn.cursor() # 查询数据的SQL语句 SELECT_SQL = ''' SELECT * FROM STUDENT; ''' # 修改数据的SQL语句 UPDATE_SQL = ''' UPDATE STUDENT SET SNAME='%s' WHERE SNO='%s' ''' % ('李华', '2016081111') # 修改前 print('修改前') cursor.execute(SELECT_SQL) for row in cursor.fetchall(): print(row) # 修改数据 cursor.execute(UPDATE_SQL) # 提交到数据库 conn.commit() # 修改后 print('修改后') cursor.execute(SELECT_SQL) for row in cursor.fetchall(): print(row)except Exception as e: print(e) print('修改数据失败')finally: # 关闭数据库 conn.close() 程序执行结果: 12345678修改前('2016081111', '张三')('2016081112', '李四')('2016081113', '王五')修改后('2016081111', '李华')('2016081112', '李四')('2016081113', '王五') 4、删除数据123456789101112131415161718192021222324252627282930313233343536373839# deleteData_sqlite3.pyimport sqlite3DB_Name = 'test.db'# 连接数据库,如果不存在则会在当前目录创建conn = sqlite3.connect(DB_Name)try: # 创建游标 cursor = conn.cursor() # 查询数据的SQL语句 SELECT_SQL = ''' SELECT * FROM STUDENT; ''' # 删除数据的SQL语句 DELETE_SQL = ''' DELETE FROM STUDENT WHERE SNO='%s' ''' % ('2016081111') # 删除前 print('删除前') cursor.execute(SELECT_SQL) for row in cursor.fetchall(): print(row) # 删除数据 cursor.execute(DELETE_SQL) # 提交到数据库 conn.commit() # 删除后 print('删除后') cursor.execute(SELECT_SQL) for row in cursor.fetchall(): print(row)except Exception as e: print(e) print('删除数据失败')finally: # 关闭数据库 conn.close() 程序执行结果: 1234567删除前('2016081111', '李华')('2016081112', '李四')('2016081113', '王五')删除后('2016081112', '李四')('2016081113', '王五')","tags":[{"name":"python3","slug":"python3","permalink":"https://blog.eaglelee.cn/tags/python3/"},{"name":"sqlite3","slug":"sqlite3","permalink":"https://blog.eaglelee.cn/tags/sqlite3/"}]},{"title":"Git Note","date":"2020-02-19T08:28:33.280Z","path":"2020/02/19/Git Notes/","text":"Git(Version Ccontrol System)Git 完整命令在线手册 Git 命令PDF离线手册 一、Git的安装及版本查看命令1、Git的安装(1)、从Git官网上下载自己系统对应的版本;(2)、安装好后在终端里输入 git --version来查看Git版本,若能正确显示版本号,则说明安装成功; 二、Git的配置命令1、设置/修改全局用户名和邮箱  用户名和邮箱地址是本地git客户端的一个变量,每次commit都会用用户名和邮箱纪录。github的contributions统计就是按邮箱来统计的。 12git config --global user.name \"name\" //\"name\"为自己的用户名git config --global user.email \"email\" //\"email\"为自己的邮箱 2、查看配置信息 config 配置有system级别,global(用户级别)和local(当前仓库)三个,设置先从system > global > local,底层配置会覆盖顶层配置,分别使用–system/global/local 可以定位到配置文件 123git config --system --list //查看系统配置信息git config --global --list //查看当前用户(global)配置信息git config --local --list //查看当前仓库的配置信息 3、查看自己的用户名和邮箱12git config user.name //查看自己已配置的用户名git config user.email //查看自己已配置的邮箱 三、Git的基本操作命令Git命令大全 1、Git初始化本地仓库1git init //创建一个空的Git仓库或重新初始化一个现有仓库 2、添加文件12345git add <file> //把当前文件放入暂存区,\"<file>\"为文件名或带路径的文件名git reset -- <file> //用来撤销最后一次放入暂存区的文件git reset //撤销所有暂存区文件。git checkout -- <file> //把文件从暂存区复制到工作目录,用来丢弃本地修改。git rm --cached //删除暂存区上的文件 3、查看状态1git status //查看本地仓库中文件的状态 4、提交12git commit //给暂存区域生成快照并提交git commit -m \"modified\" //\"modified\"处为此次修改提交的注释 5、推送到远程仓库1git push //推送本地仓库中的所有文件到远程仓库 6、从远程仓库拉取数据1git pull //从远程仓库拉取数据 7、从远程仓库拷贝数据1git clone https://github.com/***/xxx.git //从远程仓库xxx上拷贝整个项目到本地 8、分支的使用12git branch br1 //创建一个分支名为\"br1\"git checkout br2 //切换到分支\"br2\" 注:在分支中的所有改变不会使主线master跟着改变 9、合并分支1git merge br1 //将分支\"br1\"合并到主线master里去 10、忽略某些文件的status123①.在仓库里创建一个文件,命名为\".gitignore\";②.将需要忽略的文件或文件夹(忽略文件夹的格式为\"/***\")的名称名写入.gitignore文件里;git add .gitignore //③.将\".gitignore\"文件放入暂存区 四、Git连接远程仓库(以GitHub做为远程仓库,若无GitHub账号则须先注册,登录) 1、本地仓库与远程仓库的连接step1:在GitHub上创建一个仓库(假设仓库名为”Git-test”);step2: 1git remote add origin https://github.com/***/Git-test.git //\"***\"处为自己的GitHub用户名 2、提交到远程仓库12","tags":[{"name":"Git","slug":"Git","permalink":"https://blog.eaglelee.cn/tags/Git/"},{"name":"Note","slug":"Note","permalink":"https://blog.eaglelee.cn/tags/Note/"}]},{"title":"Sort Algorithm","date":"2019-12-14T04:24:56.150Z","path":"2019/12/14/Sort Algorithm/","text":"排序算法-考研数据结构   所谓排序,即将原本无序的序列重新排列成有序序列的过程。这个序列中的每一项可能是单独的数据元素,也可能是一条记录(记录是由多个数据元素组成的,如一个学生记录就是由学号、姓名、年龄、专业等数据元素组成的)。如果是记录,则既可以按照记录的主关键字排序(主关键字唯一标识一条记录,如学生记录中的学号就是主关键字,学号不能重复,用来唯一标识一个学生),也可以按照记录的次关键字排序(如学生记录中的姓名、专业等都是次关键字,次关键字是可以重复的)。  而稳定性是指当待排序序列中有两个或两个以上相同的关键字时,排序前和排序后这些关键字的相对位置,如果没有发生变化就是稳定的,否则就是不稳定的。例如,某序列有两个关键字都是50,以50(a)和50(b)来区分它们,用某种算法A对其排序,排序前50(a)在50(b)之前,如果排序后50(a)仍然在50(b)之前,则A是稳定的;如果能找出一种情况,使排序后50(a)在50(b)之后,则A是不稳定的。如果关键字不能重复,则排序结果是唯一的,那么选择的排序算法稳定与否就无关紧要;如果关键字可以重复,则在选择排序算法时,就要根据具体的需求采考虑选择稳定的还是不稳定的排序算法。 0、各排序算法的时间复杂度与空间复杂度及稳定性比较一、插入类排序1、直接插入 算法思想:每趟将一个待排序的关键字按照其值的大小插入到已经排好的部分有序序列的适当位置上,直到所有待排关键字都被插入到有序序列中为止。 12345678910111213141516void InsertSort(int R[], int n) { int i, j; int temp; for (i = 1; i < n; i++) { temp = R[i]; //将待插入关键字暂存在temp中 j = i - 1; /*下面这个循环完成了从待排关键字之前的关键字开始扫描,如果大于待排关键字,则后移一位*/ while (j >= 0 && temp < R[j]) { R[j + 1] = R[j]; j--; } R[j + 1] = temp; //找到插入位置,将temp中暂存的待排关键字插入 } //对排序了的数组输出 outPutArr(R, n);} 2、希尔排序 算法思想:希尔排序又称之为缩小增量排序,其本质还是插入排序,只不过是将待排序列按照某种规则分成几个子序列,分别对这几个子序列进行直接插入排序。这个规则的体现就是增量的选取,希尔排序的时间复杂度为:O(n*logn)。 1234567891011121314void shellSort(int R[], int n){ int temp; for(int gap = n/2; gap > 0; gap /= 2){ for(int i = gap; i < n; i++){ temp = R[i]; int j; for(j = i; j >= gap && R[j-gap] > temp; j -= gap){ R[j] = R[j-gap]; } R[j] = temp; } } outPutArr(R,n);} 二、交换类排序3、冒泡排序 算法思想:假设待排序表长为n,从后往前(或从前往后)两两比较相邻元素的值,若为逆序(即A[i-1]>A[i]),则交换它们,直到序列比较完。我们称它为一.趟冒泡,结果将最小的元素交换到待排序列的第一一个位置(关键字最小的元素如气泡一般逐渐往上“漂浮”直至“水面”,这就是冒泡排序名字的由来)。下一趟冒泡时,前一趟确定的最小元素不再参与比较,待排序列减少-一个元素,每趟冒泡的结果把序列中的最小元素放到了序列的最终位置,….. 这样最多做n-1趟冒泡就能把所有元素排好序。 1234567891011121314151617181920void bubbleSort(int R[], int n){ int i,j; bool flag; int temp; for(i = n-1; i > 0; i--){ flag = false; //flag用来标记此趟排序是否发生了交换 for(j = 1; j <= i; j++){ if(R[j-1] > R[j]){ temp = R[j]; R[j] = R[j-1]; R[j-1] = temp; flag = true; //如果没发生交换,则flag为0 } } if(!flag){ //一趟排序过程中没有发生排序,则证明剩余序列有序,不在冒泡 outPutArr(R,n); return; } }} 4、快速排序 算法思想:也是交换类的排序,它通过多次划分操作实现排序。以升序为例,其执行流程可以概括为:每一趟选择当前所有子序列中的一个关键字(通常是第一个)作为枢轴,将子序列中比枢轴小的移到枢轴的前边,比枢轴大的移动到枢轴的后边;当本趟所有的子序列都被枢轴以上述规则划分完毕后会的到新的一组更短的子序列,它们成为下一趟划分的初始序列集。快速排序的算法思想基于分治思想的,其平均时间复杂度为O(n*logn),最坏时间复杂度为O(n^2)。 1234567891011121314151617181920212223242526void quickSort(int R[], int low, int high){ int temp; int i = low, j = high; if(low < high){ temp = R[low]; while(i < j){ //将数组中小于temp的放在左边,大于temp的放在右边 while(j > i && R[j] >= temp){ //从右往左扫描,找到一个小于temp的关键字 j--; } if(i < j){ R[i] = R[j]; //放在temp左边 i++; //右移一位 } while(i < j && R[i] < temp){ //从左往右扫描,找到一个大于temp的关键字 i++; } if(i < j){ R[j] = R[i]; //放在temp右边 j--; //左移一位 } } R[i] = temp; //将temp放在最终位置 quickSort(R,low,i-1); //递归的对temp左边的关键字排序 quickSort(R,i+1,high); //递归的对temp右边的关键字排序 }} 三、选择类排序5、简单选择排序 算法思想:选择类排序的主要动作是“选择”。简单选择采用最简单的选择方式,从头至尾扫描序列,选出最小的一个关键字,和第一个关键字交换,接着从剩下的关键字中继续这种选择和交换,最终使序列有序。 123456789101112131415161718void selectSort(int R[], int n){ int i, j, k; int temp; for(i = 0; i < n; i++){ k = i; /*下面这个循环是算法的关键,它从无序序列中挑出一个最小的关键字*/ for(j = i + 1; j < n; j++){ if(R[k] > R[j]){ k = j; } } /*下面这三句完成最小关键字与无序序列第一个关键字的交换*/ temp = R[i]; R[i] = R[k]; R[k] = temp; } outPutArr(R,n);} 6、堆排序 算法思想:堆是一种完全二叉树,这颗二叉树满足:任何一个非叶结点的值都不大于(或小于)其左右孩子结点的值。若父亲大孩子小,这样的堆称之为大顶堆;若父亲小孩子大称为小根堆。根据堆的定义可以知道,代表堆的这颗完全二叉树的根结点是最大的(或者最小的),因此将一个无序的序列调整为一个堆,就可以找到这个序列的最大值(或者最小)的值,然后将找出的值交换到这个序列的最后(或最前),这样有序序列关键字增加1个,无序序列中的关键字减少1个,对新的无序序列重复这样的操作,就实现了排序。 123456789101112131415161718192021222324252627282930313233343536373839/**堆排序算法主方法*/void heapSort(int R[], int n){ int i; int temp; for(i = n/2 - 1; i >= 0; i--){ //建立初始堆 sift(R, i, n-1); } for(i = n-1; i > 0; i--){ //进行n-1次循环,完成堆排序 temp = R[0]; //一下3句换出根节点的关键字,将其放入最终位置 R[0] = R[i]; R[i] = temp; sift(R, 0, i-1); //在减少了一个关键字的无序序列中调整 } outPutArr(R, n);}/**堆的局部调整方法*/void sift(int R[] ,int low, int high){ //关键字设定下表从0开始 int i = low,j = 2*i + 1; //R[j]是R[i]的左孩子节点 int temp = R[i]; while(j <= high){ if(j < high && R[j] < R[j+1]){ //若右孩子较大,则j指向右孩子 j++; //j变为2*i+2 } if(temp < R[j]){ R[i] = R[j]; //将R[j]调整到双亲节点的位置 i = j; //修改i和j的值,继续向下调整 j = 2*i + 1; }else{ break; //调整结束 } } R[i] = temp; //被调整节点放入最终位置} 7、归并排序 算法思想:二路归并排序是采用的分而治之的思想。将一个待排序的序列分成两个序列,分别对这两个序列排序。而对于这两个序列排序的方式也是和之前一样,将这两个序列分别分成两个序列分别排序。一直这样分割下去,知道序列中没有元素或者只有一个元素为止。因为没有元素的序列和只有一个元素的序列定是一个有序的序列,所以相当于将这个序列排序完毕,向上返回。返回的过程中做的最重要的一件事就是将两个有序的序列合并成一个有序的序列。所以归并排序最重要的两步是分割和合并。 123456789101112131415161718192021222324252627282930313233343536373839/**归并排序主方法*/void mergeSort(int R[], int low, int high){ if(low < high){ int mid = (low + high) / 2; mergeSort(R, low, mid); //归并排序前半段 mergeSort(R, mid + 1, high); //归并排序后半段 merge(R, low, mid, high); //将R数组中low~mid,mid~high两段序列归并为一个序列 }}/**将两个序列归并为一个有序序列*/void merge(int R[], int low, int mid, int high){ int i, j, k; int n1 = mid - low + 1; int n2 = high - mid; int left[n1], right[n2]; //此处在C++和C里会有编译错误,解决办法是将测试用例的逻辑结构改为一般线性表或者用Java语言实现该算法 for(i = 0; i < n1; i++){ left[i] = R[low + i]; } for(j = 0; j < n2; j++){ right[j] = R[mid + 1 + j]; } i = 0; j = 0; k = low; while(i < n1 && j < n2){ if(left[i] <= right[j]){ R[k] = left[i++]; }else{ R[k] = right[j++]; } k++; } while(i<n1){ R[k++] = left[i++]; } while(j<n2){ R[k++] = right[j++]; }}","tags":[{"name":"Sort","slug":"Sort","permalink":"https://blog.eaglelee.cn/tags/Sort/"},{"name":"Algorithm","slug":"Algorithm","permalink":"https://blog.eaglelee.cn/tags/Algorithm/"}]},{"title":"The README of BlueLake","date":"2019-11-29T11:34:00.709Z","path":"2019/11/29/README-Hexo/","text":"BlueLakeEnglish | 简体中文 一个简洁轻量化的响应式Hexo博客主题。 点击预览【深色主题】、【浅色主题】 安装安装主题和渲染:123$ git clone https://github.com/chaooo/hexo-theme-BlueLake.git themes/BlueLake$ npm install [email protected] --save$ npm install hexo-renderer-stylus --save 启用在Hexo配置文件(hexo/_config.yml)中把主题设置修改为BlueLake。 1theme: BlueLake 如果你想生成压缩后的css,在(hexo/_config.yml)中添加: 12stylus: compress: true 更新12cd themes/BlueLakegit pull 配置打开themes/BlueLake/_config.yml进行配置。 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146############################ Site Config Settings ############################# Theme versionversion: 2.0.2# Theme tonedark: false #true/false #切换为true,即可体验深色主题# Headermenu: - page: home directory: . icon: fa-home - page: archive directory: archives/ icon: fa-archive - page: about directory: about/ icon: fa-user - page: rss directory: atom.xml icon: fa-rss# Sidebarwidgets: - recent_posts - category - tag - archive #- weibo - links# Toctoc: enable: true number: false# Static filesjs: jscss: cssshare_path: share# ExtensionsPlugins: hexo-generator-feed hexo-generator-sitemap hexo-generator-baidu-sitemap#Feed Atomfeed: type: atom path: atom.xml limit: 20#sitemapsitemap: path: sitemap.xmlbaidusitemap: path: baidusitemap.xml#Local searchlocal_search: true ## Use a javascript-based local search engine, true/false.#Copyrightcopyright: enable: true #display article copyright information, true/false. describe: #copyright description # MathJax Supportmathjax: enable: false #true/false. cdn: //cdn.bootcss.com/mathjax/2.7.1/latest.js?config=TeX-AMS-MML_HTMLorMML#Cmmentscomment: duoshuo: #chaooo ## duoshuo_shortname disqus: ## disqus_shortname livere: ## 来必力(data-uid) uyan: ## 友言(uid) cloudTie: ## 网易云跟帖(productKey) changyan: ## 畅言需在下方配置两个参数,此处不填。 appid: ## 畅言(appid) appkey: ##畅言(appkey) gitalk: enable: false ## If you want to use Gitment comment system please set the value to true. owner: ## Your GitHub ID, e.g. username repo: ## The repository to store your comments, make sure you're the repo's owner, e.g. gitalk.github.io client_id: ## GitHub client ID, e.g. 75752dafe7907a897619 client_secret: ## GitHub client secret, e.g. ec2fb9054972c891289640354993b662f4cccc50 admin: ## Github repo owner and collaborators, only these guys can initialize github issues. language: zh-CN ## Language pagerDirection: last # Comment sorting direction, available values are last and first.#Shareshare: local_share: true ##本地分享 baidu_share: #true ## 百度分享 JiaThis_share: ##true ##JiaThis分享 duoshuo_share: #true ##true 多说分享必须和多说评论一起使用。 addToAny_share: # AddToAny share. Empty list hides. List items are service name at url. For ex: email for '<a href=\"https://www.addtoany.com/add_to/email?linkurl=...' # - twitter # - baidu # - facebook # - google_plus # - linkedin # - email# Analyticsgoogle_analytics: ## Your Google Analytics tracking id, e.g. UA-42025684-2baidu_analytics: ## Your Baidu Analytics tracking id, e.g. 1006843030519956000# Miscellaneousshow_category_count: true ## If you want to show the count of categories in the sidebar widget please set the value to true.widgets_on_small_screens: true ## Set to true to enable widgets on small screens.busuanzi: true ## If you want to use Busuanzi page views please set the value to true.# About pageabout: photo_url: ## Your photo e.g. http://cdn.chaooo.top/hexo/Avatar.jpg items: - label: email url: ## Your email with mailto: e.g. mailto:[email protected] title: ## Your email e.g. [email protected] - label: github url: ## Your github'url e.g. https://github.com/chaooo title: ## Your github'name e.g. chaooo - label: weibo url: ## Your weibo's url e.g. http://weibo.com/zhengchaooo title: ## Your weibo's name e.g. 秋过冬漫长 - label: twitter url: title: - label: facebook url: title:# Friend linklinks: - title: site-name1 url: http://www.example1.com/ - title: site-name2 url: http://www.example2.com/ - title: site-name3 url: http://www.example3.com/ version - 用于自动刷新CDN上的静态文件。 menu - 导航菜单。 widgets - 侧边栏中的窗口小部件。 Toc - 文章目录 Static files - 静态文件目录,以方便CDN使用。 Local search self_search - 默认本地JS搜索. Cmments duoshuo - 若使用多说评论,注册多说后在这填写short_name(用于评论与分享)。 disqus - 若使用Disqus评论,注册Disqus后在这填写short_name。 livere- 若使用来必力评论,注册来必力,获得data-uid。 uyan - 若使用友言评论,注册友言,获得uid。 cloudTie - 若使用网易云跟帖评论,注册网易云跟帖,获得productKey。 changyan - 若使用畅言评论,注册畅言,获得appid,appkey。 About page - 关于我页面(hexo new page ‘about’)。 links - 友情链接。 Miscellaneous show_category_count - 是否在侧边栏分类中显示类别的数量(true/false). widgets_on_small_screens - 小屏幕下侧边栏在底部显示. busuanzi - 用Busuanzi来统计网站访问量. google_analytics - Google Analytics tracking ID。 baIDu_analytics - Baidu Analytics tracking ID。 特征站点图标您可以准备一张ico格式并命名为** favicon.ico **,请将其放入hexo目录的source文件夹,建议大小:32px * 32px。 您可以为苹果设备添加网站徽标,请将名为** apple-touch-icon.png **的图像放入hexo目录的“source”文件夹中,建议大小为:114px * 114px。 添加站点关键字请在hexo目录的“hexo/_config.yml”中添加keywords字段,如: 1234567# Sitetitle: Hexosubtitle: 副标题description: 网站简要描述,如:Charles·Zheng's blog.keywords: 网站关键字, key, key1, key2, key3author: Charleslanguage: zh-CN 设置阅读全文您可以在文章的 front-matter 中添加 description,并提供文章摘录,或在文章中使用‘‘<!--more-->’’手动进行截断(Hexo推荐的方式)。 自定义page页面在source文件夹中创建文件夹index.md来添加页面,并在index.md的front-matter'中添加layout:page。 Create folders inlcudingindex.mdinsourcefolder to add pages, and add alayout: pageinfront-matterofindex.md`. About页面此主题默认page页面是关于我页面的布局,生成一个关于我页面: 1$ hexo new page 'about' 配置照片地址、邮箱、微博链接、微博名、GitHub链接、Github名: 123456789101112131415161718192021222324# About pageabout: photo_url: ## Your photo e.g. http://cdn.chaooo.top/hexo/Avatar.jpg items: - label: email icon: fa-email url: ## Your email with mailto: e.g. mailto:[email protected] title: ## Your email e.g. [email protected] - label: github icon: fa-github url: ## Your github'url e.g. https://github.com/chaooo title: ## Your github'name e.g. chaooo - label: weibo icon: fa-weibo url: ## Your weibo's url e.g. http://weibo.com/zhengchaooo title: ## Your weibo's name e.g. 秋过冬漫长 - label: twitter icon: fa-twitter url: title: - label: facebook icon: fa-facebook url: title: 点击预览About页面 代码语法高亮请在hexo目录的“hexo/_config.yml”中设置“highlight”选项,如下所示: 12345highlight: enable: true auto_detect: true line_number: true tab_replace: 本地搜索如果要使用本地站点搜索,您必须安装插件hexo-generator-json-content来创建JSON搜索文件 ,然后将配置添加到hexo/_config.yml: 1$ npm install [email protected] --save 然后在hexo/_config.yml添加配置: 123456789101112131415161718jsonContent: meta: false pages: false posts: title: true date: true path: true text: true raw: false content: false slug: false updated: false comments: false link: false permalink: false excerpt: false categories: false tags: true 语言该主题目前有七种语言:简体中文(zh-CN),繁体中文(zh-TW),英语(en),法语(fr-FR),德语(de-DE),韩语 (ko),西班牙语(es-ES),欢迎修改主题并翻译成其他语言。 评论目前主题集成六种第三方评论,分别是多说评论、Disqus评论、来必力评论、友言评论、网易云跟帖评论、畅言评论、基于Github Issue的GITALK,推荐gitalk。 需要 GitHub Application,如果没有点击这里申请。 Application name: 应用名称,随意 Homepage URL: 网站URL,对应自己博客地址 Application description :描述,随意 Authorization callback URL:# 网站URL,博客地址就好 点击注册,页面会出现其中Client ID和Client Secret在后面的配置中需要用到 配置主题_config.yml: 主题_config.ymlthemes/BlueLake/_config.yml1234567891011#Cmmentscomment: gitalk: enable: true ## 开启gitalk owner: ## GitHub的用户名 repo: ## 此评论存放的GitHub仓库 client_id: ## 复制刚才生成的clientID,例如. 75752dafe7907a897619 client_secret: ## 复制刚才生成的clientSecret,例如. ec2fb9054972c891289640354993b662f4cccc50 admin: ## Github的用户名 language: zh-CN ## Language pagerDirection: last # Comment sorting direction, available values are last and first. Solutions 检查您当前的hexo的根目录,是否包含source /,themes /等。 如果你在使用这个主题有任何问题,请随时打开一个issue,或者给我发邮件[email protected]。 浏览器支持 LicenseMIT License 贡献欢迎各种形式的贡献(增强功能,添加新功能,撰写文档,改进代码,提交问题和检查BUG…)。 期待您的pull request。","tags":[{"name":"README","slug":"README","permalink":"https://blog.eaglelee.cn/tags/README/"}]},{"title":"Hello World","date":"2019-11-20T13:53:24.859Z","path":"2019/11/20/hello-world/","text":"Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick StartCreate a new post1$ hexo new \"My New Post\" More info: Writing Run server1$ hexo server More info: Server Generate static files1$ hexo generate More info: Generating Deploy to remote sites1$ hexo deploy More info: Deployment","tags":[{"name":"HelloWorld","slug":"HelloWorld","permalink":"https://blog.eaglelee.cn/tags/HelloWorld/"}]}]