Author: sebb
Date: Sun Apr 22 14:27:05 2018
New Revision: 1829786

URL: http://svn.apache.org/viewvc?rev=1829786&view=rev
Log:
No longer need projects.json; use temporary hook to fix up the sort order

Added:
    attic/site-test/yaml/_plugins/
    attic/site-test/yaml/_plugins/changeSort.rb   (with props)
Removed:
    attic/site-test/yaml/_data/
Modified:
    attic/site-test/yaml/_includes/project.list

Modified: attic/site-test/yaml/_includes/project.list
URL: 
http://svn.apache.org/viewvc/attic/site-test/yaml/_includes/project.list?rev=1829786&r1=1829785&r2=1829786&view=diff
==============================================================================
--- attic/site-test/yaml/_includes/project.list (original)
+++ attic/site-test/yaml/_includes/project.list Sun Apr 22 14:27:05 2018
@@ -1,7 +1,6 @@
-{% comment %} TODO:
-Temporarily changed to use site.data rather than site.collections in order to 
retain the same ordering for the list
-This makes comparisons easier
+{% comment %}
+Now using temporary hook to sort the collection in the same order as previously
 {% endcomment %}     <h6>Projects in the Attic</h6>
-  <ul>{% for p in site.data.projects %}{% assign project = p %}
+  <ul>{% for p in site.projects %}{% assign project = p._data_ %}
           <li><a href="/projects/{{ project.id | default: project.name  | 
downcase | replace: " ","-" | replace: "/","-" }}.html">{{ project.name 
}}</a></li> {% endfor %}
       </ul>
\ No newline at end of file

Added: attic/site-test/yaml/_plugins/changeSort.rb
URL: 
http://svn.apache.org/viewvc/attic/site-test/yaml/_plugins/changeSort.rb?rev=1829786&view=auto
==============================================================================
--- attic/site-test/yaml/_plugins/changeSort.rb (added)
+++ attic/site-test/yaml/_plugins/changeSort.rb Sun Apr 22 14:27:05 2018
@@ -0,0 +1,17 @@
+# TEMP HACK to fix the sort order
+
+def changeSort(x)
+  x='/avz' if x=='/axkit'
+  x='/daa' if x=='/continuum'
+  x='/wsmuse' if x=='/muse'
+  x='/xmlx' if x=='/xml'
+  x
+end
+
+Jekyll::Hooks.register :site, :post_read do |data|
+  data.collections['projects'].docs.sort! {|a,b|
+    ac=changeSort(a.cleaned_relative_path)
+    bc=changeSort(b.cleaned_relative_path)
+    ac <=> bc
+  }
+end

Propchange: attic/site-test/yaml/_plugins/changeSort.rb
------------------------------------------------------------------------------
    svn:eol-style = native


Reply via email to