4 ms·
Anybody knows what to do with an SPA that, without js, only displays "loading..." and doesn't generate any preview on any platform (whatsapp, telegram...)? Thi
by the_gipsy 7y ago
Anybody knows what to do with an SPA that, without js, only displays "loading..." and doesn't generate any preview on any platform (whatsapp, telegram...)?
This is for a hobby project, so rewriting it to do server side rendering etc. is not an option.
- sgtfrankieboy 7y agoWell, SSR. Almost all indexing bots (Google, 'Microbrowsers', etc.) will require it or at minimum heavily recommend it. I doubt you will need to rewrite it if you use React or VueJS (or any other big framework) as they have SSR support.
- charliepark 7y agoAssuming you have some sort of control over the root index.html file, write the appropriate `meta` tags in the header there. This article is old, but has a good, illustrated view of what tags do what. https://medium.com/slack-developer-blog/everything-you-ever-wanted-to-know-about-unfurling-but-were-afraid-to-ask-or-how-to-make-your-e64b4bb9254 https://medium.com/slack-developer-blog/everything-you-ever-...
- lucideer 7y ago> This is for a hobby project, so rewriting it to do server side rendering etc. is not an option. Rewrite it to do server side rendering. Sorry if this seems facetious, but if you want it to be accessible, it needs to be server-side rendered. Some crawlers have some (limited) JS-rendering abilities; notably Googlebot; but it's not full. Some crawlers may use a fully-fledged Chrome-headless but latency would make this uncommon. In general, JS-dependent SPAs have always been a terrible terrible idea for anything public facing that needs to be crawled (they're fine for web applications, not for web pages).
- the_gipsy 7y agoSorry I didn't mention: it is a web game. Accessibility without JS is not possible.
- lucideer 7y agoIn that case, JS-only is fine, but presumably you're talking about serving fallback content (bots/crawlers are unlikely to be playing your game)
- the_gipsy 7y agoYea, I will try some better fillers than just "loading...", and the metatags stuff. I also might consider serving some other non-game pages statically, like the leaderboard, user profiles, etc.
- baddox 7y agoSSR is definitely the best bet, but because you say that's not an option, I'm assuming you're just hosting static files without a proper server. In that case, a static site generator might be an option. For React it seems that Gatsby is very popular: https://www.gatsbyjs.org/ https://www.gatsbyjs.org/ Depending on the complexity of your hobby project it might even be feasible to write a simple script that runs node, outputs HTML files for each of your pages, and uploads them to online storage. You might look into GitHub Pages too, although I'm not familiar with its capabilities: https://pages.github.com/ https://pages.github.com/