Skip to content

Comments

Use relative folder paths instead of root paths to fix previews#154

Merged
darsnack merged 3 commits intoFluxML:mainfrom
Saransh-cpp:fix-2
Oct 19, 2022
Merged

Use relative folder paths instead of root paths to fix previews#154
darsnack merged 3 commits intoFluxML:mainfrom
Saransh-cpp:fix-2

Conversation

@Saransh-cpp
Copy link
Member

The complete website right now uses root paths to specify a link, which is messing with the PR previews. The current PR previews worked, but all the URLs redirected users to the original website. This should fix everything up as now Franklin will look in the relative folder instead of picking up the root folders.

This still does not fix blogposts and tutorialposts. This means that if you open up a blog inside of a PR preview, the URL will redirect you to the original website's blog. I don't quite understand how the URL for a particular blog/tutorial is specified within the codebase. The base blog and tutorials page work as expected. Maybe @darsnack can help!

Working demos -

PR Checklist

  • Tests are added
  • Documentation, if applicable

@darsnack
Copy link
Member

GH won't let me comment but this line probably should be

links[i] = isnothing(externallink) ? ("../../" * url * "/") : externallink

@darsnack
Copy link
Member

It's unfortunate that using prepath doesn't automate some of this for us. Basically this means that any links must always be relatively specified (which is a bit annoying).

Co-authored-by: Kyle Daruwalla <daruwalla@wisc.edu>
@Saransh-cpp
Copy link
Member Author

This should work now. The links posted above should be updated with this new change!

It's unfortunate that using prepath doesn't automate some of this for us. Basically this means that any links must always be relatively specified (which is a bit annoying).

Agreed, this is a bit painful. This was the absolute last fix that I tried locally. before this, I tried separating out previews and the website completely, breaking the nested structure, but it did not work. I also tried dynamically changing the base URL but no luck :(

@Saransh-cpp Saransh-cpp changed the title Use folder relative paths instead of root paths to fix previews Use relative folder paths instead of root paths to fix previews Oct 17, 2022
@darsnack darsnack merged commit 4e1bbff into FluxML:main Oct 19, 2022
@darsnack
Copy link
Member

Thanks!

@Saransh-cpp Saransh-cpp deleted the fix-2 branch October 19, 2022 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants