From aef1906dbceaffbcd90bb6c891d6c367fe39339c Mon Sep 17 00:00:00 2001
From: Shale XIONG <shalexiong@dyn1172-34.wlan.ic.ac.uk>
Date: Fri, 16 Dec 2016 10:00:29 +0000
Subject: [PATCH] Add a news page. Now only show 5 latest news in the home
 page, and put all the news in the new page. Change the css of news to the
 same as the publication.

---
 _config.yml                                  |  2 ++
 _includes/header.html                        |  4 ++--
 _includes/news-page.html                     | 13 ++++++++++++
 _layouts/home.html                           | 12 +++--------
 assets/blog.scss                             | 22 ++++++++++++++++----
 news.html                                    |  7 +++++++
 people.html                                  |  2 +-
 publications/index.html => publications.html |  1 +
 research/concurrency.md                      |  3 ++-
 research/javascript.md                       |  3 ++-
 teaching/InferLab.md                         |  3 ++-
 teaching/ModelsComputation.md                |  1 +
 teaching/separationlogic.md                  |  1 +
 13 files changed, 55 insertions(+), 19 deletions(-)
 create mode 100644 _includes/news-page.html
 create mode 100644 news.html
 rename publications/index.html => publications.html (84%)

diff --git a/_config.yml b/_config.yml
index afe95e6..5472562 100644
--- a/_config.yml
+++ b/_config.yml
@@ -20,6 +20,8 @@ collections:
     output: true
   research:
     output: true
+  teaching:
+    output: true
 
 defaults:
   -
diff --git a/_includes/header.html b/_includes/header.html
index 3034292..ece70f5 100644
--- a/_includes/header.html
+++ b/_includes/header.html
@@ -4,12 +4,12 @@
       <nav class="nav">
           
         {% for menu_index in (1..10) %}
-            {% assign menu_items = site.pages | where:"menu",true | where: "menu_order",menu_index %}
+            {% assign menu_items = site.pages | where:"menu",true | where: "menu_order",menu_index | sort:"sub_menu_order" %}
             {% if menu_items.size > 0 %}
                 {% if menu_items.first.parent_menu %}
                     {% assign check_url = menu_items.first.parent_menu | downcase | prepend: '/' | append: '/'  %}
                     <li class="dropdown">
-                        <a class="nav-link {% if page.url contains check_url %}active{% endif %} dropbtn" href="">{{ menu_items.first.parent_menu }}</a>
+                        <a class="nav-link {% if page.url contains check_url %}active{% endif %} ">{{ menu_items.first.parent_menu }}</a>
                         <div class="dropdown-content">
                         {% for item in menu_items %}
                         <a class="nav-link {% if item.url == page.url %}active{% endif %}" href="{{ item.url | prepend: site.baseurl }}">{{ item.title }}</a>
diff --git a/_includes/news-page.html b/_includes/news-page.html
new file mode 100644
index 0000000..af56ac0
--- /dev/null
+++ b/_includes/news-page.html
@@ -0,0 +1,13 @@
+{% unless include.max %}
+    {% assign include.max = site.posts | size %}
+{% endunless  %}
+<div class="posts">
+{% for post in site.posts limit:include.max %}
+<li class="post-preview">
+  <h4><a href="{{ post.url }}">{{ post.title }}</a></h4>
+  <p>{{ post.date | date: "%b %-d, %Y" }}</p>
+  {{ post.excerpt }}
+  <p><a href="{{ post.url }}">more...</a></p>
+</li>
+{% endfor %}
+</div>
diff --git a/_layouts/home.html b/_layouts/home.html
index 10a87ce..f6ce075 100644
--- a/_layouts/home.html
+++ b/_layouts/home.html
@@ -14,18 +14,12 @@ layout: default
 
 <div class="row">
   <div class="col-sm-6">
-    <h2>News</h2>
-      {% for post in site.posts %}
-      <div class="post-preview">
-        <h3 class="post-title"><a href="{{ post.url }}">{{ post.title }}</a></h3>
-        <p class="post-meta">{{ post.date | date: "%b %-d, %Y" }}</p>
-        {{ post.excerpt}}
-      </div>
-      {% endfor %}
+      <h2><a href="{{ site.url }}/news.html">Recent News</a></h2>
+      {% include news-page.html max=5 %}
     </div>
 
   <div class="col-sm-6">
-    <h2>Recent Publications</h2>
+      <h2><a href="{{ site.url }}/publications.html">Recent Publications</a></h2>
     {% bibliography --max 5 %}
   </div>
 </div>
diff --git a/assets/blog.scss b/assets/blog.scss
index c172be4..0395bd1 100644
--- a/assets/blog.scss
+++ b/assets/blog.scss
@@ -79,9 +79,9 @@ h6, .h6 {
   .dropdown-content {
     display: none;
     position: absolute;
+    //min-width: 160px;
     background-color: $primary_colour;
-    min-width: 160px;
-    background-color: $primary_colour;
+    z-index:10;
     -webkit-box-shadow: inset 0 -.1rem .25rem rgba(0,0,0,.2);
             box-shadow: inset 0 -.1rem .25rem rgba(0,0,0,.2);
   }
@@ -99,7 +99,7 @@ h6, .h6 {
   .nav-link {
     position: relative;
     padding: 1rem;
-    font-weight: 500;
+    //font-weight: 500;
     color: $highlight_colour;
   }
   .nav-link:hover,
@@ -163,6 +163,8 @@ h6, .h6 {
   }
 }
 
+
+
 .bibliography {
   padding: 0;
 
@@ -279,7 +281,6 @@ h6, .h6 {
   margin-bottom: 4rem;
   .post-title {
     margin-bottom: .75rem;
-    font-size: 2.5rem;
   }
   .post-meta {
     margin-bottom: 1.25rem;
@@ -293,6 +294,19 @@ h6, .h6 {
   }
 }
 
+.posts {
+  padding: 0;
+
+  > li {
+    list-style: none;
+    border-top: 1px solid #eee;
+    padding: 1em;
+  }
+
+  h4 a {
+    color: black;
+  }
+}
 
 .site-card-list {
   list-style-position: inside;
diff --git a/news.html b/news.html
new file mode 100644
index 0000000..0d91697
--- /dev/null
+++ b/news.html
@@ -0,0 +1,7 @@
+---
+title: News
+menu: true
+menu_order: 2
+layout: page
+---
+{% include news-page.html posts=site.posts %}
diff --git a/people.html b/people.html
index 1471dfb..f85c8eb 100644
--- a/people.html
+++ b/people.html
@@ -1,6 +1,6 @@
 ---
 title: People
 menu: true
-menu_order: 2
+menu_order: 3
 ---
 {% include person-cards.html people=site.people %}
diff --git a/publications/index.html b/publications.html
similarity index 84%
rename from publications/index.html
rename to publications.html
index 11718aa..76be1c0 100644
--- a/publications/index.html
+++ b/publications.html
@@ -2,5 +2,6 @@
 title: Publications
 menu: true
 layout: toc
+menu_order: 6
 ---
 {% bibliography -g year %}
diff --git a/research/concurrency.md b/research/concurrency.md
index 4919777..722c57c 100644
--- a/research/concurrency.md
+++ b/research/concurrency.md
@@ -3,7 +3,8 @@ title: Concurrency
 project_id: concurrency
 menu: true
 parent_menu: Research
-menu_order: 3
+menu_order: 4
+sub_menu_order: 1
 ---
 
 We develop formal reasoning techniques for concurrent programs, with a
diff --git a/research/javascript.md b/research/javascript.md
index dc0b2df..28b5005 100644
--- a/research/javascript.md
+++ b/research/javascript.md
@@ -3,7 +3,8 @@ title: JavaScript
 project_id: web
 menu: true
 parent_menu: Research
-menu_order: 3
+menu_order: 4
+sub_menu_order: 2
 ---
 
 We study the mechanised specification of the JavaScript language
diff --git a/teaching/InferLab.md b/teaching/InferLab.md
index b9dad55..92ef50f 100644
--- a/teaching/InferLab.md
+++ b/teaching/InferLab.md
@@ -4,6 +4,7 @@ project_id: infer
 menu: true
 parent_menu: Teaching
 menu_order: 5
+sub_menu_order: 2
 ---
 
 The [Separation Logic](https://psvg.doc.ic.ac.uk/teaching/separationlogic.html) course is a a 4th-year MEng and MSc course 
@@ -43,4 +44,4 @@ You can see Lorenzo’s [pull request here.](https://github.com/connectbot/conne
 ![Infer Lab](/images/images/Infer-lab-2-small.jpg)
 
 To follow the Infer team, check their [blog](http://fbinfer.com/blog/) or [Twitter](https://twitter.com/fbinfer). 
-For more details on the Infer lab or the Separation Logic course, contact the Imperial team below.
\ No newline at end of file
+For more details on the Infer lab or the Separation Logic course, contact the Imperial team below.
diff --git a/teaching/ModelsComputation.md b/teaching/ModelsComputation.md
index 8d4ad81..731e991 100644
--- a/teaching/ModelsComputation.md
+++ b/teaching/ModelsComputation.md
@@ -4,6 +4,7 @@ project_id: moc
 menu: true
 parent_menu: Teaching
 menu_order: 5
+sub_menu_order: 3
 ---
 
 This is a 2nd year MEng compulsory course at the [Department of Computing](http://www.imperial.ac.uk/computing), [Imperial College London](http://www.imperial.ac.uk). 
diff --git a/teaching/separationlogic.md b/teaching/separationlogic.md
index fff5bcc..475b997 100644
--- a/teaching/separationlogic.md
+++ b/teaching/separationlogic.md
@@ -4,6 +4,7 @@ project_id: sl
 menu: true
 parent_menu: Teaching
 menu_order: 5
+sub_menu_order: 1
 ---
 
 The Separation Logic course is a 4th year MEng and MSc course on local reasoning about programs that manipulate the heap at the [Department of Computing](http://www.imperial.ac.uk/computing), [Imperial College London](http://www.imperial.ac.uk).
-- 
GitLab