Centralize page definitions

This commit is contained in:
Aleks Rutins 2025-06-05 08:50:14 -04:00
parent f5285561bb
commit 9e3f80b549
No known key found for this signature in database
4 changed files with 15 additions and 18 deletions

View file

@ -4,14 +4,7 @@ module BC
module Views
module Pages
class Index < ::Phlex::HTML
def sections = {
"1. Concepts of Biocircuits" => "/concepts.html",
"2. The Simplest Circuit" => "/simplest-circuit.html",
"3. Repressors & Leaks" => "/repressors.html",
"4. Activators" => "/activators.html",
"5. Ultrasensitivity & the Hill Function" => "/hill-functions.html",
"6. Choosing Between Activators & Repressors" => "/activators-vs-repressors.html"
}
def sections = BC.pages.each_with_index.map { |page, idx| ["#{idx + 1}. #{page[1]}", "/#{page[0]}.html"] }
def view_template
render(::BC::Views::BaseLayout.new("Home")) do