diff --git a/node/api.go b/node/api.go index e6eae20..1bb4f48 100644 --- a/node/api.go +++ b/node/api.go @@ -235,11 +235,19 @@ func Serve(opts *ServeOpts) { // Simple and clean SSR UI ssr := newSSR(opts.TemplatesDir, opts.ES) r.HandleFunc("/", ssr.ssrRootHandler) + // Forum r.HandleFunc("/forum/page/{page:[0-9]+}", ssr.ssrForumHandler) + // Echo r.HandleFunc("/echo/{echo:[a-z0-9-_.]+}/page/{page:[0-9]+}", ssr.echoViewHandler) + // Thread r.HandleFunc("/thread/{topicid:[a-z0-9-]+}", ssr.threadViewHandler) + // Single message r.HandleFunc("/msg/{msgid:[a-zA-Z0-9]{20}}", ssr.singleMessageHandler) + // Search r.HandleFunc("/find", ssr.searchHandler).Methods(http.MethodGet) + // Docs + // formatting + r.HandleFunc("/docs/formatting", ssr.docsFormattingHandler) if opts.ServeStatic { r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir(opts.StaticDir)))) diff --git a/node/ssr.go b/node/ssr.go index 9c9a896..3836521 100644 --- a/node/ssr.go +++ b/node/ssr.go @@ -173,6 +173,18 @@ func (s *ssr) echoViewHandler(w http.ResponseWriter, r *http.Request) { } } +func (s *ssr) docsFormattingHandler(w http.ResponseWriter, r *http.Request) { + tpl, err := s.getTemplate("docs_formatting") + if err != nil { + log.Error(err) + return + } + + if err := tpl.Execute(w, s.newPageData("docs: formatting", nil, 1, false)); err != nil { + log.Error(err) + } +} + func (s *ssr) singleMessageHandler(w http.ResponseWriter, r *http.Request) { tpl, err := s.getTemplate("message") if err != nil { diff --git a/templates/common/header.html b/templates/common/header.html index 26b83b6..190aa4a 100644 --- a/templates/common/header.html +++ b/templates/common/header.html @@ -36,6 +36,13 @@ new +