-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH Prepare codebase to migrate to GitHub Pages #127
ENH Prepare codebase to migrate to GitHub Pages #127
Conversation
ec5dbe8
to
00ce1cb
Compare
Bumps [twig/twig](https://github.com/twigphp/Twig) from 3.12.0 to 3.14.2. - [Changelog](https://github.com/twigphp/Twig/blob/3.x/CHANGELOG) - [Commits](twigphp/Twig@v3.12.0...v3.14.2) --- updated-dependencies: - dependency-name: twig/twig dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]>
00ce1cb
to
9dffad6
Compare
background-image: url('https://www.silverstripe.com/themes/ssv3/img/banners/page-not-found.gif'); | ||
background-image: url('/images/page-not-found.gif'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was a 404. Nabbed the image from silverstripe.org which uses it for its 404 page too.
<title>Redirecting...</title> | ||
<link rel="canonical" href="https://api.silverstripe.org/{{ default_version }}/index.html" /> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="refresh" content="0;url={{ default_version }}/index.html" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mimics the old .htaccess
redirect
|
||
const url = getRedirectUrl(); | ||
console.log(`Redirecting to ${url}`); | ||
window.location.assign(url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mimics the old lookup.php
logic as much as possible. Most of the code here is just a straight port from the PHP code to JS.
@@ -82,6 +82,7 @@ | |||
'source_dir' => $sc['source_dir'], | |||
'insert_todos' => $sc['insert_todos'], | |||
'base_url' => $sc['base_url'], | |||
'favicon' => '/favicon.ico', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did we not have this until now lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied from the old errors/404.html
page, then modified to:
- Use a
<title>
more consistent with every other page on the site - Redirect to search if it looks like someone was trying to search for a class
- The "home" link uses the default version directly, rather than
/
which would then redirect to the default version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same favicon the docs site uses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The files referenced here don't exist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The files referenced here don't exist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was testing the search functionality, which had to be ported to javascript.
Unfortunately there's no simple way to test it now without either:
a) setting up a js build chain with jest tests
b) setting up end-to-end testing e.g. behat
I'm happy to open a card to do one of those in the future, but for now I'm keen to just get this out so we can publish comms about the alpha and get moving again on CMS 6 stuff
Revert "Merge pull request #127 from creative-commoners/pulls/master/…
I've tested this on my own account in https://guysartorelli.github.io/api.silverstripe.org/
Warning
There are some caveats with the above, which are a result of the hosting being in
https://guysartorelli.github.io/api.silverstripe.org/
instead of directly onhttps://guysartorelli.github.io/
.Crucially, once
api.silverstripe.org
is pointing at the GitHub Pages, these problems should all go away:/<something>
which ends up athttps://guysartorelli.github.io/<something>
instead ofhttps://guysartorelli.github.io/api.silverstripe.org/<something>
api.silverstripe.org
instead of what comes after thatIssue