Java 8 + Nashorn Scripting + Mustache = 靜態頁面生成器

jopen 10年前發布 | 17K 次閱讀 靜態頁面生成器 建站系統CMS

SPG 是一個靜態頁面生成器,采用JavaScript開發,作為一個在Java8上可執行的腳本。SPG只有一個文件,帶一個JavaScript依賴 (mustache.js),并且只需要你的系統安裝有 Java 8 。

SPG is simple: input.json + input.htm (processed by https://github.com/janl/mustache.js template) => input.htm (result).

SPG relies on mustache.js for rendering and therefore comes with support for sections, functions, conditional rendering etc.

SPG was created to maintain the registration pages for http://workshops.adam-bien.com (externalize the dates, show badges like "registration closed"), so it is heavily used in production :-).

You will find sources at github. SPG is open source and Apache 2 licensed.

See you at Java EE Workshops at MUC Airport. SPG is going to be discussed during the Java EE 7 + HTML 5 workshop.

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!