Skip to content

Commit

Permalink
option to disable the automatic slugifier #44
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Apr 4, 2021
1 parent 6a605d1 commit c2cef39
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this
project adheres to [Semantic Versioning](http://semver.org/).

## [0.16.6] - 2021-04-04
### Added
- New option `slugifyUrls` to disable slugifier introduced in 0.16.0 [#44].

## [0.16.5] - 2021-03-29
### Fixed
- Undo the change "only rebuild the site if it's needed" due regression issues.
Expand Down Expand Up @@ -504,7 +508,9 @@ First version
[#39]: https://github.com/oscarotero/lume/issues/39
[#41]: https://github.com/oscarotero/lume/issues/41
[#43]: https://github.com/oscarotero/lume/issues/43
[#44]: https://github.com/oscarotero/lume/issues/44

[0.16.6]: https://github.com/oscarotero/lume/compare/v0.16.5...v0.16.6
[0.16.5]: https://github.com/oscarotero/lume/compare/v0.16.4...v0.16.5
[0.16.4]: https://github.com/oscarotero/lume/compare/v0.16.3...v0.16.4
[0.16.3]: https://github.com/oscarotero/lume/compare/v0.16.2...v0.16.3
Expand Down
2 changes: 1 addition & 1 deletion cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as build from "./cli/build.js";
import * as run from "./cli/run.js";
import { error as printError } from "./utils.js";

export const version = "v0.16.5";
export const version = "v0.16.6";

const HELP = `
Docs: https://lumeland.github.io/
Expand Down
10 changes: 6 additions & 4 deletions site.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { basename, dirname, extname, join, SEP, posix } from "./deps/path.js";
import { dirname, extname, join, SEP, posix } from "./deps/path.js";
import { copy, emptyDir, ensureDir, exists } from "./deps/fs.js";
import { gray } from "./deps/colors.js";
import { createHash } from "./deps/hash.js";
Expand All @@ -12,6 +12,7 @@ const defaults = {
dest: "./_site",
dev: false,
prettyUrls: true,
slugifyUrls: true,
flags: [],
server: {
port: 3000,
Expand Down Expand Up @@ -465,12 +466,13 @@ export default class Site {
dest.path = `/${dest.path}`;
}

dest.path = slugify(dest.path);

if (this.options.slugifyUrls) {
dest.path = slugify(dest.path);
}

page.data.url = (dest.ext === ".html" && posix.basename(dest.path) === "index")
? dest.path.slice(0, -5)
: dest.path + dest.ext;

}

/**
Expand Down

0 comments on commit c2cef39

Please sign in to comment.