Skip to content

Commit

Permalink
test resolve_urls with static files
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Jun 26, 2024
1 parent 82ef7d2 commit 3a2988e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
32 changes: 28 additions & 4 deletions tests/__snapshots__/resolve_urls.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ snapshot[`relative_url plugin 1`] = `
"/index.md",
"/other.md",
"/statics",
"/statics/asset.md",
"/statics/robots.txt",
"/tílde-and-eñe.md",
],
Expand All @@ -119,6 +120,11 @@ snapshot[`relative_url plugin 1`] = `

snapshot[`relative_url plugin 2`] = `
[
{
entry: "/statics/asset.md",
flags: [],
outputPath: "/asset.md",
},
{
entry: "/statics/robots.txt",
flags: [],
Expand Down Expand Up @@ -279,7 +285,9 @@ Third article
<a href="/other/?tab=1">url</a>
<a href="/other/#tab-1">url</a>
<a href="/robots.txt">url</a>
<a href="/tilde-and-ene/">url</a></p>
<a href="/tilde-and-ene/">url</a>
<a href="robots.txt">static-file</a>
<a href="/asset.md">static-file</a></p>
</body></html>',
data: {
basename: "index",
Expand All @@ -296,7 +304,9 @@ Third article
<a href="other.md?tab=1">url</a>
<a href="other.md#tab-1">url</a>
<a href="~/statics/robots.txt">url</a>
<a href="t%C3%ADlde-and-e%C3%B1e.md">url</a></p>
<a href="t%C3%ADlde-and-e%C3%B1e.md">url</a>
<a href="robots.txt">static-file</a>
<a href="statics/asset.md">static-file</a></p>
',
content: "<!-- deno-fmt-ignore-file -->
[url](/bar)
Expand All @@ -312,6 +322,8 @@ Third article
[url](other.md#tab-1)
[url](~/statics/robots.txt)
[url](tílde-and-eñe.md)
[static-file](robots.txt)
[static-file](statics/asset.md)
",
date: [],
mergedKeys: [
Expand Down Expand Up @@ -514,6 +526,7 @@ snapshot[`relative_url plugin (without slugify) 1`] = `
"/index.md",
"/other.md",
"/statics",
"/statics/asset.md",
"/statics/robots.txt",
"/tílde-and-eñe.md",
],
Expand All @@ -522,6 +535,11 @@ snapshot[`relative_url plugin (without slugify) 1`] = `
snapshot[`relative_url plugin (without slugify) 2`] = `
[
{
entry: "/statics/asset.md",
flags: [],
outputPath: "/asset.md",
},
{
entry: "/statics/robots.txt",
flags: [],
Expand Down Expand Up @@ -682,7 +700,9 @@ Third article
<a href="/other/?tab=1">url</a>
<a href="/other/#tab-1">url</a>
<a href="/robots.txt">url</a>
<a href="/tílde-and-eñe/">url</a></p>
<a href="/tílde-and-eñe/">url</a>
<a href="robots.txt">static-file</a>
<a href="/asset.md">static-file</a></p>
</body></html>',
data: {
basename: "index",
Expand All @@ -699,7 +719,9 @@ Third article
<a href="other.md?tab=1">url</a>
<a href="other.md#tab-1">url</a>
<a href="~/statics/robots.txt">url</a>
<a href="t%C3%ADlde-and-e%C3%B1e.md">url</a></p>
<a href="t%C3%ADlde-and-e%C3%B1e.md">url</a>
<a href="robots.txt">static-file</a>
<a href="statics/asset.md">static-file</a></p>
',
content: "<!-- deno-fmt-ignore-file -->
[url](/bar)
Expand All @@ -715,6 +737,8 @@ Third article
[url](other.md#tab-1)
[url](~/statics/robots.txt)
[url](tílde-and-eñe.md)
[static-file](robots.txt)
[static-file](statics/asset.md)
",
date: [],
mergedKeys: [
Expand Down
2 changes: 2 additions & 0 deletions tests/assets/resolve_urls/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
[url](other.md#tab-1)
[url](~/statics/robots.txt)
[url](tílde-and-eñe.md)
[static-file](robots.txt)
[static-file](statics/asset.md)
1 change: 1 addition & 0 deletions tests/assets/resolve_urls/statics/asset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This file is copied statically.

0 comments on commit 3a2988e

Please sign in to comment.