Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0
Ce dépôt a été archivé le 2022-05-07. Vous pouvez voir ses fichiers ou le cloner, mais pas ouvrir de ticket ou de demandes d'ajout, ni soumettre de changements.
nyaa-pantsu/router/faqHandler.go

19 lignes
600 o
Go
Brut Vue normale Historique

package router
import(
"net/http"
"html/template"
"github.com/gorilla/mux"
)
func FaqHandler(w http.ResponseWriter, r *http.Request) {
var templates = template.Must(template.New("FAQ").Funcs(FuncMap).ParseFiles("templates/index.html", "templates/FAQ.html"))
templates.ParseGlob("templates/_*.html") // common
searchForm := NewSearchForm()
searchForm.HideAdvancedSearch = true
err := templates.ExecuteTemplate(w, "index.html", FaqTemplateVariables{Navigation{}, searchForm, r.URL, mux.CurrentRoute(r)})
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
}