Add "date_modified_format" option to html export

This commit is contained in:
Tim Gerundt 2017-10-19 21:20:34 +02:00
parent 364ce8893d
commit 1c9806a9b0
4 changed files with 16 additions and 2 deletions

View File

@ -72,7 +72,7 @@ To disable this feature, set the `float` property to `false`.
## Date Modified ## Date Modified
By default, daux.io will display the last modified time as reported by the system underneath the title for each document. By default, daux.io will display the last modified time as reported by the system underneath the title for each document.
To disable this, change the option in your config.json to false. To disable this, change the option in your config.json to `false`.
```json ```json
{ {
@ -80,6 +80,17 @@ To disable this, change the option in your config.json to false.
} }
``` ```
If you want to use the last modified time you can set the [format](http://php.net/manual/function.date.php) with the `date_modified_format` option.
```json
{
"html": {
"date_modified": true,
"date_modified_format": "l, F j, Y g:i A"
}
}
```
## GitHub Repo ## GitHub Repo
Add a 'Fork me on GitHub' ribbon. Add a 'Fork me on GitHub' ribbon.

View File

@ -16,6 +16,7 @@
"breadcrumb_separator": "Chevrons", "breadcrumb_separator": "Chevrons",
"toggle_code": true, "toggle_code": true,
"date_modified": true, "date_modified": true,
"date_modified_format": "l, F j, Y g:i A",
"float": true, "float": true,
"inherit_index": true, "inherit_index": true,

View File

@ -28,6 +28,7 @@
"breadcrumb_separator": "Chevrons", "breadcrumb_separator": "Chevrons",
"toggle_code": true, "toggle_code": true,
"date_modified": false, "date_modified": false,
"date_modified_format": "l, F j, Y g:i A",
"float": false, "float": false,
"auto_landing": true, "auto_landing": true,
"search": true, "search": true,

View File

@ -5,7 +5,8 @@
<h1><?= $page['breadcrumbs'] ? $this->get_breadcrumb_title($page, $base_page) : $page['title'] ?></h1> <h1><?= $page['breadcrumbs'] ? $this->get_breadcrumb_title($page, $base_page) : $page['title'] ?></h1>
<?php if ($params['html']['date_modified']) { ?> <?php if ($params['html']['date_modified']) { ?>
<span style="float: left; font-size: 10px; color: gray;"> <span style="float: left; font-size: 10px; color: gray;">
<?= date("l, F j, Y g:i A", $page['modified_time']); ?> <?php $date_format = isset($params['html']['date_modified_format']) ? $params['html']['date_modified_format'] : 'l, F j, Y g:i A'; ?>
<?= date($date_format, $page['modified_time']); ?>
</span> </span>
<?php } ?> <?php } ?>
<?php <?php