diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..1ead6d4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/data
+/install.php
\ No newline at end of file
diff --git a/.htaccess b/.htaccess
new file mode 100644
index 0000000..76849a4
--- /dev/null
+++ b/.htaccess
@@ -0,0 +1,8 @@
+
+RewriteEngine On
+RewriteBase /
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule ^(.*)$ /index.php/$1 [L]
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
index e65ef63..72b6d1b 100755
--- a/README.md
+++ b/README.md
@@ -1,56 +1,93 @@
-介绍
-====
+# MiniCMS
-MiniCMS是一个针对个人网站设计的微型内容管理系统。它的特点是:
+## 项目介绍
-1. 不需要数据库在支持,只需要一个可以运行PHP的Web环境
+MiniCMS是一个针对个人网站设计的微型内容管理系统。
+
+主要特点:
+
+1. 不需要数据库支持,只需要一个可以运行 PHP 的 Web 环境
2. 只针对个人网站设计,没有复杂的成员管理和权限设置
3. 没有分类只有标签,免除发布文章时到底该怎么分类的纠结
-4. 只有“文章”和“页面”两该个系统,没有“评论”、“插件”、“主题”,让你更专注于创造内容
+4. 只有“文章”和“页面”两个系统,没有“评论”、“插件”,让你更专注于创造内容
+5. 其他功能:网站基本信息、状态、主题、URL 类型、ICP 备案号、账号和密码等可在后台配置
-安装
-====
+## 安装
-1. 下载最新版的install.php,上传到网站根目录
-2. 浏览器访问根目录下instal.php,填入网站信息和初始账号密码
+1. 下载最新版的 install.php,上传到网站根目录
+2. 浏览器访问根目录下 instal.php,填入网站信息和初始账号密码
3. 开始安装
-结构
-====
+## 文件结构
```
-mc-admin 后台
-mc-files 内容
- |--theme 主题
+index.php 入口文件
+admin 后台管理
+core 核心
+theme 主题
+data 内容数据
+ |--config.php 配置文件
|--posts 文章
| |--data 数据
| |--index 索引
|--pages 页面
|--data 数据
|--index 索引
+.htaccess Apache rewrite 配置文件
+nginx.conf Nginx rewrite 配置
+```
+
+## URL 格式
+
+默认 query 模式
+
+文章: `http://example.com/?post/[a-z0-9]{6}`
+
+标签: `http://example.com/?tag/[^/]+`
+
+日期: `http://example.com/?date/([0-9]{4}-[0-9]{2}`
+
+页面: `http://example.com/?([-a-zA-Z0-9]+)+`
+
+可选 history 模式,需要服务器支持开启路径重写
+
+文章: `http://example.com/post/[a-z0-9]{6}`
+
+标签: `http://example.com/tag/[^/]+`
+
+日期: `http://example.com/date/([0-9]{4}-[0-9]{2}`
+
+页面: `http://example.com/([-a-zA-Z0-9]+)+`
+
+## 模板标签
+
```
-
-URL格式
-=======
+app_site_name() // 网站标题
+app_site_desc() // 网站描述
+app_nick_name() // 站长昵称
+
+app_theme_url() // 主题文件夹中文件的URL
-文章: http://1234n.com/?post/[a-z0-5]{6}
-标签: http://1234n.com/?tag/[^/]+/
-页面: http://1234n.com/?([-a-zA-Z0-5]+/)+
-
-模板标签
-=======
+app_next_post() // 循环获取文章
+app_post_title() // 文章标题
+app_post_link() // 文章标题A链接
+app_post_content() // 文章内容
+app_post_url() // 文章URL
+app_post_date() // 文章发布日期
+app_post_time() // 文章发布时间
+app_post_tags() // 文章标签
+app_comment_code()// 文章评论代码
+app_footer_code() // 网页底部代码
```
-mc_site_name() // 网站标题
-mc_site_desc() // 网站描述
-mc_user_nick() // 站长昵称
-
-mc_theme_url() // 主题文件夹中文件的URL
-
-mc_next_post() // 循环获取文章
-mc_the_name() // 文章标题
-mc_the_date() // 发布日期
-mc_the_time() // 发布时间
-mc_the_content() // 文章内容
-mc_the_tags() // 文章标签
+
+## 打包发布
+
+打包安装包文件 install.php 的构建命令
+
+```shell
+# 使用 php 命令执行
+php build.php [指定版本号]
+# 示例
+php build.php 1.2.5
```
diff --git a/admin/common.php b/admin/common.php
new file mode 100644
index 0000000..97ba008
--- /dev/null
+++ b/admin/common.php
@@ -0,0 +1,57 @@
+> 5;
+ }
+ $output[] = $out;
+ }
+ return $output;
+}
+
+function post_sort($a, $b)
+{
+ $a_date = $a['date'];
+ $b_date = $b['date'];
+
+ if ($a_date != $b_date)
+ return $a_date > $b_date ? -1 : 1;
+
+ return $a['time'] > $b['time'] ? -1 : 1;
+}
diff --git a/mc-admin/editor.php b/admin/editor.php
similarity index 100%
rename from mc-admin/editor.php
rename to admin/editor.php
diff --git a/admin/foot.php b/admin/foot.php
new file mode 100755
index 0000000..549358e
--- /dev/null
+++ b/admin/foot.php
@@ -0,0 +1,7 @@
+
+
+
+