From 6f62dea85679a23b7179f26573e8f26132fc32c6 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 20 Dec 2017 20:48:10 -0700 Subject: [PATCH] feat(liquid): Make page variables future-proof This is a part of #257 Attributes from a page are now under the `page` object - `path` -> `page.permalink` to make it clear this is the equivelant of `permalink` in the frontmatter - `source` -> `page.file.permalink` - Under `file` to make room for `page.file.parent` - `permalink for consitency with `page.permalink` - `date` -> `page.published_date` - Consistency with the new `published_date` in the front matter - Both are renamed to make it clear the role of the date (versus a future `modified_date` that might exist) - `draft` -> `page.is_draft` - `previous` -> `page.previous` - `next` -> `page.next` - Custom fields have moved from `` to `page.data.`. BREAKING CHANGE: Liquid `{{ variables }}` have been renamed. `cobalt migrate` will fix some. `cobalt build` will most likely fail on variables missed by `cobalt migrate`. --- src/bin/cobalt/main.rs | 3 + src/bin/cobalt/migrate.rs | 155 +++++++++++++++++- src/cobalt.rs | 44 +++-- src/document.rs | 59 +++---- src/new.rs | 24 +-- tests/cli.rs | 2 +- .../copy_files/_layouts/default.liquid | 4 +- .../fixtures/copy_files/_layouts/posts.liquid | 4 +- tests/fixtures/copy_files/index.liquid | 2 +- .../posts/2014-08-24-my-first-blogpost.md | 2 +- .../custom_paths/_layouts/default.liquid | 4 +- .../custom_paths/_layouts/posts.liquid | 4 +- tests/fixtures/custom_paths/index.liquid | 2 +- tests/fixtures/custom_paths/no-post.md | 2 +- .../custom_paths/posts/all_date_variables.md | 2 +- .../posts/custom-leading-slash.md | 2 +- tests/fixtures/custom_paths/posts/custom.md | 2 +- .../custom_paths/posts/date_variables.md | 2 +- .../explodes-urls-without-trailing-slash.md | 2 +- .../custom_paths/posts/explodes-urls.md | 2 +- tests/fixtures/custom_paths/posts/no-path.md | 2 +- .../fixtures/custom_paths/posts/variables.md | 2 +- .../custom_paths/posts/variables_file.md | 2 +- .../custom_post_path/_layouts/default.liquid | 4 +- .../custom_post_path/_layouts/posts.liquid | 4 +- tests/fixtures/custom_post_path/index.liquid | 2 +- tests/fixtures/custom_post_path/no-post.md | 2 +- .../posts/my-first-blogpost.md | 2 +- .../posts/my-fourth-blogpost.md | 2 +- .../posts/my-second-blogpost.md | 2 +- .../posts/my-third-blogpost.md | 2 +- .../_layouts/default.liquid | 4 +- .../custom_posts_folder/_layouts/posts.liquid | 4 +- .../blog/2014-08-24-my-first-blogpost.md | 2 +- .../fixtures/custom_posts_folder/index.liquid | 2 +- .../_layouts/default.txt | 4 +- .../_layouts/posts.exe | 4 +- .../custom_template_extensions/index.txt | 2 +- .../posts/2014-08-24-my-first-blogpost.md | 2 +- .../fixtures/dotfiles/_layouts/default.liquid | 4 +- tests/fixtures/dotfiles/_layouts/posts.liquid | 4 +- tests/fixtures/dotfiles/index.liquid | 2 +- .../posts/2014-08-24-my-first-blogpost.md | 2 +- tests/fixtures/drafts/_drafts/a-draft-post.md | 2 +- tests/fixtures/drafts/_layouts/default.liquid | 4 +- tests/fixtures/drafts/_layouts/posts.liquid | 4 +- tests/fixtures/drafts/index.liquid | 2 +- .../posts/2014-08-24-my-first-blogpost.md | 2 +- .../_drafts/a-draft-post.md | 2 +- .../_layouts/default.liquid | 4 +- .../_layouts/posts.liquid | 4 +- .../drafts_not_shown_by_default/index.liquid | 2 +- .../posts/2014-08-24-my-first-blogpost.md | 2 +- .../posts/this-is-a-draft.md | 2 +- .../empty_frontmatter/_layouts/default.liquid | 4 +- .../empty_frontmatter/_layouts/posts.liquid | 4 +- tests/fixtures/empty_frontmatter/index.liquid | 2 +- .../posts/my-first-blogpost.md | 2 +- .../fixtures/example/_layouts/default.liquid | 4 +- tests/fixtures/example/_layouts/posts.liquid | 4 +- tests/fixtures/example/index.liquid | 2 +- .../posts/2014-08-24-my-first-blogpost.md | 2 +- tests/fixtures/excerpts/_includes/post.liquid | 4 +- .../fixtures/excerpts/_layouts/default.liquid | 8 +- tests/fixtures/excerpts/index.liquid | 2 +- .../_blog/2014-08-24-my-first-blogpost.md | 2 +- .../_layouts/default.liquid | 4 +- .../hidden_posts_folder/_layouts/posts.liquid | 4 +- .../fixtures/hidden_posts_folder/index.liquid | 2 +- .../ignore_files/_layouts/default.liquid | 4 +- .../ignore_files/_layouts/posts.liquid | 4 +- tests/fixtures/ignore_files/index.liquid | 2 +- .../posts/2014-08-24-my-first-blogpost.md | 2 +- .../_posts/my-first-blogpost.md | 2 +- .../_posts/my-fourth-blogpost.md | 2 +- .../_posts/my-second-blogpost.md | 2 +- .../_posts/my-third-blogpost.md | 2 +- tests/fixtures/incomplete_rss/index.liquid | 2 +- .../fixtures/jsonfeed/_layouts/default.liquid | 4 +- tests/fixtures/jsonfeed/_layouts/posts.liquid | 4 +- tests/fixtures/jsonfeed/index.liquid | 2 +- .../jsonfeed/posts/my-first-blogpost.md | 2 +- .../jsonfeed/posts/my-second-blogpost.md | 2 +- .../jsonfeed/posts/my-third-blogpost.md | 2 +- .../posts/subdir/my-fifth-blogpost.md | 2 +- .../posts/subdir/my-fourth-blogpost.md | 2 +- .../liquid_error/_layouts/default.liquid | 2 +- .../liquid_error/_layouts/posts.liquid | 4 +- .../_posts/2014-08-24-my-first-blogpost.md | 2 +- .../liquid_escaped/_layouts/default.liquid | 4 +- .../markdown_table/_layouts/default.liquid | 4 +- .../no_extends_error/_layouts/default.liquid | 4 +- .../no_extends_error/_layouts/posts.liquid | 4 +- .../posts/2014-08-24-my-first-blogpost.md | 2 +- .../post_order/_layouts/default.liquid | 4 +- .../fixtures/post_order/_layouts/posts.liquid | 4 +- tests/fixtures/post_order/index.liquid | 2 +- .../post_order/posts/my-first-blogpost.md | 2 +- .../post_order/posts/my-fourth-blogpost.md | 2 +- .../post_order/posts/my-second-blogpost.md | 2 +- .../post_order/posts/my-third-blogpost.md | 2 +- .../posts_in_subfolder/_includes/post.liquid | 6 +- .../_layouts/default.liquid | 8 +- .../fixtures/posts_in_subfolder/index.liquid | 2 +- .../previous_next/_layouts/default.liquid | 4 +- .../previous_next/_layouts/posts.liquid | 4 +- tests/fixtures/previous_next/index.liquid | 2 +- .../posts/2014-08-24-my-first-blogpost.md | 10 +- .../posts/2014-08-25-my-second-blogpost.md | 10 +- .../posts/2014-08-26-my-third-blogpost.md | 10 +- .../querystrings/_layouts/default.liquid | 4 +- .../querystrings/_layouts/posts.liquid | 4 +- tests/fixtures/querystrings/index.liquid | 4 +- .../posts/2014-08-24-my-first-blogpost.md | 2 +- tests/fixtures/rss/_layouts/default.liquid | 4 +- tests/fixtures/rss/_layouts/posts.liquid | 4 +- tests/fixtures/rss/index.liquid | 2 +- tests/fixtures/rss/posts/my-fifth-blogpost.md | 2 +- tests/fixtures/rss/posts/my-first-blogpost.md | 2 +- .../fixtures/rss/posts/my-fourth-blogpost.md | 2 +- .../fixtures/rss/posts/my-second-blogpost.md | 2 +- tests/fixtures/rss/posts/my-third-blogpost.md | 2 +- .../sort_posts/_layouts/default.liquid | 4 +- .../fixtures/sort_posts/_layouts/posts.liquid | 4 +- tests/fixtures/sort_posts/index.liquid | 2 +- .../sort_posts/posts/my-first-blogpost.md | 2 +- .../sort_posts/posts/my-fourth-blogpost.md | 2 +- .../sort_posts/posts/my-second-blogpost.md | 2 +- .../sort_posts/posts/my-third-blogpost.md | 2 +- .../yaml_error/_layouts/default.liquid | 2 +- .../fixtures/yaml_error/_layouts/posts.liquid | 4 +- .../_posts/2014-08-24-my-first-blogpost.md | 2 +- .../posts/2017/01/05/post.html | 1 + .../posts/2017/01/08/post.html | 1 + .../posts/20170103/post.html | 1 + .../target/posts_in_subfolder/posts/post.html | 1 + 136 files changed, 404 insertions(+), 267 deletions(-) diff --git a/src/bin/cobalt/main.rs b/src/bin/cobalt/main.rs index b1679d64..6953f16c 100644 --- a/src/bin/cobalt/main.rs +++ b/src/bin/cobalt/main.rs @@ -64,6 +64,9 @@ extern crate error_chain; #[macro_use] extern crate clap; +#[macro_use] +extern crate lazy_static; + #[macro_use] extern crate log; diff --git a/src/bin/cobalt/migrate.rs b/src/bin/cobalt/migrate.rs index c1f5f947..c8a05e0c 100644 --- a/src/bin/cobalt/migrate.rs +++ b/src/bin/cobalt/migrate.rs @@ -24,7 +24,7 @@ pub fn migrate_command(matches: &clap::ArgMatches) -> Result<()> { let config = args::get_config(matches)?; let config = config.build()?; - migrate_includes(&config)?; + migrate_content(&config)?; migrate_front(&config)?; Ok(()) @@ -72,7 +72,64 @@ fn migrate_includes_path(content: String) -> Result { Ok(content) } -fn migrate_includes(config: &cobalt::Config) -> Result<()> { +fn migrate_variables(content: String) -> Result { + lazy_static!{ + static ref REPLACEMENTS_REF: Vec<(regex::Regex, &'static str)> = vec![ + // From tests + (r#"\{\{\s*title\s*}}"#, "{{ page.title }}"), + (r#"\{\{\s*(.*?)\.path\s*}}"#, "{{ $1.permalink }}"), + (r#"\{\{\s*path\s*}}"#, "{{ page.permalink }}"), + (r#"\{\{\s*content\s*}}"#, "{{ page.content }}"), + (r#"\{\{\s*previous\.(.*?)\s*}}"#, "{{ page.previous.$1 }}"), + (r#"\{\{\s*next\.(.*?)\s*}}"#, "{{ page.next.$1 }}"), + (r#"\{%\s*if\s+is_post\s*%}"#, "{% if page.is_post %}"), + (r#"\{%\s*if\s+previous\s*%}"#, "{% if page.previous %}"), + (r#"\{%\s*if\s+next\s*%}"#, "{% if page.next %}"), + (r#"\{%\s*if\s+draft\s*%}"#, "{% if page.is_draft %}"), + // from johannhof.github.io + (r#"\{\{\s*route\s*}}"#, "{{ page.data.route }}"), + (r#"\{%\s*if\s+route\s*"#, "{% if page.data.route "), + (r#"\{\{\s*date\s*"#, "{{ page.published_date "), + // From blog + (r#"\{\{\s*post\.date\s*"#, "{{ post.published_date "), + // From booyaa.github.io + (r#"\{%\s*assign\s+word_count\s*=\s*content"#, "{% assign word_count = page.content"), + (r#"\{%\s*assign\s+year\s*=\s*post.path"#, "{% assign year = post.permalink"), + (r#"\{%\s*assign\s+tags_list\s*=\s*post.tags"#, "{% assign tags_list = post.data.tags"), + (r#"\{%\s*assign\s+tags\s*=\s*post.tags"#, "{% assign tags = post.data.tags"), + // From deep-blog + (r#"\{%\s*if\s+lang\s*%}"#, "{% if page.data.lang %}"), + (r#"\{\{\s*lang\s*}}"#, "{{ page.data.lang }}"), + (r#"\{%\s*if\s+comments\s*%}"#, "{% if page.data.comments %}"), + (r#"\{%\s*if\s+dsq_thread_id\s*%}"#, "{% if page.data.dsq_thread_id %}"), + (r#"\{\{\s*dsq_thread_id\s*}}"#, "{{ page.data.dsq_thread_id }}"), + (r#"\{%\s*if\s+img_cover\s*%}"#, "{% if page.data.img_cover %}"), + (r#"\{\{\s*img_cover\s*}}"#, "{{ page.data.img_cover }}"), + (r#"\{%\s*if\s+post\.img_cover\s*%}"#, "{% if post.data.img_cover %}"), + (r#"\{\{\s*post\.img_cover\s*}}"#, "{{ post.data.img_cover }}"), + (r#"\{\{\s*post\.author\s*}}"#, "{{ post.data.author }}"), + // fnordig.de + (r#"\{%\s*assign\s+postyear\s*=\s*post.date"#, + "{% assign postyear = post.published_date"), + // hellorust + (r#"\{\{\s*author\s*}}"#, "{{ page.data.author }}"), + // mre + (r#"\{\{\s*title"#, "{{ page.title"), + (r#"\{%\s*if\s+title\s*!=\s*""\s*%}"#, r#"{% if page.title != "" %}"#), + (r#"\{%-\s*if\s+title\s*!=\s*""\s*%}"#, r#"{%- if page.title != "" %}"#), + ].into_iter() + .map(|(r, s)| (regex::Regex::new(r).unwrap(), s)) + .collect(); + } + let content = REPLACEMENTS_REF + .iter() + .fold(content, |content, &(ref search, ref replace)| { + search.replace_all(&content, *replace).into_owned() + }); + Ok(content) +} + +fn migrate_content(config: &cobalt::Config) -> Result<()> { let layouts_dir = config.source.join(config.layouts_dir); let includes_dir = config.source.join(config.includes_dir); info!("Migrating (potential) snippets to {:?}", includes_dir); @@ -102,6 +159,7 @@ fn migrate_includes(config: &cobalt::Config) -> Result<()> { }) { let content = cobalt_model::files::read_file(&file)?; let content = migrate_includes_path(content)?; + let content = migrate_variables(content)?; cobalt_model::files::write_document_file(content, file)?; } @@ -182,4 +240,97 @@ mod tests { let actual = migrate_includes_path(fixture).unwrap(); assert_eq!(expected, actual); } + + #[test] + fn migrate_variables_empty() { + let fixture = r#""#.to_owned(); + let expected = r#""#.to_owned(); + let actual = migrate_variables(fixture).unwrap(); + assert_eq!(expected, actual); + } + + #[test] + fn migrate_variables_title() { + let fixture = r#"

{{ path }}

"#.to_owned(); + let expected = r#"

{{ page.permalink }}

"#.to_owned(); + let actual = migrate_variables(fixture).unwrap(); + assert_eq!(expected, actual); + } + + #[test] + fn migrate_variables_path() { + let fixture = r#"

{{ title }}

"#.to_owned(); + let expected = r#"

{{ page.title }}

"#.to_owned(); + let actual = migrate_variables(fixture).unwrap(); + assert_eq!(expected, actual); + } + + #[test] + fn migrate_variables_content() { + let fixture = r#"

{{ content }}

"#.to_owned(); + let expected = r#"

{{ page.content }}

"#.to_owned(); + let actual = migrate_variables(fixture).unwrap(); + assert_eq!(expected, actual); + } + + #[test] + fn migrate_variables_scoped() { + let fixture = r#"{{ post.title }}"#.to_owned(); + let expected = r#"{{ post.title }}"#.to_owned(); + let actual = migrate_variables(fixture).unwrap(); + assert_eq!(expected, actual); + } + + #[test] + fn migrate_variables_previous() { + let fixture = r#"« {{previous.title}}"#.to_owned(); + let expected = + r#"« {{ page.previous.title }}"# + .to_owned(); + let actual = migrate_variables(fixture).unwrap(); + assert_eq!(expected, actual); + } + + #[test] + fn migrate_variables_next() { + let fixture = r#""# + .to_owned(); + let expected = + r#""# + .to_owned(); + let actual = migrate_variables(fixture).unwrap(); + assert_eq!(expected, actual); + } + + #[test] + fn migrate_variables_if_is_post() { + let fixture = r#"{% if is_post %}"#.to_owned(); + let expected = r#"{% if page.is_post %}"#.to_owned(); + let actual = migrate_variables(fixture).unwrap(); + assert_eq!(expected, actual); + } + + #[test] + fn migrate_variables_if_previous() { + let fixture = r#"{% if previous %}"#.to_owned(); + let expected = r#"{% if page.previous %}"#.to_owned(); + let actual = migrate_variables(fixture).unwrap(); + assert_eq!(expected, actual); + } + + #[test] + fn migrate_variables_if_next() { + let fixture = r#"{% if next %}"#.to_owned(); + let expected = r#"{% if page.next %}"#.to_owned(); + let actual = migrate_variables(fixture).unwrap(); + assert_eq!(expected, actual); + } + + #[test] + fn migrate_variables_if_is_draft() { + let fixture = r#"{% if draft %}"#.to_owned(); + let expected = r#"{% if page.is_draft %}"#.to_owned(); + let actual = migrate_variables(fixture).unwrap(); + assert_eq!(expected, actual); + } } diff --git a/src/cobalt.rs b/src/cobalt.rs index 5b12ce08..19a971bf 100644 --- a/src/cobalt.rs +++ b/src/cobalt.rs @@ -155,25 +155,23 @@ pub fn build(config: &Config) -> Result<()> { files::write_document_file(content, dest.join(file_path))?; } - let mut globals = post.attributes.clone(); - // TODO(epage): Switch `posts` to `parent` which is an object see #323 - globals.insert("posts".to_owned(), - liquid::Value::Array(simple_posts_data.clone())); - globals.insert("site".to_owned(), - liquid::Value::Object(config.site.attributes.clone())); + // Everything done with `globals` is terrible for performance. liquid#95 allows us to + // improve this. + let mut globals: liquid::Object = + vec![("site".to_owned(), liquid::Value::Object(config.site.attributes.clone())), + ("posts".to_owned(), liquid::Value::Array(simple_posts_data.clone()))] + .into_iter() + .collect(); + globals.insert("page".to_owned(), + liquid::Value::Object(post.attributes.clone())); post.render_excerpt(&globals, &parser, &config.syntax_highlight.theme) .chain_err(|| format!("Failed to render excerpt for {:?}", post.file_path))?; post.render_content(&globals, &parser, &config.syntax_highlight.theme) .chain_err(|| format!("Failed to render content for {:?}", post.file_path))?; - // Yes, this is terrible for performance but we need a new `attributes` to get an - // updated `excerpt`. liquid#95 allow us to improve this. - let mut globals = post.attributes.clone(); - // TODO(epage): Switch `posts` to `parent` which is an object see #323 - globals.insert("posts".to_owned(), - liquid::Value::Array(simple_posts_data.clone())); - globals.insert("site".to_owned(), - liquid::Value::Object(config.site.attributes.clone())); + // Refresh `page` with the `excerpt` / `content` attribute + globals.insert("page".to_owned(), + liquid::Value::Object(post.attributes.clone())); let post_html = post.render(&globals, &parser, &layouts, &mut layouts_cache) .chain_err(|| format!("Failed to render for {:?}", post.file_path))?; files::write_document_file(post_html, dest.join(&post.file_path))?; @@ -214,20 +212,16 @@ pub fn build(config: &Config) -> Result<()> { files::write_document_file(content, dest.join(file_path))?; } - let mut globals = doc.attributes.clone(); - // TODO(epage): Switch `posts` to `parent` which is an object see #323 - globals.insert("posts".to_owned(), liquid::Value::Array(posts_data.clone())); - globals.insert("site".to_owned(), - liquid::Value::Object(config.site.attributes.clone())); + let mut globals: liquid::Object = + vec![("site".to_owned(), liquid::Value::Object(config.site.attributes.clone())), + ("posts".to_owned(), liquid::Value::Array(posts_data.clone()))] + .into_iter() + .collect(); + globals.insert("page".to_owned(), + liquid::Value::Object(doc.attributes.clone())); doc.render_content(&globals, &parser, &config.syntax_highlight.theme) .chain_err(|| format!("Failed to render content for {:?}", doc.file_path))?; - let mut globals = doc.attributes.clone(); - // TODO(epage): Switch `posts` to `parent` which is an object see #323 - globals.insert("posts".to_owned(), liquid::Value::Array(posts_data.clone())); - globals.insert("site".to_owned(), - liquid::Value::Object(config.site.attributes.clone())); - // Refresh `page` with the `excerpt` / `content` attribute globals.insert("page".to_owned(), liquid::Value::Object(doc.attributes.clone())); diff --git a/src/document.rs b/src/document.rs index 9f0e623d..2ff30728 100644 --- a/src/document.rs +++ b/src/document.rs @@ -130,39 +130,39 @@ fn format_url_as_file_str(permalink: &str) -> PathBuf { } fn document_attributes(front: &cobalt_model::Frontmatter, - source_file: &str, + source_file: &Path, url_path: &str) -> liquid::Object { - let mut attributes = liquid::Object::new(); + let categories = liquid::Value::Array(front + .categories + .iter() + .map(|c| liquid::Value::str(c)) + .collect()); + // Reason for `file`: + // - Allow access to assets in the original location + // - Ease linking back to page's source + let file: liquid::Object = vec![("permalink".to_owned(), + liquid::Value::str(source_file.to_str().unwrap_or("")))] + .into_iter() + .collect(); + let attributes = + vec![("permalink".to_owned(), liquid::Value::str(url_path)), + ("title".to_owned(), liquid::Value::str(&front.title)), + ("description".to_owned(), + liquid::Value::str(front.description.as_ref().map(|s| s.as_str()).unwrap_or(""))), + ("categories".to_owned(), categories), + ("is_draft".to_owned(), liquid::Value::Bool(front.is_draft)), + ("file".to_owned(), liquid::Value::Object(file)), + ("data".to_owned(), liquid::Value::Object(front.data.clone()))]; + let mut attributes: liquid::Object = attributes.into_iter().collect(); - attributes.insert("path".to_owned(), liquid::Value::str(url_path)); - // TODO(epage): Remove? See #257 - attributes.insert("source".to_owned(), liquid::Value::str(source_file)); - attributes.insert("title".to_owned(), liquid::Value::str(&front.title)); - if let Some(ref description) = front.description { - attributes.insert("description".to_owned(), liquid::Value::str(description)); - } - attributes.insert("categories".to_owned(), - liquid::Value::Array(front - .categories - .iter() - .map(|c| liquid::Value::str(c)) - .collect())); if let Some(ref published_date) = front.published_date { - // TODO(epage): Rename to published_date. See #257 - attributes.insert("date".to_owned(), + attributes.insert("published_date".to_owned(), liquid::Value::Str(published_date.format())); } - // TODO(epage): Rename to `is_draft`. See #257 - attributes.insert("draft".to_owned(), liquid::Value::Bool(front.is_draft)); - // TODO(epage): Remove? See #257 + // TODO(epage): Provide a way to determine tbis attributes.insert("is_post".to_owned(), liquid::Value::Bool(front.is_post)); - // TODO(epage): Place in a `custom` variable. See #257 - for (key, val) in &front.data { - attributes.insert(key.clone(), val.clone()); - } - attributes } @@ -213,8 +213,7 @@ impl Document { (file_path, url_path) }; - let doc_attributes = - document_attributes(&front, rel_path.to_str().unwrap_or(""), url_path.as_ref()); + let doc_attributes = document_attributes(&front, rel_path, url_path.as_ref()); Ok(Document::new(url_path, file_path, @@ -371,8 +370,10 @@ impl Document { Ok(content_html) } else { let content_html = globals - .get("content") - .ok_or("Internal error: content isn't in globals")? + .get("page") + .ok_or("Internal error: page isn't in globals")? + .get(&liquid::Index::with_key("content")) + .ok_or("Internal error: page.content isn't in globals")? .as_str() .ok_or("Internal error: bad content format")? .to_owned(); diff --git a/src/new.rs b/src/new.rs index 2b0464cc..6d48704f 100644 --- a/src/new.rs +++ b/src/new.rs @@ -21,32 +21,17 @@ const DEFAULT_LAYOUT: &'static str = " - {% if is_post %} - {{ title }} - {% else %} - Cobalt.rs Blog - {% endif %} + {{ page.title }}
- {% if is_post %} - {% include '_layouts/post.liquid' %} - {% else %} - {{ content }} - {% endif %} +

{{ page.title }}

+ {{ page.content }}
"; -const POST_LAYOUT: &'static str = "
-

{{ title }}

-

- {{content}} -

-
-"; - const POST_MD: &'static str = "layout: default.liquid title: First Post @@ -65,7 +50,7 @@ const INDEX_MD: &'static str = "layout: default.liquid {% for post in posts %} #### {{post.title}} -#### [{{ post.title }}]({{ post.path }}) +[{{ post.title }}]({{ post.permalink }}) {% endfor %} "; @@ -81,7 +66,6 @@ pub fn create_new_project_for_path(dest: &path::Path) -> Result<()> { fs::create_dir_all(&dest.join("_layouts"))?; create_file(&dest.join("_layouts/default.liquid"), DEFAULT_LAYOUT)?; - create_file(&dest.join("_layouts/post.liquid"), POST_LAYOUT)?; fs::create_dir_all(&dest.join("posts"))?; create_file(&dest.join("posts/post-1.md"), POST_MD)?; diff --git a/tests/cli.rs b/tests/cli.rs index 0d15f2d3..3ddbb738 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -189,7 +189,7 @@ pub fn init_project_can_build() { assert_cli::Assert::command(&[&BIN, "init", "--trace"]) .current_dir(initdir.path()) .unwrap(); - assert_cli::Assert::command(&[&BIN, "build", "--trace", "-d", &dest_param]) + assert_cli::Assert::command(&[&BIN, "build", "--trace", "--drafts", "-d", &dest_param]) .current_dir(initdir.path()) .unwrap(); diff --git a/tests/fixtures/copy_files/_layouts/default.liquid b/tests/fixtures/copy_files/_layouts/default.liquid index 389d5c84..426ae695 100644 --- a/tests/fixtures/copy_files/_layouts/default.liquid +++ b/tests/fixtures/copy_files/_layouts/default.liquid @@ -4,9 +4,9 @@ test -

{{ path }}

+

{{ page.permalink }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/copy_files/_layouts/posts.liquid b/tests/fixtures/copy_files/_layouts/posts.liquid index 46d21c6d..6a21c646 100644 --- a/tests/fixtures/copy_files/_layouts/posts.liquid +++ b/tests/fixtures/copy_files/_layouts/posts.liquid @@ -1,10 +1,10 @@ - My blog - {{ title }} + My blog - {{ page.title }} - {{ content }} + {{ page.content }} diff --git a/tests/fixtures/copy_files/index.liquid b/tests/fixtures/copy_files/index.liquid index c598949c..baf006ca 100644 --- a/tests/fixtures/copy_files/index.liquid +++ b/tests/fixtures/copy_files/index.liquid @@ -3,5 +3,5 @@ layout: default.liquid This is my Index page! {% for post in posts %} - {{ post.title }} + {{ post.title }} {% endfor %} diff --git a/tests/fixtures/copy_files/posts/2014-08-24-my-first-blogpost.md b/tests/fixtures/copy_files/posts/2014-08-24-my-first-blogpost.md index 1c8835b9..0b5f1597 100644 --- a/tests/fixtures/copy_files/posts/2014-08-24-my-first-blogpost.md +++ b/tests/fixtures/copy_files/posts/2014-08-24-my-first-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My first Blogpost published_date: 24 Aug 2014 15:36:20 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/custom_paths/_layouts/default.liquid b/tests/fixtures/custom_paths/_layouts/default.liquid index 389d5c84..426ae695 100644 --- a/tests/fixtures/custom_paths/_layouts/default.liquid +++ b/tests/fixtures/custom_paths/_layouts/default.liquid @@ -4,9 +4,9 @@ test -

{{ path }}

+

{{ page.permalink }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/custom_paths/_layouts/posts.liquid b/tests/fixtures/custom_paths/_layouts/posts.liquid index 2495808b..79e1d743 100644 --- a/tests/fixtures/custom_paths/_layouts/posts.liquid +++ b/tests/fixtures/custom_paths/_layouts/posts.liquid @@ -1,10 +1,10 @@ - My blog - {{ path }} + My blog - {{ page.permalink }} - {{ content }} + {{ page.content }} diff --git a/tests/fixtures/custom_paths/index.liquid b/tests/fixtures/custom_paths/index.liquid index c598949c..baf006ca 100644 --- a/tests/fixtures/custom_paths/index.liquid +++ b/tests/fixtures/custom_paths/index.liquid @@ -3,5 +3,5 @@ layout: default.liquid This is my Index page! {% for post in posts %} - {{ post.title }} + {{ post.title }} {% endfor %} diff --git a/tests/fixtures/custom_paths/no-post.md b/tests/fixtures/custom_paths/no-post.md index 3f7ac2ef..24efb072 100644 --- a/tests/fixtures/custom_paths/no-post.md +++ b/tests/fixtures/custom_paths/no-post.md @@ -4,6 +4,6 @@ title: Custom paths are available to non-posts published_date: 22 Aug 2014 15:36:20 +0100 permalink: /test/hello.html --- -# {{ title }} +# {{ page.title }} This asserts that you can specify custom file paths diff --git a/tests/fixtures/custom_paths/posts/all_date_variables.md b/tests/fixtures/custom_paths/posts/all_date_variables.md index 7802d1f9..68daefcc 100644 --- a/tests/fixtures/custom_paths/posts/all_date_variables.md +++ b/tests/fixtures/custom_paths/posts/all_date_variables.md @@ -4,6 +4,6 @@ title: All date variables published_date: 3 May 2015 01:05:20 +0100 permalink: /{{year}}/{{month}}/{{i_month}}/{{day}}/{{i_day}}/{{hour}}/{{minute}}/{{second}}/ --- -# {{ title }} +# {{ page.title }} This checks that all date variables are interpolated correctly into the path. diff --git a/tests/fixtures/custom_paths/posts/custom-leading-slash.md b/tests/fixtures/custom_paths/posts/custom-leading-slash.md index f2a7c4c4..8369e80b 100644 --- a/tests/fixtures/custom_paths/posts/custom-leading-slash.md +++ b/tests/fixtures/custom_paths/posts/custom-leading-slash.md @@ -4,6 +4,6 @@ title: Custom paths with leading slash published_date: 3 May 2015 02:05:20 +0100 permalink: /test/thing2.html --- -# {{ title }} +# {{ 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/fixtures/custom_paths/posts/custom.md b/tests/fixtures/custom_paths/posts/custom.md index 41639272..fd80f700 100644 --- a/tests/fixtures/custom_paths/posts/custom.md +++ b/tests/fixtures/custom_paths/posts/custom.md @@ -4,6 +4,6 @@ title: Custom paths published_date: 3 May 2015 03:05:20 +0100 permalink: /test/thing.html --- -# {{ title }} +# {{ page.title }} This asserts that you can specify custom file paths diff --git a/tests/fixtures/custom_paths/posts/date_variables.md b/tests/fixtures/custom_paths/posts/date_variables.md index 968086cb..e25042c8 100644 --- a/tests/fixtures/custom_paths/posts/date_variables.md +++ b/tests/fixtures/custom_paths/posts/date_variables.md @@ -6,6 +6,6 @@ permalink: /{{year}}/{{data.thing}}/ data: thing: hello --- -# {{ title }} +# {{ page.title }} This asserts interpolation of date variables and other variables. diff --git a/tests/fixtures/custom_paths/posts/explodes-urls-without-trailing-slash.md b/tests/fixtures/custom_paths/posts/explodes-urls-without-trailing-slash.md index 56e2e94a..8ecb2637 100644 --- a/tests/fixtures/custom_paths/posts/explodes-urls-without-trailing-slash.md +++ b/tests/fixtures/custom_paths/posts/explodes-urls-without-trailing-slash.md @@ -4,6 +4,6 @@ title: Boom without trailing slash published_date: 3 May 2015 05:05:20 +0100 permalink: /test/thing4 --- -# {{ title }} +# {{ 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/fixtures/custom_paths/posts/explodes-urls.md b/tests/fixtures/custom_paths/posts/explodes-urls.md index ca023cfc..e549250e 100644 --- a/tests/fixtures/custom_paths/posts/explodes-urls.md +++ b/tests/fixtures/custom_paths/posts/explodes-urls.md @@ -4,6 +4,6 @@ title: Boom published_date: 3 May 2015 06:05:20 +0100 permalink: /test/thing3/ --- -# {{ title }} +# {{ 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/fixtures/custom_paths/posts/no-path.md b/tests/fixtures/custom_paths/posts/no-path.md index d2239355..fb5463c8 100644 --- a/tests/fixtures/custom_paths/posts/no-path.md +++ b/tests/fixtures/custom_paths/posts/no-path.md @@ -3,6 +3,6 @@ layout: posts.liquid title: Custom paths published_date: 3 May 2015 07:05:20 +0100 --- -# {{ title }} +# {{ page.title }} This asserts that you can have normal and custom file paths side by side. diff --git a/tests/fixtures/custom_paths/posts/variables.md b/tests/fixtures/custom_paths/posts/variables.md index bca9571e..b09d749b 100644 --- a/tests/fixtures/custom_paths/posts/variables.md +++ b/tests/fixtures/custom_paths/posts/variables.md @@ -6,6 +6,6 @@ permalink: /test/{{data.thing}}/ data: thing: hello --- -# {{ title }} +# {{ 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/fixtures/custom_paths/posts/variables_file.md b/tests/fixtures/custom_paths/posts/variables_file.md index 1e0fd6eb..7b8bef1b 100644 --- a/tests/fixtures/custom_paths/posts/variables_file.md +++ b/tests/fixtures/custom_paths/posts/variables_file.md @@ -7,6 +7,6 @@ data: thing: hello thang: world --- -# {{ title }} +# {{ page.title }} This asserts that you can substitute any part of the url with custom variables diff --git a/tests/fixtures/custom_post_path/_layouts/default.liquid b/tests/fixtures/custom_post_path/_layouts/default.liquid index 389d5c84..426ae695 100644 --- a/tests/fixtures/custom_post_path/_layouts/default.liquid +++ b/tests/fixtures/custom_post_path/_layouts/default.liquid @@ -4,9 +4,9 @@ test -

{{ path }}

+

{{ page.permalink }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/custom_post_path/_layouts/posts.liquid b/tests/fixtures/custom_post_path/_layouts/posts.liquid index 46d21c6d..6a21c646 100644 --- a/tests/fixtures/custom_post_path/_layouts/posts.liquid +++ b/tests/fixtures/custom_post_path/_layouts/posts.liquid @@ -1,10 +1,10 @@ - My blog - {{ title }} + My blog - {{ page.title }} - {{ content }} + {{ page.content }} diff --git a/tests/fixtures/custom_post_path/index.liquid b/tests/fixtures/custom_post_path/index.liquid index c598949c..baf006ca 100644 --- a/tests/fixtures/custom_post_path/index.liquid +++ b/tests/fixtures/custom_post_path/index.liquid @@ -3,5 +3,5 @@ layout: default.liquid This is my Index page! {% for post in posts %} - {{ post.title }} + {{ post.title }} {% endfor %} diff --git a/tests/fixtures/custom_post_path/no-post.md b/tests/fixtures/custom_post_path/no-post.md index 5dcc340d..938a7082 100644 --- a/tests/fixtures/custom_post_path/no-post.md +++ b/tests/fixtures/custom_post_path/no-post.md @@ -2,6 +2,6 @@ layout: posts.liquid title: Not a post --- -# {{ title }} +# {{ page.title }} This asserts that post_path does not apply to non-posts diff --git a/tests/fixtures/custom_post_path/posts/my-first-blogpost.md b/tests/fixtures/custom_post_path/posts/my-first-blogpost.md index 20baf0c8..3c39999d 100644 --- a/tests/fixtures/custom_post_path/posts/my-first-blogpost.md +++ b/tests/fixtures/custom_post_path/posts/my-first-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My first Blogpost published_date: 01 Jan 2016 21:00:00 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/custom_post_path/posts/my-fourth-blogpost.md b/tests/fixtures/custom_post_path/posts/my-fourth-blogpost.md index b1a2a7ed..8862f8ab 100644 --- a/tests/fixtures/custom_post_path/posts/my-fourth-blogpost.md +++ b/tests/fixtures/custom_post_path/posts/my-fourth-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My fourth Blogpost published_date: 29 May 2016 23:00:00 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/custom_post_path/posts/my-second-blogpost.md b/tests/fixtures/custom_post_path/posts/my-second-blogpost.md index 9bb47435..745d44c2 100644 --- a/tests/fixtures/custom_post_path/posts/my-second-blogpost.md +++ b/tests/fixtures/custom_post_path/posts/my-second-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My second Blogpost published_date: 02 Jan 2016 10:00:00 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/custom_post_path/posts/my-third-blogpost.md b/tests/fixtures/custom_post_path/posts/my-third-blogpost.md index 7c50e340..4ee5bf70 100644 --- a/tests/fixtures/custom_post_path/posts/my-third-blogpost.md +++ b/tests/fixtures/custom_post_path/posts/my-third-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My third Blogpost published_date: 27 May 2016 23:00:00 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/custom_posts_folder/_layouts/default.liquid b/tests/fixtures/custom_posts_folder/_layouts/default.liquid index 389d5c84..426ae695 100644 --- a/tests/fixtures/custom_posts_folder/_layouts/default.liquid +++ b/tests/fixtures/custom_posts_folder/_layouts/default.liquid @@ -4,9 +4,9 @@ test -

{{ path }}

+

{{ page.permalink }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/custom_posts_folder/_layouts/posts.liquid b/tests/fixtures/custom_posts_folder/_layouts/posts.liquid index 46d21c6d..6a21c646 100644 --- a/tests/fixtures/custom_posts_folder/_layouts/posts.liquid +++ b/tests/fixtures/custom_posts_folder/_layouts/posts.liquid @@ -1,10 +1,10 @@ - My blog - {{ title }} + My blog - {{ page.title }} - {{ content }} + {{ page.content }} diff --git a/tests/fixtures/custom_posts_folder/blog/2014-08-24-my-first-blogpost.md b/tests/fixtures/custom_posts_folder/blog/2014-08-24-my-first-blogpost.md index d8b9e146..35332b4a 100644 --- a/tests/fixtures/custom_posts_folder/blog/2014-08-24-my-first-blogpost.md +++ b/tests/fixtures/custom_posts_folder/blog/2014-08-24-my-first-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My first Blogpost published_date: 24 Aug 2014 09:05:20 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/custom_posts_folder/index.liquid b/tests/fixtures/custom_posts_folder/index.liquid index c598949c..baf006ca 100644 --- a/tests/fixtures/custom_posts_folder/index.liquid +++ b/tests/fixtures/custom_posts_folder/index.liquid @@ -3,5 +3,5 @@ layout: default.liquid This is my Index page! {% for post in posts %} - {{ post.title }} + {{ post.title }} {% endfor %} diff --git a/tests/fixtures/custom_template_extensions/_layouts/default.txt b/tests/fixtures/custom_template_extensions/_layouts/default.txt index 389d5c84..426ae695 100644 --- a/tests/fixtures/custom_template_extensions/_layouts/default.txt +++ b/tests/fixtures/custom_template_extensions/_layouts/default.txt @@ -4,9 +4,9 @@ test -

{{ path }}

+

{{ page.permalink }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/custom_template_extensions/_layouts/posts.exe b/tests/fixtures/custom_template_extensions/_layouts/posts.exe index 46d21c6d..6a21c646 100644 --- a/tests/fixtures/custom_template_extensions/_layouts/posts.exe +++ b/tests/fixtures/custom_template_extensions/_layouts/posts.exe @@ -1,10 +1,10 @@ - My blog - {{ title }} + My blog - {{ page.title }} - {{ content }} + {{ page.content }} diff --git a/tests/fixtures/custom_template_extensions/index.txt b/tests/fixtures/custom_template_extensions/index.txt index 861d75fe..1871c125 100644 --- a/tests/fixtures/custom_template_extensions/index.txt +++ b/tests/fixtures/custom_template_extensions/index.txt @@ -3,5 +3,5 @@ layout: default.txt This is my Index page! {% for post in posts %} - {{ post.title }} + {{ post.title }} {% endfor %} diff --git a/tests/fixtures/custom_template_extensions/posts/2014-08-24-my-first-blogpost.md b/tests/fixtures/custom_template_extensions/posts/2014-08-24-my-first-blogpost.md index f169f2ed..eea7fa50 100644 --- a/tests/fixtures/custom_template_extensions/posts/2014-08-24-my-first-blogpost.md +++ b/tests/fixtures/custom_template_extensions/posts/2014-08-24-my-first-blogpost.md @@ -3,7 +3,7 @@ layout: posts.exe title: My first Blogpost published_date: 24 Aug 2014 15:36:20 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/dotfiles/_layouts/default.liquid b/tests/fixtures/dotfiles/_layouts/default.liquid index 389d5c84..426ae695 100644 --- a/tests/fixtures/dotfiles/_layouts/default.liquid +++ b/tests/fixtures/dotfiles/_layouts/default.liquid @@ -4,9 +4,9 @@ test -

{{ path }}

+

{{ page.permalink }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/dotfiles/_layouts/posts.liquid b/tests/fixtures/dotfiles/_layouts/posts.liquid index 46d21c6d..6a21c646 100644 --- a/tests/fixtures/dotfiles/_layouts/posts.liquid +++ b/tests/fixtures/dotfiles/_layouts/posts.liquid @@ -1,10 +1,10 @@ - My blog - {{ title }} + My blog - {{ page.title }} - {{ content }} + {{ page.content }} diff --git a/tests/fixtures/dotfiles/index.liquid b/tests/fixtures/dotfiles/index.liquid index c598949c..baf006ca 100644 --- a/tests/fixtures/dotfiles/index.liquid +++ b/tests/fixtures/dotfiles/index.liquid @@ -3,5 +3,5 @@ layout: default.liquid This is my Index page! {% for post in posts %} - {{ post.title }} + {{ post.title }} {% endfor %} diff --git a/tests/fixtures/dotfiles/posts/2014-08-24-my-first-blogpost.md b/tests/fixtures/dotfiles/posts/2014-08-24-my-first-blogpost.md index 1c8835b9..0b5f1597 100644 --- a/tests/fixtures/dotfiles/posts/2014-08-24-my-first-blogpost.md +++ b/tests/fixtures/dotfiles/posts/2014-08-24-my-first-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My first Blogpost published_date: 24 Aug 2014 15:36:20 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/drafts/_drafts/a-draft-post.md b/tests/fixtures/drafts/_drafts/a-draft-post.md index 07027d5e..32ab46d9 100644 --- a/tests/fixtures/drafts/_drafts/a-draft-post.md +++ b/tests/fixtures/drafts/_drafts/a-draft-post.md @@ -2,7 +2,7 @@ layout: posts.liquid title: My first draft --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/drafts/_layouts/default.liquid b/tests/fixtures/drafts/_layouts/default.liquid index 389d5c84..426ae695 100644 --- a/tests/fixtures/drafts/_layouts/default.liquid +++ b/tests/fixtures/drafts/_layouts/default.liquid @@ -4,9 +4,9 @@ test -

{{ path }}

+

{{ page.permalink }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/drafts/_layouts/posts.liquid b/tests/fixtures/drafts/_layouts/posts.liquid index 46d21c6d..6a21c646 100644 --- a/tests/fixtures/drafts/_layouts/posts.liquid +++ b/tests/fixtures/drafts/_layouts/posts.liquid @@ -1,10 +1,10 @@ - My blog - {{ title }} + My blog - {{ page.title }} - {{ content }} + {{ page.content }} diff --git a/tests/fixtures/drafts/index.liquid b/tests/fixtures/drafts/index.liquid index c598949c..baf006ca 100644 --- a/tests/fixtures/drafts/index.liquid +++ b/tests/fixtures/drafts/index.liquid @@ -3,5 +3,5 @@ layout: default.liquid This is my Index page! {% for post in posts %} - {{ post.title }} + {{ post.title }} {% endfor %} diff --git a/tests/fixtures/drafts/posts/2014-08-24-my-first-blogpost.md b/tests/fixtures/drafts/posts/2014-08-24-my-first-blogpost.md index 1c8835b9..0b5f1597 100644 --- a/tests/fixtures/drafts/posts/2014-08-24-my-first-blogpost.md +++ b/tests/fixtures/drafts/posts/2014-08-24-my-first-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My first Blogpost published_date: 24 Aug 2014 15:36:20 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/drafts_not_shown_by_default/_drafts/a-draft-post.md b/tests/fixtures/drafts_not_shown_by_default/_drafts/a-draft-post.md index 07027d5e..32ab46d9 100644 --- a/tests/fixtures/drafts_not_shown_by_default/_drafts/a-draft-post.md +++ b/tests/fixtures/drafts_not_shown_by_default/_drafts/a-draft-post.md @@ -2,7 +2,7 @@ layout: posts.liquid title: My first draft --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/drafts_not_shown_by_default/_layouts/default.liquid b/tests/fixtures/drafts_not_shown_by_default/_layouts/default.liquid index 389d5c84..426ae695 100644 --- a/tests/fixtures/drafts_not_shown_by_default/_layouts/default.liquid +++ b/tests/fixtures/drafts_not_shown_by_default/_layouts/default.liquid @@ -4,9 +4,9 @@ test -

{{ path }}

+

{{ page.permalink }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/drafts_not_shown_by_default/_layouts/posts.liquid b/tests/fixtures/drafts_not_shown_by_default/_layouts/posts.liquid index 46d21c6d..6a21c646 100644 --- a/tests/fixtures/drafts_not_shown_by_default/_layouts/posts.liquid +++ b/tests/fixtures/drafts_not_shown_by_default/_layouts/posts.liquid @@ -1,10 +1,10 @@ - My blog - {{ title }} + My blog - {{ page.title }} - {{ content }} + {{ page.content }} diff --git a/tests/fixtures/drafts_not_shown_by_default/index.liquid b/tests/fixtures/drafts_not_shown_by_default/index.liquid index c598949c..baf006ca 100644 --- a/tests/fixtures/drafts_not_shown_by_default/index.liquid +++ b/tests/fixtures/drafts_not_shown_by_default/index.liquid @@ -3,5 +3,5 @@ layout: default.liquid This is my Index page! {% for post in posts %} - {{ post.title }} + {{ post.title }} {% endfor %} diff --git a/tests/fixtures/drafts_not_shown_by_default/posts/2014-08-24-my-first-blogpost.md b/tests/fixtures/drafts_not_shown_by_default/posts/2014-08-24-my-first-blogpost.md index 1c8835b9..0b5f1597 100644 --- a/tests/fixtures/drafts_not_shown_by_default/posts/2014-08-24-my-first-blogpost.md +++ b/tests/fixtures/drafts_not_shown_by_default/posts/2014-08-24-my-first-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My first Blogpost published_date: 24 Aug 2014 15:36:20 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/drafts_not_shown_by_default/posts/this-is-a-draft.md b/tests/fixtures/drafts_not_shown_by_default/posts/this-is-a-draft.md index 70af93dc..e5390f87 100644 --- a/tests/fixtures/drafts_not_shown_by_default/posts/this-is-a-draft.md +++ b/tests/fixtures/drafts_not_shown_by_default/posts/this-is-a-draft.md @@ -3,7 +3,7 @@ layout: posts.liquid title: Another draft is_draft: true --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/empty_frontmatter/_layouts/default.liquid b/tests/fixtures/empty_frontmatter/_layouts/default.liquid index 389d5c84..426ae695 100644 --- a/tests/fixtures/empty_frontmatter/_layouts/default.liquid +++ b/tests/fixtures/empty_frontmatter/_layouts/default.liquid @@ -4,9 +4,9 @@ test -

{{ path }}

+

{{ page.permalink }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/empty_frontmatter/_layouts/posts.liquid b/tests/fixtures/empty_frontmatter/_layouts/posts.liquid index 46d21c6d..6a21c646 100644 --- a/tests/fixtures/empty_frontmatter/_layouts/posts.liquid +++ b/tests/fixtures/empty_frontmatter/_layouts/posts.liquid @@ -1,10 +1,10 @@ - My blog - {{ title }} + My blog - {{ page.title }} - {{ content }} + {{ page.content }} diff --git a/tests/fixtures/empty_frontmatter/index.liquid b/tests/fixtures/empty_frontmatter/index.liquid index c598949c..baf006ca 100644 --- a/tests/fixtures/empty_frontmatter/index.liquid +++ b/tests/fixtures/empty_frontmatter/index.liquid @@ -3,5 +3,5 @@ layout: default.liquid This is my Index page! {% for post in posts %} - {{ post.title }} + {{ post.title }} {% endfor %} diff --git a/tests/fixtures/empty_frontmatter/posts/my-first-blogpost.md b/tests/fixtures/empty_frontmatter/posts/my-first-blogpost.md index a7c2debc..0f93d34e 100644 --- a/tests/fixtures/empty_frontmatter/posts/my-first-blogpost.md +++ b/tests/fixtures/empty_frontmatter/posts/my-first-blogpost.md @@ -1,5 +1,5 @@ --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/example/_layouts/default.liquid b/tests/fixtures/example/_layouts/default.liquid index 389d5c84..426ae695 100644 --- a/tests/fixtures/example/_layouts/default.liquid +++ b/tests/fixtures/example/_layouts/default.liquid @@ -4,9 +4,9 @@ test -

{{ path }}

+

{{ page.permalink }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/example/_layouts/posts.liquid b/tests/fixtures/example/_layouts/posts.liquid index 46d21c6d..6a21c646 100644 --- a/tests/fixtures/example/_layouts/posts.liquid +++ b/tests/fixtures/example/_layouts/posts.liquid @@ -1,10 +1,10 @@ - My blog - {{ title }} + My blog - {{ page.title }} - {{ content }} + {{ page.content }} diff --git a/tests/fixtures/example/index.liquid b/tests/fixtures/example/index.liquid index c598949c..baf006ca 100644 --- a/tests/fixtures/example/index.liquid +++ b/tests/fixtures/example/index.liquid @@ -3,5 +3,5 @@ layout: default.liquid This is my Index page! {% for post in posts %} - {{ post.title }} + {{ post.title }} {% endfor %} diff --git a/tests/fixtures/example/posts/2014-08-24-my-first-blogpost.md b/tests/fixtures/example/posts/2014-08-24-my-first-blogpost.md index 1c8835b9..0b5f1597 100644 --- a/tests/fixtures/example/posts/2014-08-24-my-first-blogpost.md +++ b/tests/fixtures/example/posts/2014-08-24-my-first-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My first Blogpost published_date: 24 Aug 2014 15:36:20 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/excerpts/_includes/post.liquid b/tests/fixtures/excerpts/_includes/post.liquid index e7e7185c..dd52f6d6 100644 --- a/tests/fixtures/excerpts/_includes/post.liquid +++ b/tests/fixtures/excerpts/_includes/post.liquid @@ -1,6 +1,6 @@
-

{{ title }}

+

{{ page.title }}

- {{content}} + {{ page.content }}

diff --git a/tests/fixtures/excerpts/_layouts/default.liquid b/tests/fixtures/excerpts/_layouts/default.liquid index 8aedf5c4..deec3165 100644 --- a/tests/fixtures/excerpts/_layouts/default.liquid +++ b/tests/fixtures/excerpts/_layouts/default.liquid @@ -1,18 +1,18 @@ - {% if is_post %} - {{ title }} + {% if page.is_post %} + {{ page.title }} {% else %} Cobalt.rs Blog {% endif %}
- {% if is_post %} + {% if page.is_post %} {% include 'post.liquid' %} {% else %} - {{ content }} + {{ page.content }} {% endif %}
diff --git a/tests/fixtures/excerpts/index.liquid b/tests/fixtures/excerpts/index.liquid index 4b6fda3e..71e3927a 100644 --- a/tests/fixtures/excerpts/index.liquid +++ b/tests/fixtures/excerpts/index.liquid @@ -7,7 +7,7 @@ layout: default.liquid {% for post in posts %}

{{post.title}}

-

{{ post.title }}

+

{{ post.title }}

{{ post.excerpt }}
{% endfor %} diff --git a/tests/fixtures/hidden_posts_folder/_blog/2014-08-24-my-first-blogpost.md b/tests/fixtures/hidden_posts_folder/_blog/2014-08-24-my-first-blogpost.md index 1c8835b9..0b5f1597 100644 --- a/tests/fixtures/hidden_posts_folder/_blog/2014-08-24-my-first-blogpost.md +++ b/tests/fixtures/hidden_posts_folder/_blog/2014-08-24-my-first-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My first Blogpost published_date: 24 Aug 2014 15:36:20 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/hidden_posts_folder/_layouts/default.liquid b/tests/fixtures/hidden_posts_folder/_layouts/default.liquid index 389d5c84..426ae695 100644 --- a/tests/fixtures/hidden_posts_folder/_layouts/default.liquid +++ b/tests/fixtures/hidden_posts_folder/_layouts/default.liquid @@ -4,9 +4,9 @@ test -

{{ path }}

+

{{ page.permalink }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/hidden_posts_folder/_layouts/posts.liquid b/tests/fixtures/hidden_posts_folder/_layouts/posts.liquid index 46d21c6d..6a21c646 100644 --- a/tests/fixtures/hidden_posts_folder/_layouts/posts.liquid +++ b/tests/fixtures/hidden_posts_folder/_layouts/posts.liquid @@ -1,10 +1,10 @@ - My blog - {{ title }} + My blog - {{ page.title }} - {{ content }} + {{ page.content }} diff --git a/tests/fixtures/hidden_posts_folder/index.liquid b/tests/fixtures/hidden_posts_folder/index.liquid index c598949c..baf006ca 100644 --- a/tests/fixtures/hidden_posts_folder/index.liquid +++ b/tests/fixtures/hidden_posts_folder/index.liquid @@ -3,5 +3,5 @@ layout: default.liquid This is my Index page! {% for post in posts %} - {{ post.title }} + {{ post.title }} {% endfor %} diff --git a/tests/fixtures/ignore_files/_layouts/default.liquid b/tests/fixtures/ignore_files/_layouts/default.liquid index 389d5c84..426ae695 100644 --- a/tests/fixtures/ignore_files/_layouts/default.liquid +++ b/tests/fixtures/ignore_files/_layouts/default.liquid @@ -4,9 +4,9 @@ test -

{{ path }}

+

{{ page.permalink }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/ignore_files/_layouts/posts.liquid b/tests/fixtures/ignore_files/_layouts/posts.liquid index 46d21c6d..6a21c646 100644 --- a/tests/fixtures/ignore_files/_layouts/posts.liquid +++ b/tests/fixtures/ignore_files/_layouts/posts.liquid @@ -1,10 +1,10 @@ - My blog - {{ title }} + My blog - {{ page.title }} - {{ content }} + {{ page.content }} diff --git a/tests/fixtures/ignore_files/index.liquid b/tests/fixtures/ignore_files/index.liquid index c598949c..baf006ca 100644 --- a/tests/fixtures/ignore_files/index.liquid +++ b/tests/fixtures/ignore_files/index.liquid @@ -3,5 +3,5 @@ layout: default.liquid This is my Index page! {% for post in posts %} - {{ post.title }} + {{ post.title }} {% endfor %} diff --git a/tests/fixtures/ignore_files/posts/2014-08-24-my-first-blogpost.md b/tests/fixtures/ignore_files/posts/2014-08-24-my-first-blogpost.md index 1c8835b9..0b5f1597 100644 --- a/tests/fixtures/ignore_files/posts/2014-08-24-my-first-blogpost.md +++ b/tests/fixtures/ignore_files/posts/2014-08-24-my-first-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My first Blogpost published_date: 24 Aug 2014 15:36:20 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/incomplete_rss/_posts/my-first-blogpost.md b/tests/fixtures/incomplete_rss/_posts/my-first-blogpost.md index 5b123b02..657d04b2 100644 --- a/tests/fixtures/incomplete_rss/_posts/my-first-blogpost.md +++ b/tests/fixtures/incomplete_rss/_posts/my-first-blogpost.md @@ -4,7 +4,7 @@ title: My first Blogpost description: It's my first blog post published_date: 01 Jan 2016 21:00:00 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/incomplete_rss/_posts/my-fourth-blogpost.md b/tests/fixtures/incomplete_rss/_posts/my-fourth-blogpost.md index b1a2a7ed..8862f8ab 100644 --- a/tests/fixtures/incomplete_rss/_posts/my-fourth-blogpost.md +++ b/tests/fixtures/incomplete_rss/_posts/my-fourth-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My fourth Blogpost published_date: 29 May 2016 23:00:00 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/incomplete_rss/_posts/my-second-blogpost.md b/tests/fixtures/incomplete_rss/_posts/my-second-blogpost.md index 9bb47435..745d44c2 100644 --- a/tests/fixtures/incomplete_rss/_posts/my-second-blogpost.md +++ b/tests/fixtures/incomplete_rss/_posts/my-second-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My second Blogpost published_date: 02 Jan 2016 10:00:00 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/incomplete_rss/_posts/my-third-blogpost.md b/tests/fixtures/incomplete_rss/_posts/my-third-blogpost.md index 7c50e340..4ee5bf70 100644 --- a/tests/fixtures/incomplete_rss/_posts/my-third-blogpost.md +++ b/tests/fixtures/incomplete_rss/_posts/my-third-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My third Blogpost published_date: 27 May 2016 23:00:00 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/incomplete_rss/index.liquid b/tests/fixtures/incomplete_rss/index.liquid index c598949c..baf006ca 100644 --- a/tests/fixtures/incomplete_rss/index.liquid +++ b/tests/fixtures/incomplete_rss/index.liquid @@ -3,5 +3,5 @@ layout: default.liquid This is my Index page! {% for post in posts %} - {{ post.title }} + {{ post.title }} {% endfor %} diff --git a/tests/fixtures/jsonfeed/_layouts/default.liquid b/tests/fixtures/jsonfeed/_layouts/default.liquid index 389d5c84..426ae695 100644 --- a/tests/fixtures/jsonfeed/_layouts/default.liquid +++ b/tests/fixtures/jsonfeed/_layouts/default.liquid @@ -4,9 +4,9 @@ test -

{{ path }}

+

{{ page.permalink }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/jsonfeed/_layouts/posts.liquid b/tests/fixtures/jsonfeed/_layouts/posts.liquid index 46d21c6d..6a21c646 100644 --- a/tests/fixtures/jsonfeed/_layouts/posts.liquid +++ b/tests/fixtures/jsonfeed/_layouts/posts.liquid @@ -1,10 +1,10 @@ - My blog - {{ title }} + My blog - {{ page.title }} - {{ content }} + {{ page.content }} diff --git a/tests/fixtures/jsonfeed/index.liquid b/tests/fixtures/jsonfeed/index.liquid index c598949c..baf006ca 100644 --- a/tests/fixtures/jsonfeed/index.liquid +++ b/tests/fixtures/jsonfeed/index.liquid @@ -3,5 +3,5 @@ layout: default.liquid This is my Index page! {% for post in posts %} - {{ post.title }} + {{ post.title }} {% endfor %} diff --git a/tests/fixtures/jsonfeed/posts/my-first-blogpost.md b/tests/fixtures/jsonfeed/posts/my-first-blogpost.md index 2391a595..b308a269 100644 --- a/tests/fixtures/jsonfeed/posts/my-first-blogpost.md +++ b/tests/fixtures/jsonfeed/posts/my-first-blogpost.md @@ -5,7 +5,7 @@ description: It's my first blog post published_date: 01 Jan 2016 21:00:00 +0100 categories: [ foo, bar ] --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/jsonfeed/posts/my-second-blogpost.md b/tests/fixtures/jsonfeed/posts/my-second-blogpost.md index bb09e16e..242d36e2 100644 --- a/tests/fixtures/jsonfeed/posts/my-second-blogpost.md +++ b/tests/fixtures/jsonfeed/posts/my-second-blogpost.md @@ -4,7 +4,7 @@ title: My second Blogpost published_date: 02 Jan 2015 10:00:00 +0100 categories: [ foo ] --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/jsonfeed/posts/my-third-blogpost.md b/tests/fixtures/jsonfeed/posts/my-third-blogpost.md index 918c7839..538c218a 100644 --- a/tests/fixtures/jsonfeed/posts/my-third-blogpost.md +++ b/tests/fixtures/jsonfeed/posts/my-third-blogpost.md @@ -4,7 +4,7 @@ title: My third Blogpost published_date: 27 May 2015 23:00:00 +0100 categories: [ foo ] --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/jsonfeed/posts/subdir/my-fifth-blogpost.md b/tests/fixtures/jsonfeed/posts/subdir/my-fifth-blogpost.md index 5defc116..e850c8dd 100644 --- a/tests/fixtures/jsonfeed/posts/subdir/my-fifth-blogpost.md +++ b/tests/fixtures/jsonfeed/posts/subdir/my-fifth-blogpost.md @@ -4,7 +4,7 @@ title: My fifth Blogpost! published_date: 16 Feb 2016 10:00:00 +0100 categories: [ bar ] --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/jsonfeed/posts/subdir/my-fourth-blogpost.md b/tests/fixtures/jsonfeed/posts/subdir/my-fourth-blogpost.md index da3ded10..1b25d856 100644 --- a/tests/fixtures/jsonfeed/posts/subdir/my-fourth-blogpost.md +++ b/tests/fixtures/jsonfeed/posts/subdir/my-fourth-blogpost.md @@ -4,7 +4,7 @@ title: My fourth Blogpost published_date: 29 May 2015 23:00:00 +0100 categories: [ foo ] --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/liquid_error/_layouts/default.liquid b/tests/fixtures/liquid_error/_layouts/default.liquid index 3a750979..654eedcf 100644 --- a/tests/fixtures/liquid_error/_layouts/default.liquid +++ b/tests/fixtures/liquid_error/_layouts/default.liquid @@ -6,7 +6,7 @@

{{ name }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/liquid_error/_layouts/posts.liquid b/tests/fixtures/liquid_error/_layouts/posts.liquid index 46d21c6d..6a21c646 100644 --- a/tests/fixtures/liquid_error/_layouts/posts.liquid +++ b/tests/fixtures/liquid_error/_layouts/posts.liquid @@ -1,10 +1,10 @@ - My blog - {{ title }} + My blog - {{ page.title }} - {{ content }} + {{ page.content }} diff --git a/tests/fixtures/liquid_error/_posts/2014-08-24-my-first-blogpost.md b/tests/fixtures/liquid_error/_posts/2014-08-24-my-first-blogpost.md index 1c8835b9..0b5f1597 100644 --- a/tests/fixtures/liquid_error/_posts/2014-08-24-my-first-blogpost.md +++ b/tests/fixtures/liquid_error/_posts/2014-08-24-my-first-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My first Blogpost published_date: 24 Aug 2014 15:36:20 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/liquid_escaped/_layouts/default.liquid b/tests/fixtures/liquid_escaped/_layouts/default.liquid index 9f2311b4..81214a6a 100644 --- a/tests/fixtures/liquid_escaped/_layouts/default.liquid +++ b/tests/fixtures/liquid_escaped/_layouts/default.liquid @@ -4,9 +4,9 @@ test -

{{ title }}

+

{{ page.title }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/markdown_table/_layouts/default.liquid b/tests/fixtures/markdown_table/_layouts/default.liquid index 389d5c84..426ae695 100644 --- a/tests/fixtures/markdown_table/_layouts/default.liquid +++ b/tests/fixtures/markdown_table/_layouts/default.liquid @@ -4,9 +4,9 @@ test -

{{ path }}

+

{{ page.permalink }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/no_extends_error/_layouts/default.liquid b/tests/fixtures/no_extends_error/_layouts/default.liquid index 389d5c84..426ae695 100644 --- a/tests/fixtures/no_extends_error/_layouts/default.liquid +++ b/tests/fixtures/no_extends_error/_layouts/default.liquid @@ -4,9 +4,9 @@ test -

{{ path }}

+

{{ page.permalink }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/no_extends_error/_layouts/posts.liquid b/tests/fixtures/no_extends_error/_layouts/posts.liquid index 46d21c6d..6a21c646 100644 --- a/tests/fixtures/no_extends_error/_layouts/posts.liquid +++ b/tests/fixtures/no_extends_error/_layouts/posts.liquid @@ -1,10 +1,10 @@ - My blog - {{ title }} + My blog - {{ page.title }} - {{ content }} + {{ page.content }} diff --git a/tests/fixtures/no_extends_error/posts/2014-08-24-my-first-blogpost.md b/tests/fixtures/no_extends_error/posts/2014-08-24-my-first-blogpost.md index 4dd4190d..3196b800 100644 --- a/tests/fixtures/no_extends_error/posts/2014-08-24-my-first-blogpost.md +++ b/tests/fixtures/no_extends_error/posts/2014-08-24-my-first-blogpost.md @@ -1,7 +1,7 @@ title: My first Blogpost published_date: 24 Aug 2014 15:36:20 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/post_order/_layouts/default.liquid b/tests/fixtures/post_order/_layouts/default.liquid index 389d5c84..426ae695 100644 --- a/tests/fixtures/post_order/_layouts/default.liquid +++ b/tests/fixtures/post_order/_layouts/default.liquid @@ -4,9 +4,9 @@ test -

{{ path }}

+

{{ page.permalink }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/post_order/_layouts/posts.liquid b/tests/fixtures/post_order/_layouts/posts.liquid index 46d21c6d..6a21c646 100644 --- a/tests/fixtures/post_order/_layouts/posts.liquid +++ b/tests/fixtures/post_order/_layouts/posts.liquid @@ -1,10 +1,10 @@ - My blog - {{ title }} + My blog - {{ page.title }} - {{ content }} + {{ page.content }} diff --git a/tests/fixtures/post_order/index.liquid b/tests/fixtures/post_order/index.liquid index c598949c..baf006ca 100644 --- a/tests/fixtures/post_order/index.liquid +++ b/tests/fixtures/post_order/index.liquid @@ -3,5 +3,5 @@ layout: default.liquid This is my Index page! {% for post in posts %} - {{ post.title }} + {{ post.title }} {% endfor %} diff --git a/tests/fixtures/post_order/posts/my-first-blogpost.md b/tests/fixtures/post_order/posts/my-first-blogpost.md index 20baf0c8..3c39999d 100644 --- a/tests/fixtures/post_order/posts/my-first-blogpost.md +++ b/tests/fixtures/post_order/posts/my-first-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My first Blogpost published_date: 01 Jan 2016 21:00:00 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/post_order/posts/my-fourth-blogpost.md b/tests/fixtures/post_order/posts/my-fourth-blogpost.md index b1a2a7ed..8862f8ab 100644 --- a/tests/fixtures/post_order/posts/my-fourth-blogpost.md +++ b/tests/fixtures/post_order/posts/my-fourth-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My fourth Blogpost published_date: 29 May 2016 23:00:00 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/post_order/posts/my-second-blogpost.md b/tests/fixtures/post_order/posts/my-second-blogpost.md index 9bb47435..745d44c2 100644 --- a/tests/fixtures/post_order/posts/my-second-blogpost.md +++ b/tests/fixtures/post_order/posts/my-second-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My second Blogpost published_date: 02 Jan 2016 10:00:00 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/post_order/posts/my-third-blogpost.md b/tests/fixtures/post_order/posts/my-third-blogpost.md index 7c50e340..4ee5bf70 100644 --- a/tests/fixtures/post_order/posts/my-third-blogpost.md +++ b/tests/fixtures/post_order/posts/my-third-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My third Blogpost published_date: 27 May 2016 23:00:00 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/posts_in_subfolder/_includes/post.liquid b/tests/fixtures/posts_in_subfolder/_includes/post.liquid index 9ec02187..e9251cc7 100644 --- a/tests/fixtures/posts_in_subfolder/_includes/post.liquid +++ b/tests/fixtures/posts_in_subfolder/_includes/post.liquid @@ -1,8 +1,8 @@
-

{{ title }}

+

{{ page.title }}

- {{ content }} + {{ page.content }}

- \ No newline at end of file + diff --git a/tests/fixtures/posts_in_subfolder/_layouts/default.liquid b/tests/fixtures/posts_in_subfolder/_layouts/default.liquid index e3aee247..4dc4b023 100644 --- a/tests/fixtures/posts_in_subfolder/_layouts/default.liquid +++ b/tests/fixtures/posts_in_subfolder/_layouts/default.liquid @@ -2,18 +2,18 @@ - {% if is_post %} - {{ title }} + {% if page.is_post %} + {{ page.title }} {% else %} Cobalt.rs Blog {% endif %}
- {% if is_post %} + {% if page.is_post %} {% include 'post.liquid' %} {% else %} - {{ content }} + {{ page.content }} {% endif %}
diff --git a/tests/fixtures/posts_in_subfolder/index.liquid b/tests/fixtures/posts_in_subfolder/index.liquid index 49f2b44e..5adb8421 100644 --- a/tests/fixtures/posts_in_subfolder/index.liquid +++ b/tests/fixtures/posts_in_subfolder/index.liquid @@ -9,7 +9,7 @@ layout: default.liquid {% for post in posts %}

{{ post.title }}

-

{{ post.title }}

+

{{ post.title }}

{% endfor %} diff --git a/tests/fixtures/previous_next/_layouts/default.liquid b/tests/fixtures/previous_next/_layouts/default.liquid index 389d5c84..426ae695 100644 --- a/tests/fixtures/previous_next/_layouts/default.liquid +++ b/tests/fixtures/previous_next/_layouts/default.liquid @@ -4,9 +4,9 @@ test -

{{ path }}

+

{{ page.permalink }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/previous_next/_layouts/posts.liquid b/tests/fixtures/previous_next/_layouts/posts.liquid index 46d21c6d..6a21c646 100644 --- a/tests/fixtures/previous_next/_layouts/posts.liquid +++ b/tests/fixtures/previous_next/_layouts/posts.liquid @@ -1,10 +1,10 @@ - My blog - {{ title }} + My blog - {{ page.title }} - {{ content }} + {{ page.content }} diff --git a/tests/fixtures/previous_next/index.liquid b/tests/fixtures/previous_next/index.liquid index c598949c..baf006ca 100644 --- a/tests/fixtures/previous_next/index.liquid +++ b/tests/fixtures/previous_next/index.liquid @@ -3,5 +3,5 @@ layout: default.liquid This is my Index page! {% for post in posts %} - {{ post.title }} + {{ post.title }} {% endfor %} diff --git a/tests/fixtures/previous_next/posts/2014-08-24-my-first-blogpost.md b/tests/fixtures/previous_next/posts/2014-08-24-my-first-blogpost.md index 1c34b642..06901074 100644 --- a/tests/fixtures/previous_next/posts/2014-08-24-my-first-blogpost.md +++ b/tests/fixtures/previous_next/posts/2014-08-24-my-first-blogpost.md @@ -3,15 +3,15 @@ layout: posts.liquid title: My first Blogpost published_date: 24 Aug 2014 15:36:20 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. My Blog is lorem ipsum like, yes it is.. -{% if previous %} - +{% if page.previous %} + {% endif %} - {% if next %} - + {% if page.next %} + {% endif %} diff --git a/tests/fixtures/previous_next/posts/2014-08-25-my-second-blogpost.md b/tests/fixtures/previous_next/posts/2014-08-25-my-second-blogpost.md index 28e7e476..6e3ef98e 100644 --- a/tests/fixtures/previous_next/posts/2014-08-25-my-second-blogpost.md +++ b/tests/fixtures/previous_next/posts/2014-08-25-my-second-blogpost.md @@ -3,15 +3,15 @@ layout: posts.liquid title: My second Blogpost published_date: 25 Aug 2014 15:36:20 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my second blogpost and this is super awesome. My Blog is lorem ipsum like, yes it is.. -{% if previous %} - +{% if page.previous %} + {% endif %} - {% if next %} - + {% if page.next %} + {% endif %} diff --git a/tests/fixtures/previous_next/posts/2014-08-26-my-third-blogpost.md b/tests/fixtures/previous_next/posts/2014-08-26-my-third-blogpost.md index f04440b2..def411be 100644 --- a/tests/fixtures/previous_next/posts/2014-08-26-my-third-blogpost.md +++ b/tests/fixtures/previous_next/posts/2014-08-26-my-third-blogpost.md @@ -3,15 +3,15 @@ layout: posts.liquid title: My third Blogpost published_date: 26 Aug 2014 15:36:20 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my third blogpost and this is super awesome. My Blog is lorem ipsum like, yes it is.. -{% if previous %} - +{% if page.previous %} + {% endif %} - {% if next %} - + {% if page.next %} + {% endif %} diff --git a/tests/fixtures/querystrings/_layouts/default.liquid b/tests/fixtures/querystrings/_layouts/default.liquid index 389d5c84..426ae695 100644 --- a/tests/fixtures/querystrings/_layouts/default.liquid +++ b/tests/fixtures/querystrings/_layouts/default.liquid @@ -4,9 +4,9 @@ test -

{{ path }}

+

{{ page.permalink }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/querystrings/_layouts/posts.liquid b/tests/fixtures/querystrings/_layouts/posts.liquid index 2495808b..79e1d743 100644 --- a/tests/fixtures/querystrings/_layouts/posts.liquid +++ b/tests/fixtures/querystrings/_layouts/posts.liquid @@ -1,10 +1,10 @@ - My blog - {{ path }} + My blog - {{ page.permalink }} - {{ content }} + {{ page.content }} diff --git a/tests/fixtures/querystrings/index.liquid b/tests/fixtures/querystrings/index.liquid index 4c20f804..04cf58e2 100644 --- a/tests/fixtures/querystrings/index.liquid +++ b/tests/fixtures/querystrings/index.liquid @@ -3,9 +3,9 @@ layout: default.liquid This is my Index page! {% for post in posts %} - {{ post.title }} + {{ post.title }} {% endfor %} {% for post in posts %} - {{ post.title }} + {{ post.title }} {% endfor %} diff --git a/tests/fixtures/querystrings/posts/2014-08-24-my-first-blogpost.md b/tests/fixtures/querystrings/posts/2014-08-24-my-first-blogpost.md index cecb3687..f8f4d0a4 100644 --- a/tests/fixtures/querystrings/posts/2014-08-24-my-first-blogpost.md +++ b/tests/fixtures/querystrings/posts/2014-08-24-my-first-blogpost.md @@ -3,6 +3,6 @@ layout: posts.liquid title: Querystrings published_date: 9 May 2017 07:05:20 +0100 --- -# {{ title }} +# {{ page.title }} This asserts that files can be loaded with and without querystrings diff --git a/tests/fixtures/rss/_layouts/default.liquid b/tests/fixtures/rss/_layouts/default.liquid index 389d5c84..426ae695 100644 --- a/tests/fixtures/rss/_layouts/default.liquid +++ b/tests/fixtures/rss/_layouts/default.liquid @@ -4,9 +4,9 @@ test -

{{ path }}

+

{{ page.permalink }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/rss/_layouts/posts.liquid b/tests/fixtures/rss/_layouts/posts.liquid index 46d21c6d..6a21c646 100644 --- a/tests/fixtures/rss/_layouts/posts.liquid +++ b/tests/fixtures/rss/_layouts/posts.liquid @@ -1,10 +1,10 @@ - My blog - {{ title }} + My blog - {{ page.title }} - {{ content }} + {{ page.content }} diff --git a/tests/fixtures/rss/index.liquid b/tests/fixtures/rss/index.liquid index c598949c..baf006ca 100644 --- a/tests/fixtures/rss/index.liquid +++ b/tests/fixtures/rss/index.liquid @@ -3,5 +3,5 @@ layout: default.liquid This is my Index page! {% for post in posts %} - {{ post.title }} + {{ post.title }} {% endfor %} diff --git a/tests/fixtures/rss/posts/my-fifth-blogpost.md b/tests/fixtures/rss/posts/my-fifth-blogpost.md index 88b82d43..a31190bb 100644 --- a/tests/fixtures/rss/posts/my-fifth-blogpost.md +++ b/tests/fixtures/rss/posts/my-fifth-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My fifth Blogpost! published_date: 16 Feb 2016 10:00:00 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/rss/posts/my-first-blogpost.md b/tests/fixtures/rss/posts/my-first-blogpost.md index 5b123b02..657d04b2 100644 --- a/tests/fixtures/rss/posts/my-first-blogpost.md +++ b/tests/fixtures/rss/posts/my-first-blogpost.md @@ -4,7 +4,7 @@ title: My first Blogpost description: It's my first blog post published_date: 01 Jan 2016 21:00:00 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/rss/posts/my-fourth-blogpost.md b/tests/fixtures/rss/posts/my-fourth-blogpost.md index 4b6d8e8c..49adb59c 100644 --- a/tests/fixtures/rss/posts/my-fourth-blogpost.md +++ b/tests/fixtures/rss/posts/my-fourth-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My fourth Blogpost published_date: 29 May 2015 23:00:00 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/rss/posts/my-second-blogpost.md b/tests/fixtures/rss/posts/my-second-blogpost.md index abfdbca6..60c001b7 100644 --- a/tests/fixtures/rss/posts/my-second-blogpost.md +++ b/tests/fixtures/rss/posts/my-second-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My second Blogpost published_date: 02 Jan 2015 10:00:00 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/rss/posts/my-third-blogpost.md b/tests/fixtures/rss/posts/my-third-blogpost.md index 890a16d1..3dbfb4b7 100644 --- a/tests/fixtures/rss/posts/my-third-blogpost.md +++ b/tests/fixtures/rss/posts/my-third-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My third Blogpost published_date: 27 May 2015 23:00:00 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/sort_posts/_layouts/default.liquid b/tests/fixtures/sort_posts/_layouts/default.liquid index 389d5c84..426ae695 100644 --- a/tests/fixtures/sort_posts/_layouts/default.liquid +++ b/tests/fixtures/sort_posts/_layouts/default.liquid @@ -4,9 +4,9 @@ test -

{{ path }}

+

{{ page.permalink }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/sort_posts/_layouts/posts.liquid b/tests/fixtures/sort_posts/_layouts/posts.liquid index 46d21c6d..6a21c646 100644 --- a/tests/fixtures/sort_posts/_layouts/posts.liquid +++ b/tests/fixtures/sort_posts/_layouts/posts.liquid @@ -1,10 +1,10 @@ - My blog - {{ title }} + My blog - {{ page.title }} - {{ content }} + {{ page.content }} diff --git a/tests/fixtures/sort_posts/index.liquid b/tests/fixtures/sort_posts/index.liquid index c598949c..baf006ca 100644 --- a/tests/fixtures/sort_posts/index.liquid +++ b/tests/fixtures/sort_posts/index.liquid @@ -3,5 +3,5 @@ layout: default.liquid This is my Index page! {% for post in posts %} - {{ post.title }} + {{ post.title }} {% endfor %} diff --git a/tests/fixtures/sort_posts/posts/my-first-blogpost.md b/tests/fixtures/sort_posts/posts/my-first-blogpost.md index 20baf0c8..3c39999d 100644 --- a/tests/fixtures/sort_posts/posts/my-first-blogpost.md +++ b/tests/fixtures/sort_posts/posts/my-first-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My first Blogpost published_date: 01 Jan 2016 21:00:00 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/sort_posts/posts/my-fourth-blogpost.md b/tests/fixtures/sort_posts/posts/my-fourth-blogpost.md index b1a2a7ed..8862f8ab 100644 --- a/tests/fixtures/sort_posts/posts/my-fourth-blogpost.md +++ b/tests/fixtures/sort_posts/posts/my-fourth-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My fourth Blogpost published_date: 29 May 2016 23:00:00 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/sort_posts/posts/my-second-blogpost.md b/tests/fixtures/sort_posts/posts/my-second-blogpost.md index 9bb47435..745d44c2 100644 --- a/tests/fixtures/sort_posts/posts/my-second-blogpost.md +++ b/tests/fixtures/sort_posts/posts/my-second-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My second Blogpost published_date: 02 Jan 2016 10:00:00 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/sort_posts/posts/my-third-blogpost.md b/tests/fixtures/sort_posts/posts/my-third-blogpost.md index 7c50e340..4ee5bf70 100644 --- a/tests/fixtures/sort_posts/posts/my-third-blogpost.md +++ b/tests/fixtures/sort_posts/posts/my-third-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My third Blogpost published_date: 27 May 2016 23:00:00 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/fixtures/yaml_error/_layouts/default.liquid b/tests/fixtures/yaml_error/_layouts/default.liquid index 3a750979..654eedcf 100644 --- a/tests/fixtures/yaml_error/_layouts/default.liquid +++ b/tests/fixtures/yaml_error/_layouts/default.liquid @@ -6,7 +6,7 @@

{{ name }}

- {{ content }} + {{ page.content }} diff --git a/tests/fixtures/yaml_error/_layouts/posts.liquid b/tests/fixtures/yaml_error/_layouts/posts.liquid index 46d21c6d..6a21c646 100644 --- a/tests/fixtures/yaml_error/_layouts/posts.liquid +++ b/tests/fixtures/yaml_error/_layouts/posts.liquid @@ -1,10 +1,10 @@ - My blog - {{ title }} + My blog - {{ page.title }} - {{ content }} + {{ page.content }} diff --git a/tests/fixtures/yaml_error/_posts/2014-08-24-my-first-blogpost.md b/tests/fixtures/yaml_error/_posts/2014-08-24-my-first-blogpost.md index 1c8835b9..0b5f1597 100644 --- a/tests/fixtures/yaml_error/_posts/2014-08-24-my-first-blogpost.md +++ b/tests/fixtures/yaml_error/_posts/2014-08-24-my-first-blogpost.md @@ -3,7 +3,7 @@ layout: posts.liquid title: My first Blogpost published_date: 24 Aug 2014 15:36:20 +0100 --- -# {{ title }} +# {{ page.title }} Hey there this is my first blogpost and this is super awesome. diff --git a/tests/target/posts_in_subfolder/posts/2017/01/05/post.html b/tests/target/posts_in_subfolder/posts/2017/01/05/post.html index a74289bd..4b2e2091 100644 --- a/tests/target/posts_in_subfolder/posts/2017/01/05/post.html +++ b/tests/target/posts_in_subfolder/posts/2017/01/05/post.html @@ -19,6 +19,7 @@

a post inside posts/2017/01/05/

+ diff --git a/tests/target/posts_in_subfolder/posts/2017/01/08/post.html b/tests/target/posts_in_subfolder/posts/2017/01/08/post.html index c5c27fad..1f4f56d5 100644 --- a/tests/target/posts_in_subfolder/posts/2017/01/08/post.html +++ b/tests/target/posts_in_subfolder/posts/2017/01/08/post.html @@ -19,6 +19,7 @@

a post inside posts/2017/01/08/

+ diff --git a/tests/target/posts_in_subfolder/posts/20170103/post.html b/tests/target/posts_in_subfolder/posts/20170103/post.html index 1534f9f3..66d3f90f 100644 --- a/tests/target/posts_in_subfolder/posts/20170103/post.html +++ b/tests/target/posts_in_subfolder/posts/20170103/post.html @@ -19,6 +19,7 @@

a post inside posts/20170103/

+ diff --git a/tests/target/posts_in_subfolder/posts/post.html b/tests/target/posts_in_subfolder/posts/post.html index a833e62a..becfbb6e 100644 --- a/tests/target/posts_in_subfolder/posts/post.html +++ b/tests/target/posts_in_subfolder/posts/post.html @@ -19,6 +19,7 @@

a post inside posts

+