diff --git a/helios/2025-10-08 - Helios Help - Halcons - Camping.pdf b/helios/2025-10-08 - Helios Help - Halcons - Camping.pdf new file mode 100644 index 0000000..3614f24 Binary files /dev/null and b/helios/2025-10-08 - Helios Help - Halcons - Camping.pdf differ diff --git a/helios/2025-10-08 - Helios Help - Halcons - Homework.pdf b/helios/2025-10-08 - Helios Help - Halcons - Homework.pdf new file mode 100644 index 0000000..730efce Binary files /dev/null and b/helios/2025-10-08 - Helios Help - Halcons - Homework.pdf differ diff --git a/helios/2025-10-08 - Helios Help - Halcons - Library.pdf b/helios/2025-10-08 - Helios Help - Halcons - Library.pdf new file mode 100644 index 0000000..711f4d4 Binary files /dev/null and b/helios/2025-10-08 - Helios Help - Halcons - Library.pdf differ diff --git a/helios/2025-10-08 - Helios Help - Halcons - Literacy.pdf b/helios/2025-10-08 - Helios Help - Halcons - Literacy.pdf new file mode 100644 index 0000000..f63e1b1 Binary files /dev/null and b/helios/2025-10-08 - Helios Help - Halcons - Literacy.pdf differ diff --git a/helios/2025-10-08 - Helios Help - Halcons - MAP Assessment.pdf b/helios/2025-10-08 - Helios Help - Halcons - MAP Assessment.pdf new file mode 100644 index 0000000..8e9091e Binary files /dev/null and b/helios/2025-10-08 - Helios Help - Halcons - MAP Assessment.pdf differ diff --git a/helios/2025-10-08 - Helios Help - Halcons - Math & Literacy Placement.pdf b/helios/2025-10-08 - Helios Help - Halcons - Math & Literacy Placement.pdf new file mode 100644 index 0000000..205f446 Binary files /dev/null and b/helios/2025-10-08 - Helios Help - Halcons - Math & Literacy Placement.pdf differ diff --git a/helios/2025-10-08 - Helios Help - Halcons - Math Program.pdf b/helios/2025-10-08 - Helios Help - Halcons - Math Program.pdf new file mode 100644 index 0000000..69e6550 Binary files /dev/null and b/helios/2025-10-08 - Helios Help - Halcons - Math Program.pdf differ diff --git a/helios/2025-10-08 - Helios Help - Halcons - PE.pdf b/helios/2025-10-08 - Helios Help - Halcons - PE.pdf new file mode 100644 index 0000000..89bdd15 Binary files /dev/null and b/helios/2025-10-08 - Helios Help - Halcons - PE.pdf differ diff --git a/helios/2025-10-08 - Helios Help - Halcons - SEL.pdf b/helios/2025-10-08 - Helios Help - Halcons - SEL.pdf new file mode 100644 index 0000000..8e16f17 Binary files /dev/null and b/helios/2025-10-08 - Helios Help - Halcons - SEL.pdf differ diff --git a/helios/2025-10-08 - Helios Help - Halcons - Technology.pdf b/helios/2025-10-08 - Helios Help - Halcons - Technology.pdf new file mode 100644 index 0000000..eed8efc Binary files /dev/null and b/helios/2025-10-08 - Helios Help - Halcons - Technology.pdf differ diff --git a/helios/2025-10-08 - Helios Help - Halcons - Themes and Content.pdf b/helios/2025-10-08 - Helios Help - Halcons - Themes and Content.pdf new file mode 100644 index 0000000..be912c0 Binary files /dev/null and b/helios/2025-10-08 - Helios Help - Halcons - Themes and Content.pdf differ diff --git a/helios/2025-10-08 - Helios Help - Halcons - Transition.pdf b/helios/2025-10-08 - Helios Help - Halcons - Transition.pdf new file mode 100644 index 0000000..fb3643c Binary files /dev/null and b/helios/2025-10-08 - Helios Help - Halcons - Transition.pdf differ diff --git a/helios/2025-10-08 - Helios Annual Report.pdf b/helios/2025-10-08 - Misc - Helios Annual Report.pdf similarity index 100% rename from helios/2025-10-08 - Helios Annual Report.pdf rename to helios/2025-10-08 - Misc - Helios Annual Report.pdf diff --git a/helios/2025-10-08 - Meet Choice Lunch.pdf b/helios/2025-10-08 - Misc - Meet Choice Lunch.pdf similarity index 100% rename from helios/2025-10-08 - Meet Choice Lunch.pdf rename to helios/2025-10-08 - Misc - Meet Choice Lunch.pdf diff --git a/build/generate-index.go b/helios/generate-index.go similarity index 64% rename from build/generate-index.go rename to helios/generate-index.go index 57fabc5..3983563 100644 --- a/build/generate-index.go +++ b/helios/generate-index.go @@ -19,8 +19,46 @@ type IndexData struct { } type FileEntry struct { - Name string `json:"name"` - URL string `json:"url"` + Name string `json:"name"` + URL string `json:"url"` + Date string `json:"date,omitempty"` + Source string `json:"source,omitempty"` + Topic string `json:"topic,omitempty"` + Gradeband *string `json:"gradeband,omitempty"` +} + +func parseFilename(name string) (date, source, topic string, gradeband *string) { + // Remove extension + nameWithoutExt := strings.TrimSuffix(name, filepath.Ext(name)) + + // Split by " - " + parts := strings.Split(nameWithoutExt, " - ") + + if len(parts) < 2 { + // Can't parse, return empty + return + } + + date = parts[0] + source = parts[1] + + if len(parts) == 2 { + // No topic or gradeband + return + } + + if len(parts) == 3 { + // Just topic, no gradeband + topic = parts[2] + return + } + + // 4+ parts: third part is gradeband, remaining parts are topic + gb := parts[2] + gradeband = &gb + topic = strings.Join(parts[3:], " - ") + + return } func generateIndex(dir string, rootURL string) error { @@ -35,8 +73,11 @@ func generateIndex(dir string, rootURL string) error { var fileNames []string for _, entry := range entries { name := entry.Name() - // Skip the index files themselves and hidden files - if name != "index.html" && name != "index.json" && !filepath.HasPrefix(name, ".") { + ext := filepath.Ext(name) + // Skip the index files, build files, and hidden files + if name != "index.html" && name != "index.json" && + ext != ".go" && ext != ".tmpl" && + !filepath.HasPrefix(name, ".") { fileNames = append(fileNames, name) } } @@ -47,13 +88,18 @@ func generateIndex(dir string, rootURL string) error { dirName := filepath.Base(dir) for _, name := range fileNames { url := fmt.Sprintf("%s/%s/%s", rootURL, dirName, name) + date, source, topic, gradeband := parseFilename(name) files = append(files, FileEntry{ - Name: name, - URL: url, + Name: name, + URL: url, + Date: date, + Source: source, + Topic: topic, + Gradeband: gradeband, }) } - templatePath := "build/index.html.tmpl" + templatePath := "helios/index.html.tmpl" tmpl, err := template.ParseFiles(templatePath) if err != nil { return fmt.Errorf("failed to parse template: %w", err) diff --git a/helios/index.html b/helios/index.html index a706f17..bcc0f2d 100644 --- a/helios/index.html +++ b/helios/index.html @@ -20,8 +20,19 @@

Index of helios