isnowfy / simple Goto Github PK
View Code? Open in Web Editor NEWA static blog generator with a single static page
Home Page: http://isnowfy.github.io/simple/
License: MIT License
A static blog generator with a single static page
Home Page: http://isnowfy.github.io/simple/
License: MIT License
print "Hello"
print "World"
这种会连成一个。目测是正则抓的有点问题。
修改方法:
function mdupdate() {
var converter = new Showdown.converter();
var tmp = $("#editmd").val();
// 非贪婪全局替换
tmp = tmp.replace(/~~~~\{(.*)\}\n([\s\S]*?)~~~~\n/gm, "<pre><code class=\"language-$1\">$2</code></pre>");
tmp = tmp.replace(/~~~~\n([\s\S]*?)~~~~\n/gm, "<pre><code>$1</code></pre>");
tmp = converter.makeHtml(tmp);
$("#edithtml").html(tmp);
Prism.highlightAll();
MathJax.Hub.Queue(["Typeset", MathJax.Hub, "edithtml"]);
}
Hello,
Saw that you wanted to add searching function to your project and decided to contribute a code that I use in my blog.
Test page (index.html), online demo here or just type something in my blog search form.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Zearch</title>
<!-- Bootstrap -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div id="content">
<div class="row">
<div class="page-content col-md-6 col-sm-8">
<h1>Type L</h1>
<form>
<div class="input-group custom-search-form">
<input type="text" id="uzer-infut" class="form-control" placeholder="Ask me anything">
</div>
</form>
<div id="queryMe"></div>
</div><!--/.page-content-->
</div><!--/.row-->
</div><!--/.content-->
</div><!--/.container-->
<script defer src="search.js"></script>
<script defer src="tmpl.min.js"></script>
</body>
</html>
You must have https://github.com/blueimp/JavaScript-Templates installed (npm install; npm run build)
search.js
(function() {
'use strict';
var nothingFoundTemplate = [
"<hr>",
"<div class='alert alert-info'>Nothing found.</div>",
"<hr>"
].join(''),
searchTemplate = [
"{% for (var x=0; x < o.length; x++) { %}",
"<div class='page-header'>",
"<h4>",
"<a href='{%=o[x][1]%}' class='text-muted'>",
"{%=o[x][0]%}",
"</a>",
"</h4>",
"</div>",
"{% } %}"
].join(''),
entries = [
// title url
['Lorem', 'http://ex0.com'],
['Little Joe', 'http://ex1.com'],
['ipsum', 'http://ex2.com'],
['next', 'http://ex3.com'],
['generation', 'http://ex4.com'],
['old', 'http://ex5.com'],
['school', 'http://ex6.com']
];
var innerData = function(partialTemplate, data, id) {
var template = document.createElement('div'),
container = document.querySelector('#' + id);
while (container.firstChild) {
container.removeChild(container.firstChild);
}
template.innerHTML = tmpl(partialTemplate, data);
container.appendChild(template);
};
var invokeSearch = function() {
var x,
arr = [],
foundPosts = false,
uzerQuery = document.getElementById('uzer-infut').value.toLowerCase();
if (uzerQuery === '') {
innerData(nothingFoundTemplate, arr, 'queryMe');
return false;
}
entries.forEach(function(entry) {
if (entry[0].toLowerCase().match(uzerQuery)) {
arr.push(entry);
foundPosts = true;
}
});
innerData(foundPosts ? searchTemplate :
nothingFoundTemplate, arr, 'queryMe');
};
document.getElementById('uzer-infut').addEventListener('input', invokeSearch, false);
}());
Every key stroke will trigger the search function, thus making it interactive without the need from the user to click any submit buttons (especially useful on mobile devices).
3 days later: replaced the entries objects with arrays instead.
Hi,
Do you know why the title for new post is "独立世界"? Can it be defined by user?
Thanks for your help
:-)
之前用这个工具写过几篇文章的,今天发现文章都不见了,而且,现在登录后post文章都不行了,登录也是有问题的,密码错了也可以过
...
请问有方法能直接在本地编辑好了push上去吗
登陆时提示Something error!
现在这个博客是不是没法用了?
使用的是git的用户名和密码还是显示 Something error!
我在使用 isnowfy 创建博客的时候出错了
Github最后一个请求 422
不知道是什么原因造成的。
或者 isnowfy 是否还有其他部署方法?
请求链接:
https://api.github.com/repos/kxxoling/kxxoling.github.io/git/commits?1413631940027
请求头:
{"message":"simple","author":{},"parents":["b661d0c2a39063fba4150b31b3474f04cef9d39c"],"tree":"926ffe86dd9d26162fef8b100c7ced2db76744e7"}
错误信息:
{
"message": "Invalid request.\n\nMissing required keys "email, name" in object; keys are "".",
"documentation_url": "https://developer.github.com/v3/git/commits/#create-a-commit"
}
the default page name is currently "Url ike intro.html".
Since we are doing login, it should be secured.
Please use https in your website https://help.github.com/articles/securing-your-github-pages-site-with-https/
Initializing Simple requires the root's HTML file /index.html
file to be overwritten. Is there a way to set Simple up in a custom subdirectory, such as /blog/
, so that the blog is hosted at http://[username].github.io/blog
?
Instead of just simple
Hello,
great job !
as said in title, italic markdown words or sentences (like Hello Wolrd!) appears underlined in simple.
After investigation, it comes from your file entry.css :
em{padding-bottom:.05em;font-style:inherit;font-weight:inherit;border-bottom:2px dotted #8b98a0}
should be replaced by :
em{padding-bottom:.05em;font-style:italic;font-weight:inherit;/*border-bottom:2px dotted #8b98a0*/}
This is just my humble opinion. Feel free to use it and test it more deeply.
Have a nice day.
Bruno.
好像苹果没有这个问题。
中文标签,如:#博客系统
会直接转换成
#%E5%8D%9A%E5%AE%A2%E7%B3%BB%E7%BB%9F
从而使得标签不可用,无法正常输出标签下的文章。
I'm hosting my own page through kyleking.github.io that simple is overwriting. Is it possible to delete my account?
我这边的ISP可能把github封了,基本上就只有我自己能看到自己的博客,于是就搜到了这篇文章(http://www.wtoutiao.com/a/842872.html ),感觉挺有意思
I have created a post, with url as posts/hello.html
. After saving, I found that Blog title, post title, pages are not shown in the generated page.
Please do make it work. I feel this is worthy application, very easy to use but needs some updates. Please also include Error displays (you can use alerts rather than not showing any error).
最近我把我的博客程序的验证方式也改成了personal token.
从github API文档可以看到,github要取消对basic验证的支持了...
github可以登录,确定密码没有问题。
但是登录时提示something error。
确定不是广告插件问题,换了多个浏览器尝试。
PS: I think it should be some user validation issue on this. Maybe github account issue or simple project issue.
好像是CSS的关系吧,右边预览区域显示正常,左边似乎被右边影响了。
是不是把src目录放到自己github page仓库下面,就可以在自己的page下面登录呢?还是一定要在你这边登录才可以发布呢?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.