bedrock
bedrock copied to clipboard
Add the link to the current template in github back to the footer
We used to have this and the code to do it is still in bedrock. Most pages should have a template context variable called template_source_url. It will be a URL directly to the currently in-use template in Github so that it can be studied or edited.
We'll also probably end up using a similar technique to add a link to the translation file(s) for the page.
I'm poking through issues trying to find a few to take, this seems interesting but I'm not sure I have all the context I need to run with it. You mentioned that we use to have this functionality, you have a link handy to an example?
The intent here is to have a link in the footer of each page that points to its source in Github?
We should run changes to the footer past @dzingeek before making them.
Also, I believe it was removed because of a bug of some kind, so we should make sure that is resolved before adding it back.
@stephaniehobson can you point me to the bug or issue about the problem with it? I think it's important we have this on the site.
I'm sorry, I don't have time to do a bug hunt right now but if this issue is assigned priority that is work that the assignee should do before starting coding.
https://github.com/mozilla/bedrock/issues/6162 -- This is somewhat related, at least it is something that we maybe should think about before putting the link back in. Not sure if it had been solved for later, I didn't find anything that suggests that it was.
Can someone take a screenshot or something of what this is referring to? I looked at the old footer (before the update) and don't see anything pointing to a github template..unless I am just missing it.
I found a copy of it on Wayback Machine

here is the link: https://web.archive.org/web/20180903014354/https://www.mozilla.org/en-US/
perfect! thanks @Errolyn.
a few other questions while I think about how we might add it back to the footer if/when the bug is fixed.
- is this on every page?
- is the main user of this a dev (assuming so but want to ask anyway)
- would a github icon be enough or do we need to call it out "source code for this page"?
is this on every page?
most pages. we have a list of templates that should not get the link which are mostly pages that the content is primarily from the database and not in the template.
https://github.com/mozilla/bedrock/blob/f56fb567a61d1ef43ca3222c122a2c1dd52feec0/bedrock/settings/base.py#L138-L153
- is the main user of this a dev (assuming so but want to ask anyway)
Most likely, but it could also just be anyone curious or someone wishing to find and fix a typo.
would a github icon be enough or do we need to call it out "source code for this page"?
It's possible just an icon is enough, perhaps with an alt or title attribute with more explanation? I think we have the old string widely translated already.
#6162 -- This is somewhat related, at least it is something that we maybe should think about before putting the link back in. Not sure if it had been solved for later, I didn't find anything that suggests that it was.
Great find @Errolyn ! That is something to think about. It doesn't seem like we've decided on a direction for that. It's pretty rare that this would be a problem due to how infrequently templates are removed, but it would be an issue when we did during the time between the change landing in master and being deployed to prod. I don't think this edge case is worth blocking the feature.
We have the "about this site" page now which covers providing a pathway to GitHub. If that's enough, perhaps we can remove the related code to the old link here and close this out?
I did personally like having a link to the template for the current page in there, but if that's just me then yes, we can kill it.