-
Notifications
You must be signed in to change notification settings - Fork 23
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
Introduce better URL paths / SEO optimization #724
Comments
@frol Please fill out this ticket with more technical details. |
Technical proposal:
The rationale for using devhub.near.page over neardevhub.org is that we dogfood on using NEAR Web4 tech and we don't need to manage any other external services (we just need to extend our devhub contract). Alternatives:
|
Have a look at NEAR-DevHub/neardevhub-contract#111 which resolves 6 of 8 tasks here. |
This PR adds the `web4_get` method to the contract, so that when merged, there will be a website at https://devhub.near.page You can preview it at https://devhublink.testnet.page/ <img width="612" alt="image" src="https://github.com/NEAR-DevHub/neardevhub-contract/assets/9760441/c0457ee5-df36-4549-97c2-a6a1a5fb77b3"> Note that the preview deployment does not have access to content, so it will not be able to display proper content for preview links, which is provided by the contract. A test community "webassemblymusic" is created for the preview deployment, to demonstrate the preview links. You can test it at https://devhublink.testnet.page/community/webassemblymusic. You may also call the preview contract to create proposals and other communities to verify that social media headers are also populated with the content. For now the first part of the part is always mapped to the `page` property, so that e.g. `/proposals` are translated to `/devhub.near/widget/app?page=proposals`. Also the second part translates to `handle` for community ( `/community/webassemblymusic` -> `/devhub.near/widget/app?page=community&handle=webassemblymusic` ), or to `id` for proposal `/proposal/5` -> `/devhub.near/widget/app?page=proposal&id=5` In addition to metadata for social media links, and SEO friendly URLs, the actual content is viewed as well. This is done using [near-bos-webcomponent](NEARBuilders/near-bos-webcomponent#10) which is also used for playwright tests in the DevHub frontend. A PR have also been created there to support the SEO friendly URL paths created here. The `html-escape` crate is added to ensure that descriptions with html tags are escaped for the generated HTML ( to avoid malicious scripts etc ). Examples: - https://devhublink.testnet.page/community/webassemblymusic ( This community is also created in the testnet contract ) - https://devhublink.testnet.page/community/chain-abstraction ( not created in the testnet contract, so metadata is missing, but the content shows ) - https://devhublink.testnet.page/proposal/0 ( Also has a proposal created in the testnet contract ) - https://devhublink.testnet.page/proposal/3 ( not created in the testnet contract, so metadata is missing, but the content shows ) Part of NEAR-DevHub/neardevhub-bos#724 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new `web4` module to handle web requests, dynamically generate HTML content, and encode responses. - Added a public function for fetching web content based on request paths, enhancing user interaction with community and proposal pages. - **Documentation** - Enhanced documentation for new web request handling functionality. - **Dependencies** - Added `html-escape` library to support HTML content generation. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Vlad Frolov <[email protected]>
I believe we can close this as we now have https://devhub.near.page |
Hi @petersalomonsen – it seems like we still don't have short URLs for things like communities: |
Let's create separate issues for these places where it is missing. I've added #882 for this particular case. Also note that it is unfortunately not possible to have the short URLs in the links within the page, since it will not work on the near.social or near.org gateways. These short URLs only work on devhub.near.page, so as long as we use other gateways, we can only provide short URLs through "share link" buttons. |
btw @ori-near we do in fact have the short URL https://devhub.near.page/community/protocol It is just that the "copy link" button does not generate it, so I'll rephrase the new issue according to that. |
Problem
Currently, we don't have easy URL paths for DevHub content. Examples:
This makes it difficult to share links and optimize for SEO indexing.
User Stories
As a user, I want to easily share links on social media platform and have the appropriate meta information displayed (e.g. DevHub image, title, description, etc).
As a DevHub user, I want to easily discover DevHub content on Google (e.g. https://developers.google.com/search/docs/crawling-indexing/special-tags).
Acceptance Criteria
Tasks
The text was updated successfully, but these errors were encountered: