Fixed base path
This commit is contained in:
@@ -38,9 +38,14 @@ func Article(w http.ResponseWriter, r *http.Request) {
|
||||
database.GetDB().Table("author").Select("id").Where("id IN (?)", database.GetDB().Table("article_author").Select("author_id").Where("article_id = ?", article.Id)).Find(&authors)
|
||||
database.GetDB().Table("article_tag").Where("article_id = ?", article.Id).Find(&tags)
|
||||
|
||||
basePath := r.URL.Scheme + "://" + config.BasePath
|
||||
if r.URL.Scheme == "" {
|
||||
basePath = "http" + basePath
|
||||
}
|
||||
|
||||
ta := tmplArticle{
|
||||
Title: article.Title,
|
||||
BasePath: config.PageBase.BasePath,
|
||||
BasePath: basePath,
|
||||
Summary: article.Summary,
|
||||
Image: article.Image,
|
||||
Authors: authors,
|
||||
|
||||
Reference in New Issue
Block a user