mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-18 18:04:17 +00:00
Hub index, built-in search, and draft candidates discovered only the source path, dropping the follow policy used by the inventory. Add optional walk options to the shared Hub functions and pass the operation policy from dashboard handlers and CLI indexing. Explicit CLI sources use the active config policy while retaining configuration-free indexing. Cover global/project modes, enabled/disabled following, all three handlers, and CLI source overrides; document the behavior in all website locales and built-in guidance.
23 lines
445 B
Go
23 lines
445 B
Go
package server
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"skillshare/internal/hub"
|
|
)
|
|
|
|
func (s *Server) handleHubIndex(w http.ResponseWriter, r *http.Request) {
|
|
// Snapshot config under RLock, then release before I/O.
|
|
s.mu.RLock()
|
|
sourcePath := s.skillsSource()
|
|
s.mu.RUnlock()
|
|
|
|
idx, err := hub.BuildIndex(sourcePath, false, false, s.skillsWalk())
|
|
if err != nil {
|
|
writeError(w, http.StatusInternalServerError, err.Error())
|
|
return
|
|
}
|
|
|
|
writeJSON(w, idx)
|
|
}
|