[English Readme] [中文文档]
Tiny Wiki is a tiny document center, it can ru with most of current web env, such as apache+php and nginx+php
Under the MIT License
Default config file locate in framework/config.default.json
, if you want to change it, just create a new file named config.custom.json
in the project root dir, any thing can be override
If it's a string, it's the path of book, for example /samples/sample1
. Also you can provide an array, like:
[
{
"path": "/samples/sample1",
"uri": "/"
},
{
"path": "/samples/sample2",
"uri": "/sample2"
}
]
If you provide a string /samples/sample1
, it's the same with:
[
{
"path": "/samples/sample1",
"uri": "/"
}
]
It's easy to add Multi-Language Support on TinyWiki, let's try. Generate a config.custom.json, and give the books an array like :
[
{
"path": "/books/xx_sdk_wiki_cn",
"uri": "/xx_sdk_wiki"
},
{
"path": "/books/xx_sdk_wiki_cn",
"uri": "/xx_sdk_wiki_cn"
},
{
"path": "/books/xx_sdk_wiki_en",
"uri": "/xx_sdk_wiki_en"
}
{
"path": "/books/xx_sdk_wiki_jp",
"uri": "/xx_sdk_wiki_jp"
},
{
"path": "/books/xx_sdk_wiki_kr",
"uri": "/xx_sdk_wiki_kr"
}
]
Yes, you can guess what I will do next ~~ I can visit an English version by xx_sdk_wiki_en,a Chinese version by xx_sdk_wiki_cn ... Even the default version set to Chinese, so you can visit xx_sdk_wiki for default Chinese version. All option is up to you. just config it like this:
{
"path": "/books/xx_sdk_wiki_cn",
"uri": "/xx_sdk_wiki"
}
Site root dir, it means if you put the project in /var/www/wiki
, you shoud give it /wiki
. If in /var/www
, it's /
by default
Theme dir, you can develop your themes, at least, it should contains view/layout.php
and view/login.php
model file
To override theme config in global config in default or custom config, you can set defferent themes for defferent books
Define the book title
Define the book password, can be empty
Define the duoshuo comment shortname, duoshuo is a social comment plugin, just leave it empty if you donnot want to enable this plugin
Define the book menu struct
Set a custom 404 page
for example /xxx, it will match these case until matched
xxx.md
xxx/index.md
404.md
default 404 content, the content is:
# 404
404 Not Found
The sample book is from leetcode-solution, author:
Thanks!
In this project, I put two books as I said
for sample1, go http://115.159.31.66/tiny_wiki/
for sample2, go http://115.159.31.66/tiny_wiki/sample2/
Redirect rules is necessary. An Apache .htaccess file like:
<IfModule mod_rewrite.c>
RewriteEngine On
#ignore if it's a file
RewriteCond %{REQUEST_FILENAME} !-f
#redirect all request to index.php
RewriteRule .* index.php
</IfModule>
You will simply find the rules on nginx, lighthttpd or others by just google :)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。