-
Notifications
You must be signed in to change notification settings - Fork 289
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
💻 Proposal for navigating through subdomains, and communities #5814
base: main
Are you sure you want to change the base?
Conversation
We concluded in the meeting that we'd be moving forward with language codes as subdomains, keeping them the same, for example: es.hedy.org, en.hedy.org, zh_hans.hedy.org Regarding the community, we decided that they won't be tied to a subdomain, rather getting a route, in this case the chinese community would be: zh_hans.hedy.org/cn/community This would allow us to have various communities in a single language, for example in Spanish: es.hedy.org/ve/community (for Venezuela) I'll be leaving this PR as is for now, so we can get @ZoomQuiet feedback on the matter. |
Thanks for your comprehensive thinking. I feel that this method can further support more communities, such as:
However, how should this mechanism be used specifically? By submitting PR in the agreed directory? However, how to reuse the style of the corresponding official webpage? For example: We want to create a webpage to comprehensively explain the progress of various affairs of the Chinese community. We hope to use the style of the following webpage: https://hedy.org/for-teachers/manual How to build it based on Markdown? We use tools such as MkDocs, but, That kind of SSG tool is used to generate the entire website, and the available styles are very limited: And customization is not easy; If the Chinese community is allowed to use different styles, That's good, but it looks strange; In short:
It is found that it is an HTML page containing template instructions:
That is to say, this is the front-end template of the hedy system, |
Yes the idea is that by submitting a PR to this repository we can check your changes to it, and the changes made should happen within the folder of your community.
Since the files you are going to submit are part of our website, it will inherit the styles of our page. So you can just write normal articles using
If you see the code I uploaded to this PR, you can see that it contains the same articles you uploaded to your site. So, basically, you could just use a Markdown to HTML converter, and paste that code to the Hedy repository, upload that and you should be good to go.
Because cn is not a language code, the subdomains are meant to set the languages of the page.
Just paste plain HTML to a file within the
Yes exactly! 😄 |
I also find the language code annoying, I really get it but following international standards makes other things a lot easier. And to elaboratie a bit more, not all language communities are also singular countries and vice versa. Dutch (nl) for example is spoken in the Netherlands and also Belgium, they want to share the same Hedy version in terms of content but might have different communities. This way, we can create nl.hedy.org/nl for Dutch in the Netherlands and nl.hedy.org/be for Dutch in Belgium (and potentially also fr.hedy.org/be for the Wallons). In your case it might be a bit annoying, yes, but please remember we want to create a solution that solves this problem at once for many situations. If we create the system of country.hedy.org now for communities (as you suggest) you see how we can no longer maintain our different communities. In the system we envision now, you can also use www.hedy.org/cn but then the site would be in English, which I guess is not what you want (but is a nicer url). |
Maybe we have all forgotten the original purpose.
In other words, the official domain name is a series of powerful, natural, easy to remember, and naturally associated with the brand resources;
In summary, it is still recommended to use the country code as the host name. If there are different language versions, you can further specify them by directory division, for example:
|
I really see that the language codes are not nice, but we need a way to tell Hedy what language to serve (we now do this with ?lang=zh_Hans which is as annoying). So somewhere, we need to somehow encode in the URL what the language is to serve the right one. It can be before or after Hedy, but it needs to go somewhere (ch.hedy.org/zh_Hans or zh_Hans.hedy.org/cn) I think it would be good to recognise that we have different goals here:
As with large projects involving many people, we have to try to find a middle ground. Jesus already propsed redirecting www.hedy.org/cn to zh_Hans.hedy.org/cn, would that be an acceptable middle ground? |
I understand a little bit, where is the deviation of the goal discussed before... In fact, originally at: https://hedy.org/my-profile
This official goal; And the goal that our Chinese community expects has nothing to do with the different language display of the current hedy official content;
That is to say:
In short, expect a community publishing space that can be maintained independently; Accept the official content review/publishing process; |
Yes this is true but then you have an account and it is stored in the database. But I assume that you also want to have people without an account view the site in Chinese, which is why we need a language setting somewhere. We can move forward with the plan as explained above, and we can redirect cn.hedy.org to our internal url, than I think we all have a very workable solution. So in short:
I propose we move this forward, and then see how well it works for everyone. We can always make changes later. |
Agreed:
This is very feasible and usable, |
@jpelay @Felienne
However, I have not seen the main branch contain this directory so far. |
Hi @ZoomQuiet! Indeed these changes are not yet in main, that will happen when we finish and merge this PR. @jpelay can surely give you an estimate on when this will be ready, but because it is a big complex change, it might take a little while. |
@jpelay 3week pass, |
This PR is a proposal showing how the inclussion of these features would look like and the work required to make them work.
Navigation through Subdomains
#5720 suggests an idea for us to be able to navigate through different languages by prefixing the domain with the language code, the example offered there is cn.hedy.org. This is indeed possible as seen in the changes made in
app.py
inside this PR, but it poses some problems:All functions need to be modified. This means that every existing route needs to include the subdomain parameter, otherwise they won't work.
In order for routes without the subdomain prefixed to work, I think we need to add functions for every route to redirect. This happens because after adding the subdomain parameter, if you do put it in the URL Flask will tell you that the URL doesn't exist, like I did in the function
index_test
before adding it, I wasnt able to enter that route.We don't have a code for
cn
, the codes we use for Chinese are zh_Hans and zh_Hant, which don't make up for pretty domain names. Shall we mantain manual subdomains for cases like this, I would assume that cn would redirect to zh_HCommunities
For communities I created a folder inside templates, in this folder would be other subfolders for every community. In this case there would be a mandatory
index.html
file that serves as the home for the community, and then we can add any number of additional HTML files. All of these files would appear in the left hand side in a side pane.