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

SEO optimizations #173

Closed
ghost opened this issue Jun 11, 2019 · 14 comments
Closed

SEO optimizations #173

ghost opened this issue Jun 11, 2019 · 14 comments
Labels
enhancement New feature or request

Comments

@ghost
Copy link

ghost commented Jun 11, 2019

As of right now, we don't even have meta descriptions:
the source code for this page https://dev.lemmy.ml/#/post/28664 shows:

<html lang="en">

<head>
	<!-- Required meta tags -->
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
	<link rel="shortcut icon" type="image/svg+xml" href="/static/assets/favicon.svg" />
	<link rel="apple-touch-icon" href="/static/assets/apple-touch-icon.png" />
	<link rel="stylesheet" href="/static/assets/libs/balloon-css/balloon.min.css">
  <script src="/static/assets/libs/sortable/sortable.min.js"></script>
</head>

<body>
	<div id="app"></div>
	<script   type="text/javascript" src="/static/a30a7621-app.js"></script>
</body>

</html>

Crawlers/bots need more info in order to index pages correctly.
We'd need to find the SEO best practices and apply them.
We could use as a guide this: https://backlinko.com/on-page-seo (this is a general purpose article, not everything applies to lemmy, but most of it I'd say)

@dessalines
Copy link
Member

I can add some of these tags, but the most important one, title, is loaded dynamically after the page load, using react router (well actually inferno's router), being a single page web app. So right now I'm dynamically fetching the page title based on where you're routing to, and it changes. I'd need to know how other react / single page web apps handle this.

Obvi since this isn't ever going to have ads or be funded by them, SEO is less important to me than it would be otherwise.

@ghost
Copy link
Author

ghost commented Jun 11, 2019

Obvi since this isn't ever going to have ads or be funded by them, SEO is less important to me than it would be otherwise.

But SEO is not about that. SEO stands for Search Engine Optimization and it is only needed so that search engines (DuckDuckGo, Bing, etc.) can find and crawl a website correctly and rank it accordingly.

@mister-monster
Copy link

Also consider that a user/community needs to be able to prevent their content from being shown in search engines. Reddit has this functionality in account settings.

@dessalines
Copy link
Member

I'm def willing to do it, I just need some expertise from other react routing experts or good articles on the best way to do it.

@dessalines dessalines added the extra: help wanted Extra attention is needed label Jun 19, 2019
@dessalines
Copy link
Member

dup of #155

@dessalines dessalines added type: duplicate This issue or pull request already exists and removed extra: help wanted Extra attention is needed labels Jun 27, 2019
@ghost
Copy link
Author

ghost commented Jun 28, 2019

dup of #155

How? They are 100% not related. The fact that because of JS, source code of pages can't be indexed by crawlers is just one issue/optimization for SEO. But there are many more, like creating a robots.txt file, xml file, etc.. there are many SEO optimizations that a website can make use of.

@dessalines dessalines reopened this Jun 28, 2019
@dessalines
Copy link
Member

PRs welcome.

@gc-o
Copy link

gc-o commented Jul 14, 2019

As far as I know of search engine bots have problems when crawling client-side generated code. So if the server is just sending a plain JS file, crawlers will have problems with it (they will not be able to crawl title, description, etc...) this is the reason why there are applications which do server rendering of React components or why yew is a thing (by recreating a virtual dom like React has already done).

@dessalines
Copy link
Member

I think google can crawl some js sites now, a part of it tho also is the dev instance is using hash routing, IE # in the urls, which crawlers don't support yet. Another thing I'm also going to try out, is turning it into an isomorphic app, so that js won't be fully necessary on first page load, addressed in #155

@gc-o
Copy link

gc-o commented Jul 14, 2019

Yes, an isomorphic app would solve this particular problem but with a Rust back-end how are you going to do that?

The first principle of the isomorphic app is to be able to call renderToString() on the server and send to the client somewhat-rendered components which you cannot do on a Rust back-end without any contrived code.

@dessalines
Copy link
Member

https://infernojs.org/docs/guides/isomorphic

The renderToString would be local, from a node server, express, to the locally running rust instance, and would pull all the data before sending to the client.

@dessalines dessalines added enhancement New feature or request and removed type: duplicate This issue or pull request already exists labels Jul 15, 2019
@dessalines
Copy link
Member

I've recently added the browserrouter which might help with this. Does anyone know of any good SEO tester?

@gc-o
Copy link

gc-o commented Jul 16, 2019

I've recently added the browserrouter which might help with this. Does anyone know of any good SEO tester?

The audits tab of the Chrome console is pretty good.

@dessalines
Copy link
Member

I'll close this but any new SEO related specific things can be re-opened.

eiknat pushed a commit to eiknat/lemmy that referenced this issue Aug 29, 2020
Fix/emoji suggestions

Closes LemmyNet#152, LemmyNet#166, LemmyNet#168, and LemmyNet#173

See merge request chapo-sandbox/lemmy!311
dessalines pushed a commit that referenced this issue Feb 22, 2021
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

3 participants