需要一个类似于jekyll的客户端javascript静态网站生成器-没有服务器端的任何东西

need a client side javascript static website generator similar to jekyll - no server side anything

本文关键字:网站 任何东 服务器端 静态 javascript 一个 客户端 jekyll 类似于      更新时间:2023-09-26

我正在寻找Jekyll(静态网站生成器)和Pagfy.js或Deck.js之间的交叉。

我的网站很简单,我不关心SEO,也不担心对用户的系统征税。我喜欢pagify.js和deck.js的功能,但我也希望它们能够实时呈现模板并使用标记语言。胡子和降价更可取。

如果他们也能阅读YAML的标题,加载部分并实时渲染我的文本和图像,那就太好了。

它应该读取markdown并从布局中渲染它&模板。

把它想象成一个客户端,没有服务器的静态网站生成器。我能用什么?

我已经查看了hogan.js、splash.js和其他一些,但它们似乎不能像杰基尔那样做。

BTW:我并不关心"博客知名度"。

这可能是您想要的?

function Template ( temp ) {
    this.template = temp;
}
Template.prototype = {
    render : function  ( arr ) {
        return this.template.replace( /'{'$(['d'w]*)'}/g, function ( $, $1 ) {
            return arr[$1] || "";
        })
    }
}
var template = new Template ( '<div class="icon {$last}" id="{$id}"><img src="{$src}" alt="" /><div class="title">{$title}</div></div>' );
console.log( template.render( {src:"img.png",title:"123456",id:"a4546"} ) ); 
// <div class="icon " id="a4546"><img src="img.png" alt="" /><div class="title">123456</div></div>

所以我终于找到了一些:
https://github.com/evilstreak/markdown-js
https://github.com/OscarGodson/EpicEditor

相关文章: