mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 05:55:51 +01:00
Add wiki pages.
This commit is contained in:
@@ -60,4 +60,12 @@ class WikiController extends ControllerBase {
|
||||
html.wikiedit("", None,
|
||||
JGitUtil.getRepositoryInfo(owner, repository, servletContext))
|
||||
}
|
||||
|
||||
get("/:owner/:repository/wiki/_pages"){
|
||||
val owner = params("owner")
|
||||
val repository = params("repository")
|
||||
|
||||
html.wikipages(WikiUtil.getPageList(owner, repository),
|
||||
JGitUtil.getRepositoryInfo(owner, repository, servletContext))
|
||||
}
|
||||
}
|
||||
@@ -68,8 +68,12 @@ object WikiUtil {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO
|
||||
// def getPageList(owner: String, repository: String): List[WikiPageHistoryInfo]
|
||||
def getPageList(owner: String, repository: String): List[String] = {
|
||||
JGitUtil.getFileList(Git.open(getWikiRepositoryDir(owner, repository)), "master", ".")
|
||||
.filter(_.name.endsWith(".md"))
|
||||
.map(_.name.replaceFirst("\\.md$", ""))
|
||||
.sortBy(x => x)
|
||||
}
|
||||
|
||||
// TODO
|
||||
//def getPageHistory(owner: String, repository: String, pageName: String): List[WikiPageHistoryInfo]
|
||||
|
||||
Reference in New Issue
Block a user