diff --git a/Gemfile.lock b/Gemfile.lock index 75ddaf9..4b79af6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,7 +5,7 @@ GEM rexml (>= 3.3.9) phlex (1.11.0) phlexite (0.1.3) - rexml (3.4.0) + rexml (3.4.1) PLATFORMS x64-mingw-ucrt @@ -17,4 +17,4 @@ DEPENDENCIES phlexite (~> 0.1.3) BUNDLED WITH - 2.5.22 + 2.6.9 diff --git a/build.rb b/build.rb index d75f834..6a1f91a 100644 --- a/build.rb +++ b/build.rb @@ -4,6 +4,7 @@ require 'phlex' require 'phlexite' require 'kramdown' +require_relative 'lib/pages' require_relative 'views/base_layout' require_relative 'views/nav_links' require_relative 'views/section_link' @@ -11,14 +12,7 @@ require_relative 'views/page_layout' require_relative 'views/pages/index' require_relative 'views/pages/markdown_page' -def pages = [ - ['concepts', 'Concepts of Biocircuits'], - ['simplest-circuit', "The Simplest Circuit"], - ['repressors', 'Repressors & Leaks'], - ['activators', 'Activators'], - ['hill-functions', 'Ultrasensitivity & the Hill Function'], - ['activators-vs-repressors', 'Choosing Between Activators & Repressors'], -] +def pages = BC.pages Phlexite::Site.new do |s| s.mount 'assets', on: '/assets' diff --git a/lib/pages.rb b/lib/pages.rb new file mode 100644 index 0000000..4f255c7 --- /dev/null +++ b/lib/pages.rb @@ -0,0 +1,10 @@ +module BC + def self.pages = [ + ['concepts', 'Concepts of Biocircuits'], + ['simplest-circuit', "The Simplest Circuit"], + ['repressors', 'Repressors & Leaks'], + ['activators', 'Activators'], + ['hill-functions', 'Ultrasensitivity & the Hill Function'], + ['activators-vs-repressors', 'Choosing Between Activators & Repressors'], + ] +end \ No newline at end of file diff --git a/views/pages/index.rb b/views/pages/index.rb index ac9f30c..81917ed 100644 --- a/views/pages/index.rb +++ b/views/pages/index.rb @@ -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