actually show entries

This commit is contained in:
Ben Harris 2019-09-09 20:29:03 -04:00
parent f9094a0524
commit 097e543ebf
Signed by untrusted user: ben
GPG Key ID: 4E0AF802FFF7960C
11 changed files with 412 additions and 28 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
vendor/

View File

@ -4,4 +4,16 @@ We are an open journal which accepts any tilde-related or non-tilde related entr
Currently hosted at [journal.tildeverse.org](https://journal.tildeverse.org/). Currently hosted at [journal.tildeverse.org](https://journal.tildeverse.org/).
[Come chat with us! (tilde.chat:6697/#journal)](https://web.tilde.chat/?join=journal) ![chat badge](https://tilde.chat/badges/badge.php?channel=%23journal) [Come chat with us! (tilde.chat:6697/#journal)](https://web.tilde.chat/?join=journal)
![chat badge](https://tilde.chat/badges/badge.php?channel=%23journal)
## deployment notes
this site requires an nginx rewrite to properly server entries:
location ~* ^/entries/(.+)$ {
try_files $uri $uri/ /entry.php?slug=$1;
include snippets/php.conf;
}

View File

@ -1,14 +0,0 @@
<?php
$title="Charter";
$desc="Our charter to the tildeverse community";
include "header.php";
?>
<h1 class="page-header">Charter</h1>
<p>The Intentional Journal of the Tildeverse is an open journal for members of any tilde box (i.e; <a href="//tilde.town">tilde.town</a>, <a href="//tilde.team">tilde.team</a>,
<a href="//yourtilde.com">yourtilde.com</a>, etc.) to describe research and results of projects. Papers published should be long-formed essays as
opposed to short-form declarations, and can be on any topic of pure interest to the author, as long as there is non-commercial
motivation to explore and learn more about a topic. In addition to publishing tilde members' papers, we also operate as a social
space where members can participate in many ways, including (but not limited to) reviewing papers and providing constructive
criticism, responding to author questions, writing (obviously), or even simply bringing up topics to be researched. Through reviewing
and providing constructive criticism, we hope to provide a mechanism for authors to better themselves or develop their thinking about a topic.</p>
<?php include "footer.php"; ?>

12
composer.json Normal file
View File

@ -0,0 +1,12 @@
{
"require": {
"tildeverse/wiki": "dev-master"
},
"repositories": [
{
"type": "vcs",
"url": "https://tildegit.org/ben/tildewiki"
}
]
}

292
composer.lock generated Normal file
View File

@ -0,0 +1,292 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "3ab3df15c4e40417f427b37691e83088",
"packages": [
{
"name": "erusev/parsedown",
"version": "1.7.3",
"source": {
"type": "git",
"url": "https://github.com/erusev/parsedown.git",
"reference": "6d893938171a817f4e9bc9e86f2da1e370b7bcd7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/erusev/parsedown/zipball/6d893938171a817f4e9bc9e86f2da1e370b7bcd7",
"reference": "6d893938171a817f4e9bc9e86f2da1e370b7bcd7",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35"
},
"type": "library",
"autoload": {
"psr-0": {
"Parsedown": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Emanuil Rusev",
"email": "hello@erusev.com",
"homepage": "http://erusev.com"
}
],
"description": "Parser for Markdown.",
"homepage": "http://parsedown.org",
"keywords": [
"markdown",
"parser"
],
"time": "2019-03-17T18:48:37+00:00"
},
{
"name": "erusev/parsedown-extra",
"version": "0.7.1",
"source": {
"type": "git",
"url": "https://github.com/erusev/parsedown-extra.git",
"reference": "0db5cce7354e4b76f155d092ab5eb3981c21258c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/erusev/parsedown-extra/zipball/0db5cce7354e4b76f155d092ab5eb3981c21258c",
"reference": "0db5cce7354e4b76f155d092ab5eb3981c21258c",
"shasum": ""
},
"require": {
"erusev/parsedown": "~1.4"
},
"type": "library",
"autoload": {
"psr-0": {
"ParsedownExtra": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Emanuil Rusev",
"email": "hello@erusev.com",
"homepage": "http://erusev.com"
}
],
"description": "An extension of Parsedown that adds support for Markdown Extra.",
"homepage": "https://github.com/erusev/parsedown-extra",
"keywords": [
"markdown",
"markdown extra",
"parsedown",
"parser"
],
"time": "2015-11-01T10:19:22+00:00"
},
{
"name": "mnapoli/front-yaml",
"version": "1.6.0",
"source": {
"type": "git",
"url": "https://github.com/mnapoli/FrontYAML.git",
"reference": "24070ace8b741247bb3161cbb38ecc541268b296"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mnapoli/FrontYAML/zipball/24070ace8b741247bb3161cbb38ecc541268b296",
"reference": "24070ace8b741247bb3161cbb38ecc541268b296",
"shasum": ""
},
"require": {
"erusev/parsedown": "~1.0",
"php": ">=5.4.0",
"symfony/yaml": "~2.1|^3.0|^4.0"
},
"require-dev": {
"league/commonmark": "~0.7",
"phpunit/phpunit": "~4.5"
},
"type": "library",
"autoload": {
"psr-4": {
"Mni\\FrontYAML\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"time": "2017-10-29T19:29:55+00:00"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.12.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "550ebaac289296ce228a706d0867afc34687e3f4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4",
"reference": "550ebaac289296ce228a706d0867afc34687e3f4",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-ctype": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.12-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Ctype\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Gert de Pagter",
"email": "BackEndTea@gmail.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for ctype functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"ctype",
"polyfill",
"portable"
],
"time": "2019-08-06T08:03:45+00:00"
},
{
"name": "symfony/yaml",
"version": "v4.3.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "5a0b7c32dc3ec56fd4abae8a4a71b0cf05013686"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/5a0b7c32dc3ec56fd4abae8a4a71b0cf05013686",
"reference": "5a0b7c32dc3ec56fd4abae8a4a71b0cf05013686",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"symfony/polyfill-ctype": "~1.8"
},
"conflict": {
"symfony/console": "<3.4"
},
"require-dev": {
"symfony/console": "~3.4|~4.0"
},
"suggest": {
"symfony/console": "For validating YAML files using the lint command"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.3-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Yaml\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2019-08-20T14:27:59+00:00"
},
{
"name": "tildeverse/wiki",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://tildegit.org/ben/tildewiki",
"reference": "751eb64c383cb7c6ec643eaf683b88aa1de351ea"
},
"require": {
"erusev/parsedown-extra": "^0.7.1",
"mnapoli/front-yaml": "^1.6"
},
"type": "library",
"autoload": {
"psr-4": {
"Tildeverse\\Wiki\\": "src/"
}
},
"license": [
"GPLv3"
],
"authors": [
{
"name": "Ben Harris",
"email": "ben@tilde.team"
}
],
"description": "parsedown extensions for tilde wikis",
"time": "2019-07-03T05:06:34+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
"tildeverse/wiki": 20
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}

11
entries/sample.md Normal file
View File

@ -0,0 +1,11 @@
---
title: "hello"
author: "Ben Harris"
date: sep 9, 2019
published: false
---
# hello!
this is a sample journal entry.

67
entry.php Normal file
View File

@ -0,0 +1,67 @@
<?php
include "vendor/autoload.php";
$parser = Tildeverse\Wiki\Parser::factory();
if (isset($_GET["slug"])) {
$entry_name = $_GET["slug"];
} elseif (count($_GET) == 1) {
$entry_name = array_keys($_GET)[0];
} else {
$entry_name = "";
}
$filename = "entries/{$entry_name}.md";
if (file_exists($filename)) {
$document = $parser->parse(file_get_contents($filename));
$yml = $document->getYAML();
$content = $document->getContent();
$title = $yml["title"] ?? "invalid";
$author = htmlspecialchars($yml["author"]);
$description = "journal entry {$entry_name}: {$yml["title"]} by {$author}";
include "header.php";
?>
<a href=".">&lt; back to list</a>
<h1>
<?=$yml["title"]?>
<?=$yml["published"] ? "" : " <small><em>draft</em></small>" ?>
</h1>
<p>author: <?=$author?></p>
<p>date: <?=$yml["date"]?></p>
<br />
<?=$content?>
<?php
} else {
$title="journal entries";
$description="a list of tildeverse journal entries.";
include "header.php";
foreach (glob("entries/*.md") as $entry) {
$entries[] = [
"slug" => basename($entry, ".md"),
"yml" => $parser->parse(file_get_contents($entry))->getYAML(),
];
} ?>
<h1>journal entries</h1>
<ul>
<?php foreach ($entries as $entry) {
if (!$entry["yml"]["published"]) continue; ?>
<li>
<a href="/entry.php?slug=<?=$entry["slug"]?>">
<?=$entry["yml"]["title"]?> by <?=$entry["yml"]["author"]?>
</a>
</li>
<?php } ?>
</ul>
<?php }
include "footer.php"; ?>

View File

@ -1,6 +1,5 @@
<br><br> <br><br>
</div> </div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
</body> </body>
</html> </html>

View File

@ -8,9 +8,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta property="og:title" content="The Intentional Journal of the Tildeverse | <?=($title ?? 'open journal for tildes')?>"> <meta property="og:title" content="the intentional journal of the tildeverse | <?=($title ?? 'open journal for tildes')?>">
<meta property="og:url" content="https://journal.tilde.team<?=$_SERVER['REQUEST_URI']?>"> <meta property="og:url" content="https://journal.tilde.team<?=$_SERVER['REQUEST_URI']?>">
<meta property="og:description" content="<?=($desc??($title??'the home of an open journal for tildes'))?>"> <meta property="og:description" content="<?=($desc??($title ?? "the home of an open journal for tildes"))?>">
<meta property="og:image" content="https://journal.tilde.team/apple-icon.png"> <meta property="og:image" content="https://journal.tilde.team/apple-icon.png">
<meta property="og:site_name" content="The Intentional Journal of the Tildeverse"> <meta property="og:site_name" content="The Intentional Journal of the Tildeverse">
<meta property="og:type" content="website"> <meta property="og:type" content="website">
@ -19,3 +19,4 @@
<body style="padding-top: 70px;"> <body style="padding-top: 70px;">
<div class="container"> <div class="container">
<?php require 'navbar.php'; ?> <?php require 'navbar.php'; ?>

View File

@ -13,4 +13,13 @@
<p>an open journal for tilde members</p> <p>an open journal for tilde members</p>
</div> </div>
<p>We are an open journal which accepts any tilde-related or non-tilde related entries.</p> <p>We are an open journal which accepts any tilde-related or non-tilde related entries.</p>
<p>The Intentional Journal of the Tildeverse is an open journal for members of any tilde box (i.e; <a href="//tilde.town">tilde.town</a>, <a href="//tilde.team">tilde.team</a>,
<a href="//yourtilde.com">yourtilde.com</a>, etc.) to describe research and results of projects. Papers published should be long-formed essays as
opposed to short-form declarations, and can be on any topic of pure interest to the author, as long as there is non-commercial
motivation to explore and learn more about a topic. In addition to publishing tilde members' papers, we also operate as a social
space where members can participate in many ways, including (but not limited to) reviewing papers and providing constructive
criticism, responding to author questions, writing (obviously), or even simply bringing up topics to be researched. Through reviewing
and providing constructive criticism, we hope to provide a mechanism for authors to better themselves or develop their thinking about a topic.</p>
<?php include "footer.php"; ?> <?php include "footer.php"; ?>

View File

@ -11,15 +11,9 @@
</div> </div>
<div id="navbar" class="navbar-collapse collapse"> <div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li><a href="/"><i class="fa fa-home"></i> home</a></li> <li><a href="/entries/"><i class="fa fa-home"></i> entries</a></li>
<li class="dropdown"> <li><a href="https://web.tilde.chat/?join=journal"><i class="fa fa-comments-o"></i> IRC chatroom</a></li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">pages <span class="caret"></span></a> <li><a href="https://tildegit.org/tildeverse/journal"><i class="fa fa-code-fork"></i> git</a></li>
<ul class="dropdown-menu" role="menu">
<li><a href="https://journal.tildeverse.org/charter.php"><i class="fa fa-file-text"></i> charter</a></li>
<li><a href="https://web.tilde.chat/?join=journal"><i class="fa fa-comments-o"></i> IRC chatroom</a></li>
<li><a href="https://tildegit.org/tildeverse/journal"><i class="fa fa-code-fork"></i> git</a></li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>