From f5c7b440270a581b3967e4896689fdb60702cede Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Fri, 12 Jul 2019 22:55:44 +0200 Subject: [PATCH] Add warning for old style internal link + fix one --- CHANGELOG.md | 1 + components/rendering/src/markdown.rs | 6 ++++++ .../content/documentation/content/image-processing/index.md | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b3da5b0..a8839baf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Update livereload - Add `hard_link_static` config option to hard link things in the static directory instead of copying - Draft pages are not longer rendered +- Add warning for old style internal links since they would still function ## 0.8.0 (2019-06-22) diff --git a/components/rendering/src/markdown.rs b/components/rendering/src/markdown.rs index 342b3683..9325c5cd 100644 --- a/components/rendering/src/markdown.rs +++ b/components/rendering/src/markdown.rs @@ -77,6 +77,12 @@ fn fix_link( if link_type == LinkType::Email { return Ok(link.to_string()); } + + // TODO: remove me in a few versions when people have upgraded + if link.starts_with("./") && link.contains(".md") { + println!("It looks like the link `{}` is using the previous syntax for internal links: start with @/ instead", link); + } + // A few situations here: // - it could be a relative link (starting with `@/`) // - it could be a link to a co-located asset diff --git a/docs/content/documentation/content/image-processing/index.md b/docs/content/documentation/content/image-processing/index.md index 32c95d6b..30aa0e71 100644 --- a/docs/content/documentation/content/image-processing/index.md +++ b/docs/content/documentation/content/image-processing/index.md @@ -150,4 +150,4 @@ Here is the result: ## Get image size Sometimes when building a gallery it is useful to know the dimensions of each asset. You can get this information with -[get_image_metadata](./documentation/templates/overview.md#get-image-metadata) \ No newline at end of file +[get_image_metadata](@/documentation/templates/overview.md#get-image-metadata) \ No newline at end of file