Skip to content

Commit f3ce8cd

Browse files
authored
Add files via upload
1 parent c97e47e commit f3ce8cd

22 files changed

+2230
-1
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
# blog
1+
# Blog
2+
Github hosted blogging engine

images/Rabbit-RScarry.jpg

206 KB
Loading

index.html

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<html>
2+
<head>
3+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
5+
<link href="style/style.css" media="screen" rel="stylesheet" type="text/css">
6+
<title>Github Blog</title>
7+
<script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.6.4/showdown.min.js"></script>
8+
<script src="script.js"></script>
9+
</head>
10+
<body>
11+
<div class="wrapper">
12+
<div id="article"></div>
13+
<h2>Past Articles</h2>
14+
<ul id="articles"></ul>
15+
</div>
16+
<div class="alternate-bg">
17+
<footer class="footer wrapper">
18+
<ul class="footer-nav">
19+
<a href="https://github.com/trochr/blog/">Hosted on Github</a>
20+
</ul>
21+
<ul class="footer-copyright">© 2017 trochr</ul>
22+
</footer>
23+
</div>
24+
</body></html>

posts/00-Welcome.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Welcome
2+
====
3+
4+
This blog is dedicated to blogging engine
5+
6+
Status
7+
---
8+
9+
This is work in progress

posts/01-Blog post test.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Title
2+
=====
3+
4+
5+
Simple test

posts/02-Second Blog post for test.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
![Showdown][sd-logo]
2+
3+
Showdown is a Javascript Markdown to HTML converter, based on the original works by John Gruber. It can be used client side (in the browser) or server side (with Node or io).
4+
5+
6+
# Installation
7+
8+
## Download tarball
9+
10+
You can download the latest release tarball directly from [releases][releases]
11+
12+
## Bower
13+
14+
bower install showdown
15+
16+
## npm (server-side)
17+
18+
npm install showdown
19+
20+
## CDN
21+
22+
You can also use one of several CDNs available:
23+
24+
* rawgit CDN
25+
26+
https://cdn.rawgit.com/showdownjs/showdown/<version tag>/dist/showdown.min.js
27+
28+
* cdnjs
29+
30+
https://cdnjs.cloudflare.com/ajax/libs/showdown/<version tag>/showdown.min.js
31+
32+
33+
[sd-logo]: https://raw.githubusercontent.com/showdownjs/logo/master/dist/logo.readme.png
34+
[releases]: https://github.com/showdownjs/showdown/releases
35+
[atx]: http://www.aaronsw.com/2002/atx/intro
36+
[setext]: https://en.wikipedia.org/wiki/Setext

posts/03-Bear.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Welcome
2+
Simple test to see the edition workflow
3+
Go to the [Homepage of this blog](https://trochr.github.io/blog).
4+
5+
![Rabbit](images/Rabbit-RScarry.jpg)
6+
7+
8+
## Goal
9+
Write a very simple,yet beautiful blogging engine.
10+
We are sick of hosting, so we will put everything on GitHub, because it's:
11+
12+
* Secure
13+
* Fast
14+
* Free
15+
* Resilient (CDN backed)
16+
17+
The blogging engine will be:
18+
* Beautiful
19+
* Only CSS and Pure Javascript
20+
* Secure
21+
22+
23+
## Todo
24+
25+
Css
26+
27+
## Problems
28+
How to host images
29+
30+
## Thoughts
31+
32+
Hey, [bear](http://www.bear-writer.com) has a very nice style !! Let's get inspired
33+
34+
Bear's *tags* are not such a good idea in the end, it's interpreted as titles, of course

posts/list.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
03-Bear.md
2+
00-Welcome.md
3+
01-Blog post test.md
4+
02-Second Blog post for test.md

script.js

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
2+
// change if hosts md files someplace else :
3+
var blogRoot = "https://trochr.github.io/blog/posts/";
4+
5+
function mdToHtml(text) {
6+
var converter = new showdown.Converter();
7+
return converter.makeHtml(text);
8+
}
9+
10+
function loadDoc(myurl,cb) {
11+
var xmlhttp;
12+
if (window.XMLHttpRequest) {
13+
xmlhttp = new XMLHttpRequest();
14+
} else {
15+
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
16+
}
17+
18+
xmlhttp.onreadystatechange = function () {
19+
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
20+
cb(xmlhttp.responseText);
21+
}
22+
}
23+
24+
xmlhttp.open("GET", myurl, true);
25+
xmlhttp.send();
26+
return xmlhttp.onreadystatechange();
27+
}
28+
29+
30+
function renderPost(p) {
31+
document.getElementById("article").innerHTML = mdToHtml(p);
32+
}
33+
34+
function showLayout(raw){
35+
posts=raw.split('\n');
36+
// keep only uncommented Markdown files
37+
posts=posts.filter(function(a){return a.match(/^[^#].*\.md$/) != null;})
38+
showList(posts);
39+
showPost(getQueryVariable("a"));
40+
}
41+
42+
function getQueryVariable(variable) {
43+
var query = window.location.search.substring(1);
44+
var vars = query.split('&');
45+
for (var i = 0; i < vars.length; i++) {
46+
var pair = vars[i].split('=');
47+
if (decodeURIComponent(pair[0]) == variable) {
48+
return decodeURIComponent(pair[1]);
49+
}
50+
}
51+
console.log('Query variable %s not found', variable);
52+
}
53+
54+
function showList(posts){
55+
56+
posts.forEach(function(e,i,n){
57+
var li = document.createElement('li');
58+
li.setAttribute('class','none');
59+
document.getElementById("articles").appendChild(li);
60+
li.innerHTML=li.innerHTML + "<a href=?a="+i+">"+e+"</a>";
61+
});
62+
}
63+
64+
function showPost(post){
65+
loadDoc(blogRoot+posts[post], renderPost);
66+
}
67+
68+
function init() {
69+
// var posts=getPosts();
70+
loadDoc(blogRoot+"list.txt", showLayout);
71+
}
72+
73+
74+
window.onload = init;

style/303505_0_0.eot

20.8 KB
Binary file not shown.

style/303505_0_0.ttf

54.9 KB
Binary file not shown.

style/303505_0_0.woff2

18 KB
Binary file not shown.

style/303505_1_0.ttf

53.2 KB
Binary file not shown.

style/303505_1_0.woff

28.3 KB
Binary file not shown.

style/303505_1_0.woff2

21.9 KB
Binary file not shown.

style/303505_2_0.ttf

54.4 KB
Binary file not shown.

style/303505_2_0.woff

28.7 KB
Binary file not shown.

style/303505_2_0.woff2

22.2 KB
Binary file not shown.

style/303505_3_0.eot

23.1 KB
Binary file not shown.

style/303505_3_0.ttf

55.4 KB
Binary file not shown.

style/303505_3_0.woff2

21.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)