You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

126 lines
3.5 KiB

11 years ago
  1. # The DocPad Configuration File
  2. # It is simply a CoffeeScript Object which is parsed by CSON
  3. docpadConfig = {
  4. outPath: '../docs',
  5. renderPasses: 1,
  6. enabledPlugins:
  7. handlebars: false
  8. html2coffee: false
  9. jade: false
  10. marked: false
  11. paged: false
  12. livereload: false
  13. # Check Version
  14. # Whether or not to check for newer versions of DocPad
  15. checkVersion: true # default
  16. documentsPaths: [ # default
  17. 'documents'
  18. ]
  19. # Files Paths
  20. # An array of paths which contents will be treated as files
  21. # If it is a relative path, it will have the resolved `srcPath` prepended to it
  22. filesPaths: [ # default
  23. 'files'
  24. 'public'
  25. ]
  26. # =================================
  27. # Template Data
  28. # These are variables that will be accessible via our templates
  29. # To access one of these within our templates, refer to the FAQ: https://github.com/bevry/docpad/wiki/FAQ
  30. templateData:
  31. # Specify some site properties
  32. site:
  33. # The production url of our website
  34. url: "http://www.semantic-ui.com"
  35. # Here are some old site urls that you would like to redirect from
  36. oldUrls: [
  37. 'learnsemantic.com'
  38. ]
  39. # The default title of our website
  40. title: "Semantic UI"
  41. # The website description (for SEO)
  42. description: """
  43. Semantic empowers designers and developers by creating a shared vocabulary for UI.
  44. """
  45. # The website keywords (for SEO) separated by commas
  46. keywords: """
  47. html5, ui, library, framework, javascript
  48. """
  49. # -----------------------------
  50. # Helper Functions
  51. # Get the prepared site/document title
  52. # Often we would like to specify particular formatting to our page's title
  53. # we can apply that formatting here
  54. getPreparedTitle: ->
  55. # if we have a document title, then we should use that and suffix the site's title onto it
  56. if @document.title
  57. "#{@document.title} | #{@site.title}"
  58. # if our document does not have it's own title, then we should just use the site's title
  59. else
  60. @site.title
  61. getPage: (collection, id) ->
  62. for item, index in collection
  63. selectedIndex = (index + 1) if item.id is id
  64. selectedIndex
  65. pageCount: (collection) ->
  66. for item, index in collection
  67. itemCount = index + 1
  68. itemCount
  69. getPageCollection: (collection, id, delta = 2) ->
  70. for item, index in collection
  71. selectedIndex = index if item.id is id
  72. lastIndex = index
  73. # determine page count before and after
  74. bottomCount = if (selectedIndex - delta >= 0) then delta else (selectedIndex)
  75. topCount = if (selectedIndex + delta <= lastIndex) then delta else (lastIndex - selectedIndex)
  76. bottomDelta = (delta * 2 - topCount)
  77. topDelta = (delta * 2 - bottomCount)
  78. bottomIndex = if (selectedIndex - bottomDelta >= 0) then (selectedIndex - bottomDelta) else 0
  79. topIndex = if (selectedIndex + topDelta <= lastIndex) then (selectedIndex + topDelta) else lastIndex
  80. result = collection[bottomIndex..topIndex]
  81. result
  82. # Get the prepared site/document description
  83. getPreparedDescription: ->
  84. # if we have a document description, then we should use that, otherwise use the site's description
  85. @document.description or @site.description
  86. # Get the prepared site/document keywords
  87. getPreparedKeywords: ->
  88. # Merge the document keywords with the site keywords
  89. @site.keywords.concat(@document.keywords or []).join(', ')
  90. # =================================
  91. # DocPad Events
  92. # Here we can define handlers for events that DocPad fires
  93. # You can find a full listing of events on the DocPad Wiki
  94. # events:
  95. }
  96. # Export our DocPad Configuration
  97. module.exports = docpadConfig