Rename gallery generation script, write gallery and original photo name in Markdown file, simplify next/previous
This commit is contained in:
@@ -13,13 +13,13 @@ layout: post
|
||||
</div>
|
||||
<ul style="margin-top:0;">
|
||||
{% if page.previous %}
|
||||
<li><a href="/{{ site.baseurl }}{{ page.previous }}.html" rel="prev"> ← </a></li>
|
||||
<li><a href="/{{ site.baseurl }}/gallery/{{ page.gallery }}/{{ page.previous }}.html" rel="prev"> ← </a></li>
|
||||
{% else %}
|
||||
<li><span class="noanchor"> ← </span></li>
|
||||
{% endif %}
|
||||
|
||||
{% if page.next %}
|
||||
<li><a href="/{{ site.baseurl }}{{ page.next }}.html" rel="next"> → </a></li>
|
||||
<li><a href="/{{ site.baseurl }}/gallery/{{ page.gallery }}/{{ page.next }}.html" rel="next"> → </a></li>
|
||||
{% else %}
|
||||
<li><span class="noanchor"> → </span></li>
|
||||
{% endif %}
|
||||
@@ -94,13 +94,13 @@ layout: post
|
||||
<div class="meta-navigate screen-only">
|
||||
{% if page.next %}
|
||||
<div style="float:right;">
|
||||
<a href="/{{ site.baseurl }}{{ page.next }}.html" rel="next">Next Photo »</a>
|
||||
<a href="/{{ site.baseurl }}/gallery/{{ page.gallery }}/{{ page.next }}.html" rel="next">Next Photo »</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if page.previous %}
|
||||
<div style="float:left;">
|
||||
<a href="/{{ site.baseurl }}{{ page.previous }}.html" rel="prev">« Previous</a>
|
||||
<a href="/{{ site.baseurl }}/gallery/{{ page.gallery }}/{{ page.previous }}.html" rel="prev">« Previous</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
set root=%~dp0..
|
||||
php -dmemory_limit=1G %root%/_scripts/convert.php ^
|
||||
php -dmemory_limit=1G %root%/_scripts/generate-gallery.php ^
|
||||
%1 ^
|
||||
%2 ^
|
||||
%root%/asset/gallery ^
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
require __DIR__ . '/../_php/autoload.php';
|
||||
|
||||
use Symfony\Component\Console\Application;
|
||||
use Symfony\Component\Console\Input\ArgvInput;
|
||||
@@ -195,7 +195,9 @@ $oConsole
|
||||
$oOutput->write(' <comment>markdown</comment>');
|
||||
$aMatter = [
|
||||
'layout' => $sLayout,
|
||||
'title' => isset($aPhoto['title']) ? $aPhoto['title'] : null,
|
||||
'gallery' => $sGallery,
|
||||
'file' => basename($aPhoto['path'], '.jpg'),
|
||||
'title' => isset($aPhoto['title']) ? $aPhoto['title'] : '',
|
||||
'date' => $aPhoto['date']->format('Y-m-d H:i:s'),
|
||||
'ordering' => $aPhoto['ordering']
|
||||
];
|
||||
@@ -214,11 +216,11 @@ $oConsole
|
||||
}
|
||||
|
||||
if (isset($aPhotos[$i - 1])) {
|
||||
$aMatter['previous'] = '/gallery/' . $sGallery . '/' . $aPhotos[$i - 1]['id'];
|
||||
$aMatter['previous'] = $aPhotos[$i - 1]['id'];
|
||||
}
|
||||
|
||||
if (isset($aPhotos[$i + 1])) {
|
||||
$aMatter['next'] = '/gallery/' . $sGallery . '/' . $aPhotos[$i + 1]['id'];
|
||||
$aMatter['next'] = $aPhotos[$i + 1]['id'];
|
||||
}
|
||||
|
||||
if (isset($aPhoto['latitude'])) {
|
||||
@@ -314,7 +316,7 @@ $oConsole
|
||||
</div>
|
||||
{%% include gallery_list.html gallery='%s' %%}
|
||||
EOF
|
||||
, (empty($aGallery['description']) ? '' : $aGallery['description']), implode('·', $aLinks), $sGallery);
|
||||
, (empty($aGallery['description']) ? '' : $aGallery['description']), implode(' · ', $aLinks), $sGallery);
|
||||
file_put_contents(
|
||||
$sRenderPath . '/index.html',
|
||||
'---' . "\n" . yamlDump($aMatter) . '---' . "\n" . $sContents
|
||||
Reference in New Issue
Block a user