mirror of
https://github.com/cobalt-org/cobalt.rs
synced 2024-11-10 06:14:12 +00:00
test: Custom config for build
This commit is contained in:
parent
0f72122831
commit
72f08d2dd1
26 changed files with 309 additions and 0 deletions
2
tests/cmd/custom_config.in/_cobalt_testing.yml
Normal file
2
tests/cmd/custom_config.in/_cobalt_testing.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
syntax_highlight:
|
||||||
|
enabled: false
|
12
tests/cmd/custom_config.in/_layouts/default.liquid
Normal file
12
tests/cmd/custom_config.in/_layouts/default.liquid
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>test</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>{{ page.permalink }}</h1>
|
||||||
|
|
||||||
|
{{ page.content }}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
10
tests/cmd/custom_config.in/_layouts/posts.liquid
Normal file
10
tests/cmd/custom_config.in/_layouts/posts.liquid
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>My blog - {{ page.permalink }}</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
{{ page.content }}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
8
tests/cmd/custom_config.in/index.liquid
Normal file
8
tests/cmd/custom_config.in/index.liquid
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
layout: default.liquid
|
||||||
|
---
|
||||||
|
This is my Index page!
|
||||||
|
|
||||||
|
{% for post in collections.posts.pages %}
|
||||||
|
<a href="{{post.permalink}}">{{ post.title }}</a>
|
||||||
|
{% endfor %}
|
10
tests/cmd/custom_config.in/no-post.md
Normal file
10
tests/cmd/custom_config.in/no-post.md
Normal file
|
@ -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
|
10
tests/cmd/custom_config.in/posts/all_date_variables.md
Normal file
10
tests/cmd/custom_config.in/posts/all_date_variables.md
Normal file
|
@ -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.
|
10
tests/cmd/custom_config.in/posts/custom-leading-slash.md
Normal file
10
tests/cmd/custom_config.in/posts/custom-leading-slash.md
Normal file
|
@ -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.
|
10
tests/cmd/custom_config.in/posts/custom.md
Normal file
10
tests/cmd/custom_config.in/posts/custom.md
Normal file
|
@ -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
|
12
tests/cmd/custom_config.in/posts/date_variables.md
Normal file
12
tests/cmd/custom_config.in/posts/date_variables.md
Normal file
|
@ -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.
|
|
@ -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.
|
10
tests/cmd/custom_config.in/posts/explodes-urls.md
Normal file
10
tests/cmd/custom_config.in/posts/explodes-urls.md
Normal file
|
@ -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.
|
9
tests/cmd/custom_config.in/posts/no-path.md
Normal file
9
tests/cmd/custom_config.in/posts/no-path.md
Normal file
|
@ -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.
|
12
tests/cmd/custom_config.in/posts/variables.md
Normal file
12
tests/cmd/custom_config.in/posts/variables.md
Normal file
|
@ -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.
|
13
tests/cmd/custom_config.in/posts/variables_file.md
Normal file
13
tests/cmd/custom_config.in/posts/variables_file.md
Normal file
|
@ -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
|
18
tests/cmd/custom_config.md
Normal file
18
tests/cmd/custom_config.md
Normal file
|
@ -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
|
||||||
|
|
||||||
|
```
|
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>My blog - 2015/05/5/03/3/01/05/20/</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>All date variables</h1>
|
||||||
|
<p>This checks that all date variables are interpolated correctly into the path.</p>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
12
tests/cmd/custom_config.out/_dest/2015/hello/index.html
Normal file
12
tests/cmd/custom_config.out/_dest/2015/hello/index.html
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>My blog - 2015/hello/</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Date variables</h1>
|
||||||
|
<p>This asserts interpolation of date variables and other variables.</p>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
33
tests/cmd/custom_config.out/_dest/index.html
Normal file
33
tests/cmd/custom_config.out/_dest/index.html
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>test</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>index.html</h1>
|
||||||
|
|
||||||
|
This is my Index page!
|
||||||
|
|
||||||
|
|
||||||
|
<a href="test/hello/world.abc">Variables file name</a>
|
||||||
|
|
||||||
|
<a href="test/hello/">Variables</a>
|
||||||
|
|
||||||
|
<a href="posts/no-path.html">Custom paths</a>
|
||||||
|
|
||||||
|
<a href="test/thing3/">Boom</a>
|
||||||
|
|
||||||
|
<a href="test/thing4">Boom without trailing slash</a>
|
||||||
|
|
||||||
|
<a href="2015/hello/">Date variables</a>
|
||||||
|
|
||||||
|
<a href="test/thing.html">Custom paths</a>
|
||||||
|
|
||||||
|
<a href="test/thing2.html">Custom paths with leading slash</a>
|
||||||
|
|
||||||
|
<a href="2015/05/5/03/3/01/05/20/">All date variables</a>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
12
tests/cmd/custom_config.out/_dest/posts/no-path.html
Normal file
12
tests/cmd/custom_config.out/_dest/posts/no-path.html
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>My blog - posts/no-path.html</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Custom paths</h1>
|
||||||
|
<p>This asserts that you can have normal and custom file paths side by side.</p>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
12
tests/cmd/custom_config.out/_dest/test/hello.html
Normal file
12
tests/cmd/custom_config.out/_dest/test/hello.html
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>My blog - test/hello.html</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Custom paths are available to non-posts</h1>
|
||||||
|
<p>This asserts that you can specify custom file paths</p>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
12
tests/cmd/custom_config.out/_dest/test/hello/index.html
Normal file
12
tests/cmd/custom_config.out/_dest/test/hello/index.html
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>My blog - test/hello/</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Variables</h1>
|
||||||
|
<p>This asserts that custom paths without a file extension get made into a folder with an index.html file.</p>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
12
tests/cmd/custom_config.out/_dest/test/hello/world.abc
Normal file
12
tests/cmd/custom_config.out/_dest/test/hello/world.abc
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>My blog - test/hello/world.abc</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Variables file name</h1>
|
||||||
|
<p>This asserts that you can substitute any part of the url with custom variables</p>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
12
tests/cmd/custom_config.out/_dest/test/thing.html
Normal file
12
tests/cmd/custom_config.out/_dest/test/thing.html
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>My blog - test/thing.html</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Custom paths</h1>
|
||||||
|
<p>This asserts that you can specify custom file paths</p>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
12
tests/cmd/custom_config.out/_dest/test/thing2.html
Normal file
12
tests/cmd/custom_config.out/_dest/test/thing2.html
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>My blog - test/thing2.html</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Custom paths with leading slash</h1>
|
||||||
|
<p>This asserts that you can specify custom file paths with a leading slash and it doesn't make a difference.</p>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
12
tests/cmd/custom_config.out/_dest/test/thing3/index.html
Normal file
12
tests/cmd/custom_config.out/_dest/test/thing3/index.html
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>My blog - test/thing3/</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Boom</h1>
|
||||||
|
<p>This asserts that custom paths without a file extension get made into a folder with an index.html file.</p>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
12
tests/cmd/custom_config.out/_dest/test/thing4/index.html
Normal file
12
tests/cmd/custom_config.out/_dest/test/thing4/index.html
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>My blog - test/thing4</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Boom without trailing slash</h1>
|
||||||
|
<p>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.</p>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue