Skip to content

Commit

Permalink
enhance(seo): link technologies in homepage hero (#11877)
Browse files Browse the repository at this point in the history
* enhance(seo): link technologies in homepage hero

* enhance(homepage): generalize link underline on hover

Also, don't underline on focus, as focus already has an outline.
  • Loading branch information
caugner authored Oct 2, 2024
1 parent afa30bc commit 2bce115
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 8 deletions.
5 changes: 0 additions & 5 deletions client/src/homepage/featured-articles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@

a {
color: var(--text-primary);

&:hover,
&:focus {
text-decoration: underline;
}
}
}

Expand Down
28 changes: 26 additions & 2 deletions client/src/homepage/homepage-hero/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import "./index.scss";
import { Search } from "../../ui/molecules/search";
import Mandala from "../../ui/molecules/mandala";
import { useLocale } from "../../hooks";
import { HOMEPAGE_HERO } from "../../telemetry/constants";

export function HomepageHero() {
const locale = useLocale();

return (
<div className="homepage-hero dark">
<section>
Expand All @@ -11,8 +15,28 @@ export function HomepageHero() {
<br /> by Developers
</h1>
<p>
Documenting web technologies, including CSS, HTML, and JavaScript,
since 2005.
Documenting web technologies, including{" "}
<a
href={`/${locale}/docs/Web/CSS`}
data-glean={`${HOMEPAGE_HERO}: css`}
>
CSS
</a>
,{" "}
<a
href={`/${locale}/docs/Web/HTML`}
data-glean={`${HOMEPAGE_HERO}: html`}
>
HTML
</a>
, and{" "}
<a
href={`/${locale}/docs/Web/JavaScript`}
data-glean={`${HOMEPAGE_HERO}: js`}
>
JavaScript
</a>
, since 2005.
</p>
<Search id="hp-search" isHomepageSearch={true} />
</section>
Expand Down
4 changes: 4 additions & 0 deletions client/src/homepage/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@
> *:first-child {
margin-top: 0;
}

a:hover {
text-decoration: underline;
}
}
1 change: 0 additions & 1 deletion client/src/homepage/recent-contributions/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@

&:hover {
color: var(--text-primary);
text-decoration: underline;
}
}

Expand Down
1 change: 1 addition & 0 deletions client/src/telemetry/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,4 @@ export const LANGUAGE = "language";
export const LANGUAGE_REMEMBER = "language_remember";
export const THEME_SWITCHER = "theme_switcher";
export const SURVEY = "survey";
export const HOMEPAGE_HERO = "homepage_hero";

0 comments on commit 2bce115

Please sign in to comment.