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

Fixed: Replaced "tildes.net" hard-coded string. #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

interstrange
Copy link

@interstrange interstrange commented Jul 13, 2020

  • In python, this is accomplished by reading from the .ini setting files when needed.
  • In .jinja files, this is accomplished via a global that is set up in tildes/tildes/jinja.py. If not a global, the site-name would have to be passed as a parameter to every macro that needs it. I'm actually fine with this if everyone else is: just means some silly clutter in calling certain macros in jinja. If anything is general enough to be a global, I think "the name of the website" might be it.
  • One string constant needs to be formatted down-stream (tildes/lib/message.py).

Also created constants for the donate and password reset emails, which are tied to the site name.

Fixed #9

* In python, this is accomplised by reading from the .ini setting files.
* In .jinja files, this is accomplished via a global that is set up
  in tildes/tildes/jinja.py. If not a global, the site-name would have
  to be passed as a parameter to every macro that needs it. I think
  'the name of the website' might be general enough to justify a global
  here...
* One string constant needs to be formatted down-stream
  (tildes/lib/message.py).
@Deimos
Copy link
Contributor

Deimos commented Jul 13, 2020

I think the general approach is probably good, but I'd probably suggest:

  • Have separate settings/globals for site_name as well as a second one like domain_name or hostname. Sometimes you'll probably want to say "Tildes" vs. "tildes.net" (for example, the logo/name in the top left of the site), so you'll probably need both.
  • You'll probably just want to completely remove a lot of these usages, or maybe have some kind of setting that toggles them all off for sites that aren't Tildes itself. For example, all of the links to blog.tildes.net probably shouldn't exist at all on a fork of the site, and I don't know if you're planning to run a separate Docs site as well, but there are a lot of links to that as well.

I'll make a commit to the Tildes code that gets rid of that welcome message entirely - it's a bit outdated anyway, and should probably be done in a different way so that it's not in the code like this.

@interstrange
Copy link
Author

interstrange commented Jul 14, 2020

For the first point, you're suggesting(?):

site_name = 'Tildes'
domain_name = 'tildes.net'

Not sure I see why we need both. I thought this change had to do with a potential domain name change for the site, not necessarily changing the name of the project.

For the second point, you mean toggle off links to tildes.net when the site is running in dev mode? Or a fork of the site hypothetically created by someone else down the line? The takeaway seems to be that it would be helpful if links to docs.tildes.net and blog.tildes.net could be toggled of. But for something like the financials/donate page, that just leaves a page with half functionality, since all the links to the docs site are missing. I'm not sure what leaving those pages half functional achieves. Would it not be the responsibility of the person forking to site to ensure that their donation links point somewhere good for them?

@Deimos
Copy link
Contributor

Deimos commented Jul 14, 2020

Here's the commit that removes the welcome message: spectria/tildes@a9d312d

@zorbathut
Copy link
Contributor

Have checked in Deimos's change - sorry, @interstrange, this probably breaks your change a bit.

I think the site_name/domain_name split is being recommended because there's usually a difference between a website's name and a website's domain. In the case of tildes.net, it's a site named "tildes.net" that happens to be hosted on a domain called "tildes.net". But while we're hosted on themotte.org, we're not actually named "themotte.org", we're named The Motte. So we really need those to be configurable independently.

And yeah, I'm not sure what the right solution regarding docs.tildes.net and blog.tildes.net is offhand. Without having looked at the code, I'd say an option to disable the main links (i.e. the bottom page links) would be good, but not try anything really extensive like, say, "leave the donation page up but disable the docs page and then programmatically go through the donation page to remove links to docs"; that's just more trouble than it's worth.

Just "turn these pages off kthx".

I feel like long-term this might make sense to database-ize so that admins can add or change pages within the interface, but this is something I am 100% not worrying about right now.

Let me know if you're blocked on anything further :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Where appropriate, scrub references to tildes.net
3 participants