Skip to content

Commit 4a476b8

Browse files
committed
init
0 parents  commit 4a476b8

File tree

427 files changed

+87038
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

427 files changed

+87038
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.gitattributes export-ignore
2+
/.github export-ignore

.github/workflows/phpunit.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: PHPUnit
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
main:
10+
name: Build and test
11+
12+
strategy:
13+
matrix:
14+
php-versions: ['7.4', '8.0']
15+
16+
runs-on: ubuntu-latest
17+
18+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v2
23+
24+
- name: Setup PHP, with composer and extensions
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php-versions }}
28+
tools: composer, pecl, phpunit
29+
extensions: intl, json, mbstring, mysqlnd, xdebug, xml, sqlite3
30+
coverage: xdebug
31+
32+
- name: Get composer cache directory
33+
id: composer-cache
34+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
35+
36+
- name: Cache composer dependencies
37+
uses: actions/cache@v2
38+
with:
39+
path: ${{ steps.composer-cache.outputs.dir }}
40+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
41+
restore-keys: ${{ runner.os }}-composer-
42+
43+
- name: Install dependencies
44+
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
45+
# To prevent rate limiting you may need to supply an OAuth token in Settings > Secrets
46+
# env:
47+
# https://getcomposer.org/doc/articles/troubleshooting.md#api-rate-limit-and-oauth-tokens
48+
# COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
49+
50+
- name: Test with phpunit
51+
run: vendor/bin/phpunit --coverage-text

.gitignore

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
#-------------------------
2+
# Operating Specific Junk Files
3+
#-------------------------
4+
5+
# OS X
6+
.DS_Store
7+
.AppleDouble
8+
.LSOverride
9+
10+
# OS X Thumbnails
11+
._*
12+
13+
# Windows image file caches
14+
Thumbs.db
15+
ehthumbs.db
16+
Desktop.ini
17+
18+
# Recycle Bin used on file shares
19+
$RECYCLE.BIN/
20+
21+
# Windows Installer files
22+
*.cab
23+
*.msi
24+
*.msm
25+
*.msp
26+
27+
# Windows shortcuts
28+
*.lnk
29+
30+
# Linux
31+
*~
32+
33+
# KDE directory preferences
34+
.directory
35+
36+
# Linux trash folder which might appear on any partition or disk
37+
.Trash-*
38+
39+
#-------------------------
40+
# Environment Files
41+
#-------------------------
42+
# These should never be under version control,
43+
# as it poses a security risk.
44+
.env
45+
.vagrant
46+
Vagrantfile
47+
48+
#-------------------------
49+
# Temporary Files
50+
#-------------------------
51+
writable/cache/*
52+
!writable/cache/index.html
53+
54+
writable/logs/*
55+
!writable/logs/index.html
56+
57+
writable/session/*
58+
!writable/session/index.html
59+
60+
writable/uploads/*
61+
!writable/uploads/index.html
62+
63+
writable/debugbar/*
64+
65+
php_errors.log
66+
67+
#-------------------------
68+
# User Guide Temp Files
69+
#-------------------------
70+
user_guide_src/build/*
71+
user_guide_src/cilexer/build/*
72+
user_guide_src/cilexer/dist/*
73+
user_guide_src/cilexer/pycilexer.egg-info/*
74+
75+
#-------------------------
76+
# Test Files
77+
#-------------------------
78+
tests/coverage*
79+
80+
# Don't save phpunit under version control.
81+
phpunit
82+
83+
#-------------------------
84+
# Composer
85+
#-------------------------
86+
vendor/
87+
88+
#-------------------------
89+
# IDE / Development Files
90+
#-------------------------
91+
92+
# Modules Testing
93+
_modules/*
94+
95+
# phpenv local config
96+
.php-version
97+
98+
# Jetbrains editors (PHPStorm, etc)
99+
.idea/
100+
*.iml
101+
102+
# Netbeans
103+
nbproject/
104+
build/
105+
nbbuild/
106+
dist/
107+
nbdist/
108+
nbactions.xml
109+
nb-configuration.xml
110+
.nb-gradle/
111+
112+
# Sublime Text
113+
*.tmlanguage.cache
114+
*.tmPreferences.cache
115+
*.stTheme.cache
116+
*.sublime-workspace
117+
*.sublime-project
118+
.phpintel
119+
/api/
120+
121+
# Visual Studio Code
122+
.vscode/
123+
124+
/results/
125+
/phpunit*.xml
126+
/.phpunit.*.cache
127+

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014-2019 British Columbia Institute of Technology
4+
Copyright (c) 2019-2022 CodeIgniter Foundation
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.

README.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
## 一. 简介 ##
2+
GitBlog是一个简单易用的Markdown博客系统,它不需要数据库,没有管理后台功能,更新博客只需要添加你写好的Markdown文件即可。它摆脱了在线编辑器排版困难,无法实时预览的缺点,一切都交给Markdown来完成,一篇博客就是一个Markdown文件。同时也支持评论,代码高亮,数学公式,页面PV统计等常用功能。GitBlog提供了不同的主题样式,你可以根据自己的喜好配置,如果你想自己制作博客主题,也是非常容易的。GitBlog还支持整站静态导出,你完全可以导出整站静态网页部署到Github Pages。
3+
4+
5+
此项目衍生自[GitBlog](https://github.com/jockchou/gitblog),此项目已经不维护了,停留在2018年,一些问题没有解决
6+
- web框架使用的是ci 3.x版本,这个已经进入维护阶段,此项目使用4.2.1版本,有些全新的好处
7+
- 使用composer管理框架和其他一些依赖,方便更新框架和组件以及安全更新
8+
- 增加单元测试
9+
- 增加预加载功能,在preload.php中,详情看官方文档,增强性能
10+
- 4.2.1版本运行在php7.4以上,增加了强类型,性能表现
11+
- 全部使用namespace语法引入其他类
12+
- 解决了中文tag,中文markdown标题不能打开的问题
13+
- 去掉了已经关闭的多说评论,有言评论,使用disqus评论系统
14+
- 更新使用文档
15+
- 重新整理了组件,整体更加工程化
16+
- 主题文件修改为twig后缀,方便IDE识别语法
17+
- 本地开发,直接php spark serve 即可启动本地服务器,非常方便
18+
19+
预览
20+
21+
![screenshot](./screenshot.png)
22+
23+
## 二. 功能特点 ##
24+
25+
1. 使用Markdown
26+
2. 评论框,支持disqus
27+
3. 代码高亮
28+
4. PV统计
29+
5. Latex数学公式
30+
6. 自制主题
31+
7. 响应式
32+
8. 全站静态导出
33+
9. 良好的SEO
34+
10. 使用现代的composer管理包
35+
11. 使用最新的CI框架
36+
37+
## 三. GitBlog优势 ##
38+
39+
1. 无需数据库,系统更轻量,移植更方便
40+
2. 使用Markdown编写,摆脱后台编辑排版困难,无法实时预览的缺点
41+
3. 可全站静态导出
42+
4. 配置灵活,可自由开关某些功能
43+
5. 多主题支持,可自制主题
44+
6. 博客,分类,标签,归档
45+
46+
## 四. 环境要求 ##
47+
48+
- PHP 7.4+ 建议php8.0以上,我目前使用的8.1.8的开发环境
49+
- 安装composer包管理
50+
- 需要扩展
51+
- ext-mbstring
52+
- ext-dom
53+
- ext-json
54+
- ext-intl
55+
- php.ini开启short_open_tag = On,这个是默认开启的
56+
57+
## 五. 安装步骤 ##
58+
59+
1. 下载GitBlog源代码
60+
2. 解压上传到你的PHP网站根目录
61+
3. 配置nginx或者apache
62+
4. 打开浏览器,访问网站首页
63+
5. 上传Markdown文件到`blog`文件夹
64+
65+
## 六. 详细说明 ##
66+
67+
- [1. 安装](blog/install.md)
68+
- [2. 目录结构](blog/struct.md)
69+
- [3. 配置说明](blog/config.md)
70+
- [4. 编写博客](blog/edit.md)
71+
- [5. 评论,订阅,统计等](blog/other-func.md)
72+
- [6. 缓存机制](blog/cache.md)
73+
- [7. 全站静态导出](blog/export.md)
74+
- [8. 主题制作](blog/theme.md)
75+
- [9. 在Nginx上运行GitBlog](blog/nginx.md)
76+
- [10. 在Apache上运行GitBlog](blog/apache.md)
77+
- [11. 在SAE上运行GitBlog](blog/sae.md)
78+
- [12. 使用GitBlog和Github Pages搭建博客](blog/github-pages.md)
79+
- [13. Gitblog升级](blog/update.md)
80+
- [14. 从wordpress导入](blog/wordpress.md)
81+
82+
## 七. 问题及bug反馈 ##
83+
84+
issue提出
85+
86+
## 八. 使用者列表 ##
87+
88+
89+
## 九. 感谢 ##
90+
91+
GitBlog的成长需要喜欢Markdown,喜欢写博客的各位亲们支持!感谢你们使用GitBlog,感激你们对Gitblog的良好建议和Bug反馈。
92+
93+
- [jockchou](https://github.com/jockchou)
94+
- [Jetbrains PhpStorm](https://www.jetbrains.com/phpstorm/)
95+
96+
97+
## 十. 快速开始 ##
98+
99+
```shell
100+
git clone https://github.com/screw-coding/codeigniter4-git-blog
101+
composer install
102+
php spark serve
103+
```
104+
105+
106+
## 十一.版权 ##
107+
108+
本项目使用[MIT](LICENSE)

app/.htaccess

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<IfModule authz_core_module>
2+
Require all denied
3+
</IfModule>
4+
<IfModule !authz_core_module>
5+
Deny from all
6+
</IfModule>

app/Common.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
/**
4+
* The goal of this file is to allow developers a location
5+
* where they can overwrite core procedural functions and
6+
* replace them with their own. This file is loaded during
7+
* the bootstrap process and is called during the frameworks
8+
* execution.
9+
*
10+
* This can be looked at as a `master helper` file that is
11+
* loaded early on, and may also contain additional functions
12+
* that you'd like to use throughout your entire application
13+
*
14+
* @see: https://codeigniter4.github.io/CodeIgniter4/
15+
*/

0 commit comments

Comments
 (0)