build.ls 782 B

1234567891011121314151617181920212223
  1. {sort-by} = require 'prelude-ls'
  2. load-data = require './load-data.ls'
  3. {write-localized-site} = require './write.ls'
  4. {slugify-db} = require './sort.ls'
  5. export build-site = (iso) ->
  6. locale = require "../locales/#{iso}.json"
  7. projects = load-data "../db/#{iso}-projects.json", iso
  8. protocols = load-data "../db/protocols/#{iso}-protocols.json", iso
  9. {projects-rejected} = require '../db/en-projects-rejected.ls'
  10. {platform-types} = require '../db/en-platform-types.ls'
  11. db =
  12. dir: "public/#{iso}/"
  13. iso: iso
  14. locale: locale
  15. platform-types: platform-types
  16. projects: slugify-db projects
  17. projects-rejected: sort-by (.name.to-lower-case!), projects-rejected
  18. protocols: slugify-db protocols
  19. write-localized-site(db)