Skip to content

Commit

Permalink
I768 (#769)
Browse files Browse the repository at this point in the history
* ensuring prepath gets applied properly for redirect pages

* closes #768
  • Loading branch information
tlienart authored Jan 24, 2021
1 parent 67a31f6 commit 7bc9f30
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Franklin"
uuid = "713c75ef-9fc9-4b05-94a9-213340da978e"
authors = ["Thibaut Lienart <[email protected]>"]
version = "0.10.25"
version = "0.10.26"

This comment has been minimized.

Copy link
@tlienart

tlienart Jan 24, 2021

Author Owner

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
2 changes: 1 addition & 1 deletion src/converter/html/functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ function hfun_redirect(params::Vector{String})::String
<!doctype html>
<html>
<head>
<meta http-equiv="refresh" content="0; url=$(locvar(:fd_url))">
<meta http-equiv="refresh" content='0; url="$(locvar(:fd_url))"'>
</head>
</html>
""")
Expand Down
2 changes: 1 addition & 1 deletion src/converter/html/link_fixer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ function fix_links(pg::String)::String
pp = strip(prepath, '/')
ss = SubstitutionString("\\1=\"/$(pp)/")
# replace things that look like href="/..." with href="/$prepath/..."
return replace(pg, r"(src|href|formaction|url)\s*?=\s*?\"\/" => ss)
return replace(pg, r"(src|href|formaction|url)\s*?=\s*?\"?\/" => ss)
end
2 changes: 1 addition & 1 deletion src/manager/dir_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function _out_path(base::String)::String

# add a closing separator to folder path
rbase = joinpath(path(:folder), "") * "_"
outpath = base[nextind(base, length(rbase)):end]
outpath = base[nextind(base, lastindex(rbase)):end]
outpath = joinpath(path(:site), outpath)
else
# path is not a 'special folder'
Expand Down
2 changes: 1 addition & 1 deletion test/integration/hfuns.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<!doctype html>
<html>
<head>
<meta http-equiv="refresh" content="0; url=/foo/index.html">
<meta http-equiv="refresh" content='0; url="/foo/index.html"'>
</head>
</html>"""
end
5 changes: 5 additions & 0 deletions test/utils/folder_structure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ end
out = F.form_output_path(base, file, :md)
@test out == joinpath(F.PATHS[:site], "menu", "page", "index.html")

# issue 768
file = "pagéα.md"
out = F.form_output_path(base, file, :md)
@test out == joinpath(F.PATHS[:site], "menu", "pagéα", "index.html")

# OTHER STUFF
file = "foo.css"
base = F.PATHS[:css]
Expand Down

1 comment on commit 7bc9f30

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/28537

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.10.26 -m "<description of version>" 7bc9f30706793cded7736c193499a4cd960dcfae
git push origin v0.10.26

Please sign in to comment.