added short summaries to blog posts

This commit is contained in:
Ellpeck 2019-10-03 13:29:55 +02:00
parent e15fb955ed
commit 846ba6aa58
3 changed files with 14 additions and 0 deletions

View file

@ -1,35 +1,41 @@
[{ [{
"name": "Blogs are Cool, I Think", "name": "Blogs are Cool, I Think",
"summary": "The first post and how I created it",
"id": "blogs_are_cool", "id": "blogs_are_cool",
"date": "2/17/2019", "date": "2/17/2019",
"discuss": "https://twitter.com/Ellpeck/status/1096937184601538566" "discuss": "https://twitter.com/Ellpeck/status/1096937184601538566"
}, },
{ {
"name": "Why You Should Mod Minecraft", "name": "Why You Should Mod Minecraft",
"summary": "About what makes Minecraft modding great and why you should probably try it if you enjoy programming",
"id": "why_you_should_mod_minecraft", "id": "why_you_should_mod_minecraft",
"date": "2/17/2019", "date": "2/17/2019",
"discuss": "https://twitter.com/Ellpeck/status/1097177774337462272" "discuss": "https://twitter.com/Ellpeck/status/1097177774337462272"
}, },
{ {
"name": "Kindling the Reading Flame", "name": "Kindling the Reading Flame",
"summary": "About the Kindle, Harry Potter and what I like and dislike about them",
"id": "reading", "id": "reading",
"date": "3/22/2019", "date": "3/22/2019",
"discuss": "https://twitter.com/Ellpeck/status/1109102077911973888" "discuss": "https://twitter.com/Ellpeck/status/1109102077911973888"
}, },
{ {
"name": "Small Projects", "name": "Small Projects",
"summary": "Why creating a small, unplanned project is sometimes good for you",
"id": "small_projects", "id": "small_projects",
"date": "5/1/2019", "date": "5/1/2019",
"discuss": "https://twitter.com/Ellpeck/status/1123651624201871360" "discuss": "https://twitter.com/Ellpeck/status/1123651624201871360"
}, },
{ {
"name": "About Cross-Platform and Motivation", "name": "About Cross-Platform and Motivation",
"summary": "How moving from Java to C# taught me how horrible it is to create a cross-platform application with little to no knowledge or documentation",
"id": "cross_platform_trainwreck", "id": "cross_platform_trainwreck",
"date": "7/6/2019", "date": "7/6/2019",
"discuss": "https://twitter.com/Ellpeck/status/1147502654236573697" "discuss": "https://twitter.com/Ellpeck/status/1147502654236573697"
}, },
{ {
"name": "Big Projects", "name": "Big Projects",
"summary": "How a once small project I even created a post about turned into the first game I'm selling: Foe Frenzy",
"id": "big_projects", "id": "big_projects",
"date": "9/15/2019", "date": "9/15/2019",
"discuss": "https://twitter.com/Ellpeck/status/1173247686654517249" "discuss": "https://twitter.com/Ellpeck/status/1173247686654517249"

View file

@ -18,6 +18,7 @@ $.ajax({
p += '<div class="card bg-light blog-entry rounded-0">'; p += '<div class="card bg-light blog-entry rounded-0">';
p += '<div class="card-body">'; p += '<div class="card-body">';
p += '<a class="blog-button" id="blog-button-' + id + '"><h2 class="card-title">' + obj["name"] + '</h2></a>'; p += '<a class="blog-button" id="blog-button-' + id + '"><h2 class="card-title">' + obj["name"] + '</h2></a>';
p += '<div class="card-text text-muted blog-summary" id="blog-summary-' + id + '">' + obj["summary"] + '</div>';
p += '<div class="card-text" id="blog-post-' + id + '"></div>'; p += '<div class="card-text" id="blog-post-' + id + '"></div>';
p += '<span class="text-muted project-status">' + obj["date"] + "</span>"; p += '<span class="text-muted project-status">' + obj["date"] + "</span>";
var discussLink = obj["discuss"]; var discussLink = obj["discuss"];
@ -33,6 +34,7 @@ $.ajax({
var discuss = $("#blog-discuss-" + id); var discuss = $("#blog-discuss-" + id);
if (discuss.length) if (discuss.length)
discuss.html(""); discuss.html("");
$("#blog-summary-" + id).show();
history.pushState(null, null, "#blog"); history.pushState(null, null, "#blog");
} else { } else {
openBlogPost(id); openBlogPost(id);
@ -62,6 +64,7 @@ function openBlogPost(id, onDone) {
var discuss = $("#blog-discuss-" + id); var discuss = $("#blog-discuss-" + id);
if (discuss.length) if (discuss.length)
discuss.html("Discuss this post"); discuss.html("Discuss this post");
$("#blog-summary-" + id).hide();
if (onDone) if (onDone)
onDone(); onDone();

View file

@ -92,6 +92,11 @@ body {
margin-top: 15px; margin-top: 15px;
} }
.blog-summary {
margin-bottom: 15px;
width: 90%;
}
.footer { .footer {
bottom: 0; bottom: 0;
line-height: 30px; line-height: 30px;