forked from team/site
1
0
Fork 0

update posts, include author, sort posts reverse alpha

This commit is contained in:
Ben Harris 2017-12-28 17:37:51 -05:00
parent 08937b740e
commit 8fd9e82f91
4 changed files with 11 additions and 6 deletions

View File

@ -73,8 +73,6 @@
<i class="fa fa-link"></i> url shortener</a>
<a class="btn btn-success" href="https://social.tilde.team/">
<i class="fa fa-retweet"></i> tilde.team mastodon instance</a>
<a class="btn btn-success" href="https://twitter.com/tildeteam">
<i class="fa fa-twitter"></i> tilde.team updates on twitter</a>
<br>
<hr>

View File

@ -1,13 +1,13 @@
<?php
foreach (glob("news/*.json") as $file):
foreach (array_reverse(glob("news/*.json")) as $file):
$post = json_decode(file_get_contents($file));
if (!$post->published) continue; ?>
<div class="list-group">
<div class="list-group-item">
<h4 class="list-group-item-heading"><?=$post->title?></h4>
<em><?=$post->date?></em>
<em><?=$post->date?> - <?=$post->author?></em>
<p class="list-group-item-text"><?=$post->content?></p>
</div>
</div>

View File

@ -1,7 +1,7 @@
{
"published": true,
"date": "Dec 28, 2017",
"date": "dec 28, 2017",
"title": "first post",
"author": "",
"author": "~ben",
"content": "hi this is the first news post"
}

7
news/001_new_news.json Executable file
View File

@ -0,0 +1,7 @@
{
"published": true,
"date": "dec 28, 2017",
"title": "good news everyone",
"author": "~ben",
"content": "there's a news feed on the homepage now!! whenever there is any news, it will be posted here. if you have any big news, make a pull request on the <a href=\"https://github.com/tilde-team/site\">github repo</a> and then <a href=\"/~ben/\">~ben</a> or another github admin can merge it"
}