我正在一个网站上以不可预测的格式生成大量数据的报告。我的(当前)计划是这样组织内容:
/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 代码(我不确定这是一个好习惯)。想法?