diff --git a/tests/cmd/custom_config.in/_cobalt_testing.yml b/tests/cmd/custom_config.in/_cobalt_testing.yml new file mode 100644 index 0000000..6c2e919 --- /dev/null +++ b/tests/cmd/custom_config.in/_cobalt_testing.yml @@ -0,0 +1,2 @@ +syntax_highlight: + enabled: false diff --git a/tests/cmd/custom_config.in/_layouts/default.liquid b/tests/cmd/custom_config.in/_layouts/default.liquid new file mode 100644 index 0000000..426ae69 --- /dev/null +++ b/tests/cmd/custom_config.in/_layouts/default.liquid @@ -0,0 +1,12 @@ + + + + test + + +

{{ page.permalink }}

+ + {{ page.content }} + + + diff --git a/tests/cmd/custom_config.in/_layouts/posts.liquid b/tests/cmd/custom_config.in/_layouts/posts.liquid new file mode 100644 index 0000000..79e1d74 --- /dev/null +++ b/tests/cmd/custom_config.in/_layouts/posts.liquid @@ -0,0 +1,10 @@ + + + + My blog - {{ page.permalink }} + + + {{ page.content }} + + + diff --git a/tests/cmd/custom_config.in/index.liquid b/tests/cmd/custom_config.in/index.liquid new file mode 100644 index 0000000..34afb94 --- /dev/null +++ b/tests/cmd/custom_config.in/index.liquid @@ -0,0 +1,8 @@ +--- +layout: default.liquid +--- +This is my Index page! + +{% for post in collections.posts.pages %} + {{ post.title }} +{% endfor %} diff --git a/tests/cmd/custom_config.in/no-post.md b/tests/cmd/custom_config.in/no-post.md new file mode 100644 index 0000000..775d91f --- /dev/null +++ b/tests/cmd/custom_config.in/no-post.md @@ -0,0 +1,10 @@ +--- +layout: posts.liquid + +title: Custom paths are available to non-posts +published_date: 2014-08-22 15:36:20 +0100 +permalink: /test/hello.html +--- +# {{ page.title }} + +This asserts that you can specify custom file paths diff --git a/tests/cmd/custom_config.in/posts/all_date_variables.md b/tests/cmd/custom_config.in/posts/all_date_variables.md new file mode 100644 index 0000000..2be08f9 --- /dev/null +++ b/tests/cmd/custom_config.in/posts/all_date_variables.md @@ -0,0 +1,10 @@ +--- +layout: posts.liquid + +title: All date variables +published_date: 2015-05-03 01:05:20 +0100 +permalink: /{{year}}/{{month}}/{{i_month}}/{{day}}/{{i_day}}/{{hour}}/{{minute}}/{{second}}/ +--- +# {{ page.title }} + +This checks that all date variables are interpolated correctly into the path. diff --git a/tests/cmd/custom_config.in/posts/custom-leading-slash.md b/tests/cmd/custom_config.in/posts/custom-leading-slash.md new file mode 100644 index 0000000..b1a0e26 --- /dev/null +++ b/tests/cmd/custom_config.in/posts/custom-leading-slash.md @@ -0,0 +1,10 @@ +--- +layout: posts.liquid + +title: Custom paths with leading slash +published_date: 2015-05-03 02:05:20 +0100 +permalink: /test/thing2.html +--- +# {{ page.title }} + +This asserts that you can specify custom file paths with a leading slash and it doesn't make a difference. diff --git a/tests/cmd/custom_config.in/posts/custom.md b/tests/cmd/custom_config.in/posts/custom.md new file mode 100644 index 0000000..c8c9e98 --- /dev/null +++ b/tests/cmd/custom_config.in/posts/custom.md @@ -0,0 +1,10 @@ +--- +layout: posts.liquid + +title: Custom paths +published_date: 2015-05-03 03:05:20 +0100 +permalink: /test/thing.html +--- +# {{ page.title }} + +This asserts that you can specify custom file paths diff --git a/tests/cmd/custom_config.in/posts/date_variables.md b/tests/cmd/custom_config.in/posts/date_variables.md new file mode 100644 index 0000000..ae557d5 --- /dev/null +++ b/tests/cmd/custom_config.in/posts/date_variables.md @@ -0,0 +1,12 @@ +--- +layout: posts.liquid + +title: Date variables +published_date: 2015-05-03 04:05:20 +0100 +permalink: /{{year}}/{{data.thing}}/ +data: + thing: hello +--- +# {{ page.title }} + +This asserts interpolation of date variables and other variables. diff --git a/tests/cmd/custom_config.in/posts/explodes-urls-without-trailing-slash.md b/tests/cmd/custom_config.in/posts/explodes-urls-without-trailing-slash.md new file mode 100644 index 0000000..53cb240 --- /dev/null +++ b/tests/cmd/custom_config.in/posts/explodes-urls-without-trailing-slash.md @@ -0,0 +1,10 @@ +--- +layout: posts.liquid + +title: Boom without trailing slash +published_date: 2015-05-03 05:05:20 +0100 +permalink: /test/thing4 +--- +# {{ page.title }} + +This asserts that custom paths without a file extension get made into a folder with an index.html file, even when the user did not specify a trailing slash. diff --git a/tests/cmd/custom_config.in/posts/explodes-urls.md b/tests/cmd/custom_config.in/posts/explodes-urls.md new file mode 100644 index 0000000..8974249 --- /dev/null +++ b/tests/cmd/custom_config.in/posts/explodes-urls.md @@ -0,0 +1,10 @@ +--- +layout: posts.liquid + +title: Boom +published_date: 2015-05-03 06:05:20 +0100 +permalink: /test/thing3/ +--- +# {{ page.title }} + +This asserts that custom paths without a file extension get made into a folder with an index.html file. diff --git a/tests/cmd/custom_config.in/posts/no-path.md b/tests/cmd/custom_config.in/posts/no-path.md new file mode 100644 index 0000000..ef9d331 --- /dev/null +++ b/tests/cmd/custom_config.in/posts/no-path.md @@ -0,0 +1,9 @@ +--- +layout: posts.liquid + +title: Custom paths +published_date: 2015-05-03 07:05:20 +0100 +--- +# {{ page.title }} + +This asserts that you can have normal and custom file paths side by side. diff --git a/tests/cmd/custom_config.in/posts/variables.md b/tests/cmd/custom_config.in/posts/variables.md new file mode 100644 index 0000000..b9ab268 --- /dev/null +++ b/tests/cmd/custom_config.in/posts/variables.md @@ -0,0 +1,12 @@ +--- +layout: posts.liquid + +title: Variables +published_date: 2015-05-03 08:05:20 +0100 +permalink: /test/{{data.thing}}/ +data: + thing: hello +--- +# {{ page.title }} + +This asserts that custom paths without a file extension get made into a folder with an index.html file. diff --git a/tests/cmd/custom_config.in/posts/variables_file.md b/tests/cmd/custom_config.in/posts/variables_file.md new file mode 100644 index 0000000..97d192c --- /dev/null +++ b/tests/cmd/custom_config.in/posts/variables_file.md @@ -0,0 +1,13 @@ +--- +layout: posts.liquid + +title: Variables file name +published_date: 2015-05-03 09:05:20 +0100 +permalink: /test/{{data.thing}}/{{data.thang}}.abc +data: + thing: hello + thang: world +--- +# {{ page.title }} + +This asserts that you can substitute any part of the url with custom variables diff --git a/tests/cmd/custom_config.md b/tests/cmd/custom_config.md new file mode 100644 index 0000000..3b5d953 --- /dev/null +++ b/tests/cmd/custom_config.md @@ -0,0 +1,18 @@ +```console +$ cobalt -v build --destination _dest +WARN: No _cobalt.yml file found in current directory, using default config. +... + +$ cobalt -v build --config _cobalt_testing.yml --destination _dest +Building from `.` into `[CWD]/_dest` +DEBUG: glob converted to regex: Glob { glob: "**/.*", re: "(?-u)^(?:/?|.*/)//.[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true }, tokens: Tokens([RecursivePrefix, Literal('.'), ZeroOrMore]) } +DEBUG: glob converted to regex: Glob { glob: "**/_*", re: "(?-u)^(?:/?|.*/)_[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true }, tokens: Tokens([RecursivePrefix, Literal('_'), ZeroOrMore]) } +DEBUG: built glob set; 5 literals, 0 basenames, 0 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 2 regexes +DEBUG: Loading data from `./_data` +DEBUG: glob converted to regex: Glob { glob: "**/.*", re: "(?-u)^(?:/?|.*/)//.[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true }, tokens: Tokens([RecursivePrefix, Literal('.'), ZeroOrMore]) } +DEBUG: glob converted to regex: Glob { glob: "**/_*", re: "(?-u)^(?:/?|.*/)_[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true }, tokens: Tokens([RecursivePrefix, Literal('_'), ZeroOrMore]) } +DEBUG: built glob set; 0 literals, 0 basenames, 0 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 2 regexes +DEBUG: Loading snippets from `./_includes` +Build successful + +``` diff --git a/tests/cmd/custom_config.out/_dest/2015/05/5/03/3/01/05/20/index.html b/tests/cmd/custom_config.out/_dest/2015/05/5/03/3/01/05/20/index.html new file mode 100644 index 0000000..e505956 --- /dev/null +++ b/tests/cmd/custom_config.out/_dest/2015/05/5/03/3/01/05/20/index.html @@ -0,0 +1,12 @@ + + + + My blog - 2015/05/5/03/3/01/05/20/ + + +

All date variables

+

This checks that all date variables are interpolated correctly into the path.

+ + + + diff --git a/tests/cmd/custom_config.out/_dest/2015/hello/index.html b/tests/cmd/custom_config.out/_dest/2015/hello/index.html new file mode 100644 index 0000000..722bc76 --- /dev/null +++ b/tests/cmd/custom_config.out/_dest/2015/hello/index.html @@ -0,0 +1,12 @@ + + + + My blog - 2015/hello/ + + +

Date variables

+

This asserts interpolation of date variables and other variables.

+ + + + diff --git a/tests/cmd/custom_config.out/_dest/index.html b/tests/cmd/custom_config.out/_dest/index.html new file mode 100644 index 0000000..5883417 --- /dev/null +++ b/tests/cmd/custom_config.out/_dest/index.html @@ -0,0 +1,33 @@ + + + + test + + +

index.html

+ + This is my Index page! + + + Variables file name + + Variables + + Custom paths + + Boom + + Boom without trailing slash + + Date variables + + Custom paths + + Custom paths with leading slash + + All date variables + + + + + diff --git a/tests/cmd/custom_config.out/_dest/posts/no-path.html b/tests/cmd/custom_config.out/_dest/posts/no-path.html new file mode 100644 index 0000000..7b2f1f3 --- /dev/null +++ b/tests/cmd/custom_config.out/_dest/posts/no-path.html @@ -0,0 +1,12 @@ + + + + My blog - posts/no-path.html + + +

Custom paths

+

This asserts that you can have normal and custom file paths side by side.

+ + + + diff --git a/tests/cmd/custom_config.out/_dest/test/hello.html b/tests/cmd/custom_config.out/_dest/test/hello.html new file mode 100644 index 0000000..c4fd9ab --- /dev/null +++ b/tests/cmd/custom_config.out/_dest/test/hello.html @@ -0,0 +1,12 @@ + + + + My blog - test/hello.html + + +

Custom paths are available to non-posts

+

This asserts that you can specify custom file paths

+ + + + diff --git a/tests/cmd/custom_config.out/_dest/test/hello/index.html b/tests/cmd/custom_config.out/_dest/test/hello/index.html new file mode 100644 index 0000000..91e2947 --- /dev/null +++ b/tests/cmd/custom_config.out/_dest/test/hello/index.html @@ -0,0 +1,12 @@ + + + + My blog - test/hello/ + + +

Variables

+

This asserts that custom paths without a file extension get made into a folder with an index.html file.

+ + + + diff --git a/tests/cmd/custom_config.out/_dest/test/hello/world.abc b/tests/cmd/custom_config.out/_dest/test/hello/world.abc new file mode 100644 index 0000000..8820809 --- /dev/null +++ b/tests/cmd/custom_config.out/_dest/test/hello/world.abc @@ -0,0 +1,12 @@ + + + + My blog - test/hello/world.abc + + +

Variables file name

+

This asserts that you can substitute any part of the url with custom variables

+ + + + diff --git a/tests/cmd/custom_config.out/_dest/test/thing.html b/tests/cmd/custom_config.out/_dest/test/thing.html new file mode 100644 index 0000000..dfd0adc --- /dev/null +++ b/tests/cmd/custom_config.out/_dest/test/thing.html @@ -0,0 +1,12 @@ + + + + My blog - test/thing.html + + +

Custom paths

+

This asserts that you can specify custom file paths

+ + + + diff --git a/tests/cmd/custom_config.out/_dest/test/thing2.html b/tests/cmd/custom_config.out/_dest/test/thing2.html new file mode 100644 index 0000000..19fccf4 --- /dev/null +++ b/tests/cmd/custom_config.out/_dest/test/thing2.html @@ -0,0 +1,12 @@ + + + + My blog - test/thing2.html + + +

Custom paths with leading slash

+

This asserts that you can specify custom file paths with a leading slash and it doesn't make a difference.

+ + + + diff --git a/tests/cmd/custom_config.out/_dest/test/thing3/index.html b/tests/cmd/custom_config.out/_dest/test/thing3/index.html new file mode 100644 index 0000000..bfc06a5 --- /dev/null +++ b/tests/cmd/custom_config.out/_dest/test/thing3/index.html @@ -0,0 +1,12 @@ + + + + My blog - test/thing3/ + + +

Boom

+

This asserts that custom paths without a file extension get made into a folder with an index.html file.

+ + + + diff --git a/tests/cmd/custom_config.out/_dest/test/thing4/index.html b/tests/cmd/custom_config.out/_dest/test/thing4/index.html new file mode 100644 index 0000000..c8f2a08 --- /dev/null +++ b/tests/cmd/custom_config.out/_dest/test/thing4/index.html @@ -0,0 +1,12 @@ + + + + My blog - test/thing4 + + +

Boom without trailing slash

+

This asserts that custom paths without a file extension get made into a folder with an index.html file, even when the user did not specify a trailing slash.

+ + + +