Skip to content

Commit df18260

Browse files
committed
changed option to rename_last and added localization
1 parent 6268dad commit df18260

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ archive_generator:
2323
daily: false
2424
order_by: -date
2525
explicit_paging: false
26-
overwrite_latest: false
26+
rename_last: false
27+
localized_last: 'last'
2728
verbose: false
2829
```
2930
@@ -34,7 +35,8 @@ archive_generator:
3435
- **daily**: Generate daily archive.
3536
- **order_by**: Posts order. (Order by date descending by default)
3637
- **explicit_paging**: Explicit paging. (Number the first page. e.g. `page/1/index.html`)
37-
- **overwrite_latest**: Set the latest page. (`latest/index.html` in place of `page/N/index.html`). If there is a single page it requires explicitPaging=true`.
38+
- **rename_last**: Set the latest page name. (`page/last/index.html` in place of `page/N/index.html`). If there is a single page it requires explicit_paging=true`.
39+
- **localized_last**: Localize the last page name. (`page/最後/index.html` in place of `page/last/index.html`).
3840
- **verbose**: verbose output. (Output all generated routes)
3941

4042
## License

lib/generator.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ module.exports = function(locals) {
1212
const allPosts = locals.posts.sort(config.archive_generator.order_by || '-date');
1313
const perPage = config.archive_generator.per_page;
1414
const explicitPaging = config.archive_generator.explicit_paging || false;
15-
const overwriteLatest = config.archive_generator.overwrite_latest || false;
15+
const renameLast = config.archive_generator.rename_last || false;
16+
const localizedLast = config.archive_generator.localized_last || 'last';
1617
const verbose = config.archive_generator.verbose || false;
1718
const result = [];
1819

@@ -28,7 +29,8 @@ module.exports = function(locals) {
2829
layout: ['archive', 'index'],
2930
format: paginationDir + '/%d/',
3031
explicitPaging: explicitPaging,
31-
overwriteLatest: overwriteLatest,
32+
renameLast: renameLast,
33+
localizedLast: localizedLast,
3234
verbose: verbose,
3335
data: options
3436
});

0 commit comments

Comments
 (0)