Commits

shl...@cec68495-dca5-4e2b-845c-11fdaaa4f967  committed 4a43c7e

Added the puzzles' nav menu.

  • Participants
  • Parent commits eeda158

Comments (0)

Files changed (3)

 LECTURES_DEPS = $(SECTION_MENU_DEPS) lib/Shlomif/Homepage/SectionMenu/Sects/Lectures.pm
 SOFTWARE_DEPS = $(SECTION_MENU_DEPS) lib/Shlomif/Homepage/SectionMenu/Sects/Software.pm
 HUMOUR_DEPS = $(SECTION_MENU_DEPS) lib/Shlomif/Homepage/SectionMenu/Sects/Humour.pm
+PUZZLES_DEPS = $(SECTION_MENU_DEPS) lib/Shlomif/Homepage/SectionMenu/Sects/Puzzles.pm
 
 t2/philosophy/Index/index.html.wml : lib/article-index/article-index.dtd lib/article-index/article-index.xml lib/article-index/article-index.xsl $(PHILOSOPHY_DEPS)
 	touch $@
 $(VIPE_HUMOUR_DOCS_SRC):: $(VIPE_SRC_DIR)/%.html.wml: $(HUMOUR_DEPS)
 	touch $@
 
+
+T2_PUZZLES_DOCS_SRC = $(filter $(T2_SRC_DIR)/puzzles/%,$(T2_DOCS_SRC)) $(filter $(T2_SRC_DIR)/MathVentures/%,$(T2_DOCS_SRC))
+
+$(T2_PUZZLES_DOCS_SRC):: $(T2_SRC_DIR)/%.html.wml: $(PUZZLES_DEPS)
+	touch $@
+
 rss:
 	./bin/fetch-shlomif_hsite-feed.pl
 	touch t2/index.html.wml

File lib/MySectNavData.pm

         'title' => "Essays Section Menu",
     },
     {
+        'id' => "puzzles",
+        'regex' => "^/(?:puzzles|MathVentures)/",
+        'class' => "Puzzles",
+        'title' => "Puzzles Section Menu",
+    },
+    {
         'id' => "lectures",
         'regex' => "^/lecture/",
         'class' => "Lectures",

File lib/Shlomif/Homepage/SectionMenu/Sects/Puzzles.pm

+package Shlomif::Homepage::SectionMenu::Sects::Puzzles;
+
+use strict;
+use warnings;
+
+use MyNavData;
+
+my $puzzles_tree_contents =
+{
+    'host' => "t2",
+    'text' => "Shlomi Fish' Essays",
+    'title' => "Shlomi Fish' Essays",
+    'show_always' => 1,
+    'subs' =>
+    [
+        {
+            'text' => "Puzzles",
+            'url' => "puzzles/",
+            'title' => "Puzzles and Riddles",
+        },
+        {
+            'text' => "Math-Ventures",
+            'url' => "MathVentures/",
+            'title' => "Adventures in Mathematics, usually with some real-life application",
+            'subs' =>
+            [
+                {
+                    'text' => "Combinatorics and the Art of D&D",
+                    'url' => "MathVentures/3d_outof_4d.html",
+                    'title' => "The 3 Maximal Dice out of 4 Dice",
+                },
+                {
+                    'text' => "On and on it Seems to go",
+                    'url' => "MathVentures/repeating_code.html",
+                    'title' => "How many Combinations are for a Repeating Code",
+                },
+                {
+                    'text' => "Dodecahedron Volume",
+                    'url' => "MathVentures/dodeca.html",
+                },
+                {
+                    'text' => "A Solidarian Disco Circle",
+                    'url' => "MathVentures/disco_circle.html",
+                },
+                {
+                    'text' => "Toggling Squares is not that Trivial",
+                    'url' => "MathVentures/toggle_squares.html",
+                },
+                {
+                    'text' => "Bugs in a Square",
+                    'url' => "MathVentures/bug_square.html",
+                },
+            ],
+        },
+        {
+            'text' => "Logic Puzzles",
+            'url' => "puzzles/logic/",
+            'title' => "Various Logic Puzzles I came up with.",
+            'subs' =>
+            [
+                {
+                    'text' => "Between the Screws",
+                    'url' => "puzzles/logic/between-the-screws/",
+                    'title' => "Which are the 4 different Screws Used to build an Airplane?",
+                },
+                {
+                    'text' => "Ravensborg's Guild",
+                    'url' => "puzzles/logic/ravensborgs-guild/",
+                    'title' => "5 members of a guild with different profession, one of them is the leader.",
+                },
+                {
+                    'text' => "On the Tip of the Sword",
+                    'url' => "puzzles/logic/tip-of-the-sword/",
+                    'title' => "5 swords of different types. Which is which?",
+                },
+            ],
+        },
+    ],
+};
+
+sub get_params
+{
+    return 
+        (
+            'hosts' => MyNavData::get_hosts(),
+            'tree_contents' => $puzzles_tree_contents,
+        );
+}
+
+1;
+