docs(changelog): add keep a changelog note
This commit is contained in:
parent
1f26f19315
commit
d99762305b
2 changed files with 23 additions and 8 deletions
5
changelogs/changelog.md
Normal file
5
changelogs/changelog.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to
|
||||
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
@ -12,20 +12,31 @@ $page = new Page(__FILE__, __('Changelog'));
|
|||
$page->header();
|
||||
$page->bodyStart();
|
||||
$page->navigation();
|
||||
|
||||
$parsedown = new \Parsedown();
|
||||
$changelogsDirectory = ROOT . '/changelogs';
|
||||
$changelogFilepath = $changelogsDirectory . '/changelog.md';
|
||||
?>
|
||||
|
||||
<main>
|
||||
<div class="ui container">
|
||||
<h1 class="ui header"><?= $page->title ?></h1>
|
||||
|
||||
<div class="ui segment">
|
||||
<?= $parsedown->text(\file_get_contents($changelogFilepath)); ?>
|
||||
</div>
|
||||
|
||||
<div class="ui stackable grid">
|
||||
<?php
|
||||
$changelogsDirectory = ROOT . '/changelogs';
|
||||
$changelogs = \scandir($changelogsDirectory, \SCANDIR_SORT_DESCENDING);
|
||||
$changelogs = \array_map(
|
||||
function (string $filename) use ($changelogsDirectory) {
|
||||
function (string $filename) use ($changelogsDirectory, $changelogFilepath) {
|
||||
$filepath = $changelogsDirectory . '/' . $filename;
|
||||
|
||||
if ($filepath === $changelogFilepath) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $filepath;
|
||||
},
|
||||
$changelogs
|
||||
|
@ -56,7 +67,6 @@ $page->navigation();
|
|||
<div class="ui tab" data-tab="<?= $filenameSanitised ?>">
|
||||
<div class="ui segments">
|
||||
<?php
|
||||
$parsedown = new \Parsedown();
|
||||
$text = \file_get_contents($filepath);
|
||||
$text = \preg_replace('/(#(\d+))/', '<a href="https://github.com/wishthis/wishthis/issues/$2">$1</a>', $text);
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue