Open Felienne opened 3 months ago
Note from @ZoomQuiet in #5720 that is relevant here:
Moreover, although using hostnames is simpler and easier to spread than using parameters in terms of URL, we further envision using cn.hedy.org as the official Chinese community. In addition to being able to directly publish all Chinese content on the official website, we also hope to be able to publish information from each community on our own, such as:
- Various activities organized in China cn.hedy/org/events/
- Various notes written for China cn.hedy/org/notes/
- Voice/video/... materials recorded in the Chinese community cn.hedy/org/sources/
- ...
Therefore, official technical cooperation may be required: Use rules such as Nginx to replace all links starting with https://hedy.org/hedy?lang=cn with https://cn.hedy.org/doc, and then point cn.hedy.org to the official Chinese community website we are preparing to release. We generally use the github-pages service to publish, and may need to point the domain name's CNAME to a .github.io domain name.
Just to clarify, the only reason to not do this straight away is that it will be somewhat complex to build, so we need to figure out how to do this properly (such that is can work with existing tools and works for non-technical people too across languages) it is not a matter of not wanting you to have this option.
A very very easy way to get this done quickly is that you setup your own website somewhere (like github pages) and we simply link to it labeling it the official Chinese community site (through something like cn.hedy.org/community) Let me know if that works!
...
A very very easy way to get this done quickly is that you setup your own website somewhere (like github pages) and we simply link to it labeling it the official Chinese community site (through something like cn.hedy.org/community) Let me know if that works!
This is currently feasible,
but for readers, it feels a bit subtle,
For this reason, we may need to purchase domain names such as cnhedy.org
so that readers can feel as close as possible;
of course, linking from the official website to the Chinese community website is an officially recognized behavior, which is absolutely feasible;
please tell us about hedy's decision so that we can grab the domain name in time?
This is currently feasible,
Great, let's explore that path more!
but for readers, it feels a bit subtle,
- just like you originally wanted to visit google.com,
- but suddenly jumped to google.github.io,
- psychologically, you may not trust the new domain name.
Yes, I see! I am sure though that there are methods to keep the original domain name in the address bar while doing a redirect if both domains fiddle with the settings a bit. Can you look into how that could work to increase trust?
@Felienne this is very easy in Nginx:
This example will automatically replace all URLs of cnhedy.github.io with cn.hedy.org.
The following is a specific Nginx configuration example:
server {
listen 80;
server_name cn.hedy.org;
location / {
# forward the request to cnhedy.github.io
proxy_pass https://cnhedy.github.io;
# modify the HTTP header information to point to cn.hedy.org
proxy_set_header Host $host;
proxy_set_header Referer $scheme://$host;
proxy_set_header Origin $scheme://$host;
}
}
Code explanation:
server
block defines a new Nginx server that listens on port 80 and sets server_name
to cn.hedy.org
.location /
block defines how to handle the root path /
.proxy_pass https://cnhedy.github.io;
forwards the request to the cnhedy.github.io
website.proxy_set_header Host $host;
modifies the Host
field in the HTTP request header to point to cn.hedy.org
. This is to ensure that the backend server can correctly identify the requested domain name.proxy_set_header Referer $scheme://$host;
and proxy_set_header Origin $scheme://$host;
modify the Referer
and Origin
fields in the HTTP request header to also point to cn.hedy.org
. This is to ensure that the backend server can correctly identify the source of the request.Effect verification:
Visit cn.hedy.org
in the browser, you should be able to see the content of the cnhedy.github.io
website, but the URL shows cn.hedy.org
.
Check the browser's developer tools, you should be able to see that the Host
, Referer
, and Origin
fields in the HTTP request header have been changed to cn.hedy.org
.
Reference source:
If you configure it on the official website, you need to
PS: The current prototype website is published at:
Because it is published using the github organization repository, there is an extra site/
repository directory.
You can also complete all automatic proxies by referring to the Nginx official documentation; Of course, other modern web servers have this proxy function, and you can refer to the corresponding documentation for configuration;
Thanks for the detailed info! We will discuss this in our next contributors meeting on Tuesday (feel free to drop in if you want/can (2PM CET)
Thanks for the detailed info! We will discuss this in our next contributors meeting on Tuesday (feel free to drop in if you want/can (2PM CET)
i'll try join, but can not make sure now.
thanx for all,
this issue, can usage all others country's community support.
Hello @ZoomQuiet! We were debating about this issue in the last couple of meetings and came to a proposal for you guys!
We can provide you with a HTML template that you can edit as you'd like. The link to access this template would be something like: cn.hedy.org/community In order to edit this template you would upload PRs to our repo which in turn would be approved by us.
Does this proposal work for you?
Hello @ZoomQuiet! We were debating about this issue in the last couple of meetings and came to a proposal for you guys!
We can provide you with a HTML template that you can edit as you'd like. The link to access this template would be something like: cn.hedy.org/community In order to edit this template you would upload PRs to our repo which in turn would be approved by us.
Does this proposal work for you?
No problem, My understanding is:
So, how will such webpages be published? Or should I use my previous solution? Can I use various services like ghithub-pages to publish them in other domain names, After being reviewed by hedy.org, then use a reverse proxy like nginx to forward them to the cn.hedy.org domain name?
No problem, My understanding is:
- 1: The Chinese community can use cn.hedy.org as the domain name to publish community activities and other content other than official documents
- 2: However, it is necessary to use the same webpage template as the official website
No, it still would be our site, so no Ngix redirection required. The subdomain would point to a html file within our repo that will be handled by you.
Can I use various services like ghithub-pages to publish them in other domain names, After being reviewed by hedy.org, then use a reverse proxy like nginx to forward them to the cn.hedy.org domain name?
For sure!
@jpelay
...No, it still would be our site, so no Ngix redirection required. The subdomain would point to a html file within our repo that will be handled by you.
To clarify the details, my current understanding is:
The good news is that we will be allowed to maintain content based on .md through a mechanism similar to github-pages?
So, since git repositories are used, I suggest:
That is, allow the Chinese community to publish a group of pages with structural relationships to each other in the cn.hedy.org domain name, rather than a single page?
@jpelay
...No, it still would be our site, so no Ngix redirection required. The subdomain would point to a html file within our repo that will be handled by you.
To clarify the details, my current understanding is:
- cn.hedy.org will be shared with the Chinese community responsible for the content
- However, there is only one html file that can be freely edited?
The good news is that we will be allowed to maintain content based on .md through a mechanism similar to github-pages?
So, since git repositories are used, I suggest:
- The webpages pointed to by cn.hedy.org are compiled independently through sub-repositories
- In this way, the Chinese community does not have to worry about and maintain the same template files as the main site, and can just write .md
- Furthermore, this can also allow the Chinese community to create different directories for long-term collection and publication of activities and achievements from all over the world
That is, allow the Chinese community to publish a group of pages with structural relationships to each other in the cn.hedy.org domain name, rather than a single page?
Hi @ZoomQuiet!
I understand the question, but just to get things going, can we start with, instead of 1 HTML page, a folder of HTML pages? Than you can indeed make different pages and link to each other, but we don't have to organize subrepos (which will be a large hassle for a lot of languages). Please understand that we have to balance your needs with the option that we will have to maintain it 50 fold.
@jpelay Can you make a demo with a few HTML pages instead of one? If we have a concrete example, the discussion might be eased.
@Felienne Agree, a set of html or a specified folder, are the minimum viable start; However, I want to remind you, how to ensure that the style of the webpages published here is consistent with the official one?
If there is no such requirement, we are used to using Python tools, automatically compiling pure html webpages from markdown, such as MkDocs https://www.mkdocs.org/
@jpelay However, if you want the webpages published by the Chinese community to have the same style as the official website, you may have to provide corresponding conversion tools;
@Felienne Agree, a set of html or a specified folder, are the minimum viable start;
Let's work from there, @jpelay has made a preliminary PR, please check that out: https://github.com/hedyorg/hedy/pull/5814
However, I want to remind you, how to ensure that the style of the webpages published here is consistent with the official one?
They will be served using the same css, so in that sense, it will look and feel the same. Plus we (you) will add new content through PRs, so we as core team can always keep an eye on what thing look like.
If there is no such requirement, we are used to using Python tools, automatically compiling pure html webpages from markdown, such as MkDocs https://www.mkdocs.org/
Yeah, I am sorry but you will have to change your workflow a bit to accommodate this solution, which I know might be annoying but I hope you understand we have many contradicting constraints to work with!
@jpelay However, if you want the webpages published by the Chinese community to have the same style as the official website, you may have to provide corresponding conversion tools;
Here are there there might be a small drift, (ie in terms of what headers to use) and we can live with that. Hope you can too!
In addition to #5720, the Chinese content makes would like to create some additional pages for their content, such as:
I am totally ok with that suggestion, but I am not sure how to practically make that happen, because currently all content exists in all languages and we don’t have support for content only in one language.