我正在建立一个网站,以不可预测的格式生成大量数据的报告。我(当前)的计划是如此组织内容:
/content/raw/ # holds raw .csv, .json, .etc, isn't routed
/content/data/ # holds ruby scripts to generate nice formatted
# JSON from the appropriate raw data files,
# routed to /data/*.json
/content/listings/ # holds ruby scripts to generate JSON which represents
# an HTML table or HighChart object and based upon the
# formatted data items above, routed to /listings/*.json
# (and imported via AJAX to display on appropriate pages)
/content/assets/ # mostly passed through, filtering SASS to CSS, routed to
# /assets/*.ext
/content/pages/ # holds Markdown pages filtered to HTML and included in a
# layout, with a special helper to inject graphs/tables
# by identifying a listing item, routed to /*index.html
我不确定这是解决问题的最好方法。特别是,我不知道如何使用nanoc,因此它知道,例如,重新生成一个依赖于已被新版本替换的原始数据文件的列表。我还需要知道如何编写规则,以便它在项目本身内使用Ruby代码(我不确定这是一个好习惯)。想法?