Update README

This commit is contained in:
Jinzhu 2016-02-21 22:40:01 +08:00
parent 2a9c03002c
commit 118c8b836f
3 changed files with 45 additions and 2 deletions

View File

@ -1,6 +1,14 @@
# Summary # Summary
* [GORM](README.md) * [GORM GITHUB](http://github.com/jinzhu/gorm)
* [Getting Start](README.md)
{% for path, chapter in book.chapters %}
* [{{ chapter.name }}]({{ path }})
{% for section in chapter.sections %}
* [{{ section.name }}]({{ section.path }})
{% endfor %}
{% endfor %}
* [Database](database/database.md) * [Database](database/database.md)
* [Connecting to a Database](database/connect-database.md) * [Connecting to a Database](database/connect-database.md)
* [Migration](database/migration.md) * [Migration](database/migration.md)

View File

@ -16,5 +16,22 @@
"base": "https://github.com/jinzhu/gorm/edit/gh-pages", "base": "https://github.com/jinzhu/gorm/edit/gh-pages",
"label": "Edit This Page" "label": "Edit This Page"
} }
},
"sections": [
{
"content": "<h1>Hello</h1>",
"type": "normal"
}
],
"variables": {
"chapters": {
"database/database.md": {
"name": "Databae",
"sections": [
{"name": "Connection to a Database", "path": "database/connect-database.md"},
{"name": "Migration", "path": "database/migration.md"}
]
}
}
} }
} }

View File

@ -1,4 +1,22 @@
## Database ## Database
<!-- toc --> {% for section in book.chapters["database/database.md"].sections %}
* [**{{section.name}}**](../{{section.path}})
{% endfor %}
{{book.chapters}}
<script>
window.chapters = {}
{% for path, chapter in book.chapters %}
chapters["{{path}}"] = {}
chapters["{{path}}"]["name"] = "{{chapter.name}}"
chapters["{{path}}"]["sections"] = [];
{% for section in chapter.sections %}
var section = {
"name": "{{section.name}}",
"path": "{{section.path}}",
}
chapters["{{path}}"]["sections"].push(section);
{% endfor %}
{% endfor %}
</script>