Skip to content
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

Static hosting support / SEO #38

Open
3 tasks
Tracked by #31
tom-ricci opened this issue Mar 14, 2022 · 0 comments
Open
3 tasks
Tracked by #31

Static hosting support / SEO #38

tom-ricci opened this issue Mar 14, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@tom-ricci
Copy link
Owner

tom-ricci commented Mar 14, 2022

Basically, static hosting support will look like this:

Users:

  • If users go to the index, nothing major happens. The app loads as normal.
  • If users go to another route, they load the 404 page. The 404 page will also contain the app, and will load the app as normal. We might not even need an index tbh.

Bots:

  • On both the index and 404 pages there will be some content inside the <noscript> tag. See SEO #39 for more details.

Plan:

Octobox will compile files based on each non-dynamic (anything that's not * or : ) route based on their path. Each of these files will be a copy of the compiled root index.html, with their meta tags edited based on exports by each route's source code. For example, if a route exports a title function returning a string, it'll set the title to that string. A meta tag will be set to the default ones based on the package.json's octobox param if no export exists for that tag. Octobox will have the option to compile these files to route/index.html or route/404.html. If there's no exported tags, Octobox will not generate a html file for this page to help optimize the build, and assume the closest index or 404 will load the page.

Octobox will prioritize these routes over static ones. Static routes will be imported from /static relative to source root. /static/static will not be imported into the compiled project as to not overwrite the compiled /static folder housing the bundles.

Octobox should provide meta tag options for robot tags as well.

Octobox should provide an option to have a root 404 if the option to compile files to route/index.html is selected, which is also just a copy of the root index.

Octobox should have an option to override all compilation options and use templates for specific hosting platforms (gh pages = use indexes and root 404, cloudflare = use 404s, vercel, serve, surge, netlify, etc.)

@tom-ricci tom-ricci mentioned this issue Mar 14, 2022
18 tasks
@tom-ricci tom-ricci self-assigned this Mar 14, 2022
@tom-ricci tom-ricci added the bug Something isn't working label Mar 14, 2022
@tom-ricci tom-ricci added this to the v2.0.0 milestone Mar 14, 2022
@tom-ricci tom-ricci changed the title Static file routing with the system currently implemented but with some changes - basically, we'll populate the index with some small filler content for bots, which will then be removed by a script which comes before the react script so bots supporting js will be fine and bots not supporting js will be fine and users wont notice because itll be unloaded instantly. for other routes, we will include a sitemap which maps out the other routes for bots, and when someone goes to a route, the 404 page will be loaded. in that 404 page we will have the same filler as the index page, and the same script to remove it. then, we'll use the same method of rerouting as before, sending people to https://url.tld/?/their_original_route and resolve that on index. since everything beyond that is client side, we can still support 404s even with the 404 page being used as filler Static hosting support Mar 14, 2022
@tom-ricci tom-ricci added enhancement New feature or request and removed bug Something isn't working labels Mar 14, 2022
@tom-ricci tom-ricci changed the title Static hosting support Static hosting support / SEO May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant