-
Notifications
You must be signed in to change notification settings - Fork 2
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
255: Add anchor links to headings #296
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@erinysong overall this looks great!
The only thing I noticed was when I tested with VoiceOver on the About page's 'What we don't offer' header it read it out as "don T' (dawn tee) instead of 'don't' when I had it read out the url in the url bar. Since we're customizing some of the anchor tags on the FAQ page I wonder if we could write out 'do-not' instead of 'don-t'. Let me know if that's a light lift. Otherwise, looks good to me.
cc @Katherine-Osos in case you have any thoughts on this as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, works well!
@rileyorr Thank you for the feedback and that's a great suggestion on the contraction words! It's a light change from just editing the link name of those specific headers, so I can push a change right now to update those! |
Just pushed an update to our headers with contractions! In case it's helpful to put it here, if we want to customize the URLs for headers, we would format them using the following: Before: Default Header After: Customize Header URL This is the standard way to change URL's in markdown, and the library we use to generate anchor links for our headers also accepts this format to infer that we want to override any default anchor link formatting for a header |
permalink: markdownItAnchor.permalink.headerLink({ | ||
safariReaderFix: true, | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Q) Just out of curiosity, what does this do? I'm unfamiliar with markdownItAnchor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -13,7 +13,7 @@ | |||
- Stay informed about [domain security best practices](../../domains/security). | |||
- Edit information about your contacts or your domain (like changes to your DNS settings) anytime. | |||
|
|||
### What we don’t offer | |||
### What we don’t offer {#what-we-do-not-offer} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
@@ -42,7 +42,7 @@ Avoid using the following in your .gov domain name: | |||
- [Judicial branch federal agencies](#judicial-branch-federal-agencies) | |||
- [Legislative branch federal agencies](#legislative-branch-federal-agencies) | |||
- [Interstate organizations](#interstate-organizations) | |||
- [U.S. states and territories](#u.s.-states-and-territories) | |||
- [U.S. states and territories](#u-s-states-and-territories) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- [U.S. states and territories](#u-s-states-and-territories) | |
- [U.S. states and territories](#us-states-and-territories) |
I would recommend this instead! At least for me, if I had no context of what this link contained, I'd be confused by the dash separator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see your point on this! I think the intention behind this was so that screen readers could properly read U.S. as separate letters but can also see how this might introduce more complex anchor links -- since this got design approval I'm assuming that separating US into u-s is effective, but I can defer to @cisagov/gov-designers on their opinion on this
- [U.S. Senate](#u-s-senate) | ||
- [U.S. House of Representatives](#u-s-house-of-representatives) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- [U.S. Senate](#u-s-senate) | |
- [U.S. House of Representatives](#u-s-house-of-representatives) | |
- [U.S. Senate](#us-senate) | |
- [U.S. House of Representatives](#us-house-of-representatives) |
- [U.S. states and territories](#u.s.-states-and-territories) | ||
- [States and territories: executive branch](#states-and-territories%3A-executive-branch) | ||
- [States and territories: judicial and legislative branches](#states-and-territories%3A-judicial-and-legislative-branches) | ||
- [U.S. states and territories](#u-s-states-and-territories) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- [U.S. states and territories](#u-s-states-and-territories) | |
- [U.S. states and territories](#us-states-and-territories) |
pages/domains/domains_moving.md
Outdated
- [Get familiar with domain security best practices](#get-familiar-with-domain-security-best-practices) | ||
- [Develop a communications plan](#develop-a-communications-plan) | ||
- [Find out if you’re eligible for financial assistance](#find-out-if-you’re-eligible-for-financial-assistance) | ||
- [Find out if you’re eligible for financial assistance](#find-out-if-you-re-eligible-for-financial-assistance) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- [Find out if you’re eligible for financial assistance](#find-out-if-you-re-eligible-for-financial-assistance) | |
- [Find out if you’re eligible for financial assistance](#find-out-if-you-are-eligible-for-financial-assistance) |
(Nitpick) consistency change with what your doing on words like "won't"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch - thank you for the suggestion!
Since most governments in the U.S. operate transparently, it’s usually not difficult to discover information about an organization. Anyone can easily find the names, roles, or email addresses of those employed, or details like official records, budgets, or a tax ID. However, it can be difficult to know whether someone approaching us actually is who they say they are, or that they really represent their purported organization. | ||
|
||
To prevent someone from using public information to impersonate a government or an official, as well as discourage unauthorized individuals or ineligible organizations from requesting a domain, we verify the identity of new domain requestors using Login.gov. Once your identity has been confirmed, we then conduct a manual review to assess whether you actually work for, or on behalf of, a government. | ||
|
||
Login.gov is a secure, government website that adheres to the highest standards in data protection. Most of the data you submit is not stored. You can learn more about the [privacy and security measures](https://login.gov/policy/){.usa-link--external} taken to keep your information safe. | ||
|
||
<span id="subdomain"></span> | ||
## Can I request a name like cityname.state.gov (e.g., detroit.mi.gov)? | ||
## Can I request a name like cityname.state.gov (e.g., detroit.mi.gov)? {#subdomain} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Q) Does the slugify library basically add the {#subdomain}
functionality where you add the element id at the end like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it does! It reads what anchor a user sets in markdown before generating its default slugified anchor and manually set anchors will override the default slugify
/* markdown-it-anchor header link styling */ | ||
h1, | ||
h2, | ||
h3, | ||
h4 { | ||
.header-anchor { | ||
text-decoration-line: none | ||
} | ||
|
||
&:hover { | ||
.header-anchor { | ||
text-decoration-line: underline | ||
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice and simple!
}) | ||
.use(markdownItAnchor,{ | ||
permalink: markdownItAnchor.permalink.headerLink({ | ||
safariReaderFix: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Would we need we need this fix for any other browsers / what was the issue that we ran into for Safari's Reader mode? 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe so! I think this is a temporary fix by the markdownItAnchor devs to address a Safari bug so I hopefully don't anticipate any other browser issues, but good point to keep a look at the library for any other accessibility issues they may find in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Giving approval on caveat of adding in Zander's suggested changes (ie the word contraction consistency, etc).
ETA: Looks like there's also a conflict on pages/help/help_faq.md
as well
Ticket
Resolves #255
Changes
Accessibility
Anchor link text aligns closely with actual header text. Anchor link format matches the same style as MDN and HTTP Archive.
Miscellaneous Notes
Context for reviewers
Setup
Sandbox testing
Anchor links can be tested on pages populating the Help page, About page, and Domains page.
Local testing
Test that the above sandbox testing also succeeds in the local environment.
Code Review Verification Steps
As the original developer, I have
Satisfied acceptance criteria and met development standards
Ensured code standards are met (Original Developer)
Validated user-facing changes (if applicable)
As a code reviewer, I have
Reviewed, tested, and left feedback about the changes
Ensured code standards are met (Code reviewer)
Validated user-facing changes as a developer
New pages have been added to .pa11yci file so that they will be tested with our automated accessibility testing
Checked keyboard navigability
Meets all designs and user flows provided by design/product
Tested general usability, landmarks, page header structure, and links with a screen reader (such as Voiceover or ANDI)
Tested with multiple browsers, the suggestion is to use ones that the developer didn't (check off which ones were used)
(Rarely needed) Tested as both an analyst and applicant user
Note: Multiple code reviewers can share the checklists above, a second reviewers should not make a duplicate checklist
As a designer reviewer, I have
Verified that the changes match the design intention
Validated user-facing changes as a designer
Checked keyboard navigability
Tested general usability, landmarks, page header structure, and links with a screen reader (such as Voiceover or ANDI)
Tested with multiple browsers (check off which ones were used)
(Rarely needed) Tested as both an analyst and applicant user
Screenshots