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

Website HTML tweaks #3783

Closed
plroebuck opened this issue Feb 28, 2019 · 3 comments
Closed

Website HTML tweaks #3783

plroebuck opened this issue Feb 28, 2019 · 3 comments
Labels
area: website involving mochajs.org, but not necessarily involving docs good first issue new contributors should look here! semver-patch implementation requires increase of "patch" version number; "bug fixes"

Comments

@plroebuck
Copy link
Contributor

plroebuck commented Feb 28, 2019

Description

"docs/_includes/default.html"

  • Fix <title> (solution courtesy of @XhmikosR)
    <title>{{ title }}</title>
<link rel="icon" href="favicon.ico" />
  • Mocha logo
    • Change the alt attribute to "Mocha logo"
    • Add an id attribute.
    • Migrate width and height attributes to stylesheet
<img
  id="mocha-logo"
  src="/images/mocha-logo.svg"
  alt="Mocha logo" />

"docs/css/style.css"

#mocha-logo {
  width: 192px;
  height: 192px;
}
<span>
  <a href="https://mochajs.org">mochajs.org</a> is licensed under a
  <a rel="license" href="http://creativecommons.org/licenses/by/4.0/"
          >Creative Commons Attribution 4.0 International License</a>.
   <p>
     <em>Last updated: {{ 'now' | date: '%a %b %d %H:%M:%S %Y' }}</em>
  </p>
</span
  • Add "rel=home" protocol for Mocha URL. Append slash ("/") to end of URL.
  <a rel="home" href="https://mochajs.org/">mochajs.org</a> is licensed under a
  • Use "https" protocol for CC license <a> "href" URL
  <a rel="license" href="https://creativecommons.org/licenses/by/4.0/"
          >Creative Commons Attribution 4.0 International License</a>.
  • Convert the<p>/<em> tags with the following <dl> embedding <time>
  <dl class="dl-inline last-modified">
    <dt>Last updated</dt>
    <dd>
      <time
        itemprop="lastModified"
        datetime="{{ 'now' | date: '%Y-%m-%dT%H:%M:%SZ' }}">
              {{ 'now' | date: '%a %b %d %H:%M:%S %Y' }}
      </time>
    </dd>
  </dl>

"docs/css/style.css"

.last-modified {
  font-style: italic;
}
.dl-inline dt, .dl-inline dd {
  display: inline;
  margin: 0;
}
.dl-inline dt:after {
  content: ': ';
}
.dl-inline dd + dt:before {
  content: '';
  display: block;
}
  • Annotate all links to outside URLs with these relations:
<a href="https://apex.sh/ping/" rel="external noopener" target="_blank">

Discussion

@plroebuck plroebuck added semver-patch implementation requires increase of "patch" version number; "bug fixes" good first issue new contributors should look here! area: website involving mochajs.org, but not necessarily involving docs labels Feb 28, 2019
@CDNRae
Copy link

CDNRae commented Feb 28, 2019

Hi! I'd like to tackle this issue if that's okay!

@XhmikosR
Copy link
Contributor

XhmikosR commented Mar 2, 2019

I'd add https://validator.w3.org/nu/?doc=https%3A%2F%2Fmochajs.org%2F and also do some HTML5 hygiene like removing the useless end tags (/> -> >).

Finally, I'd stop inlining the SVGs. Since the website is behind Netlify, it has http/2 so this is not really needed. The current HTML size is 118.9KB after brotli compression, which is way too much.

On the other hand, I'd inline avatars.js before the closing body` tag.

I could have a look, as long as I figure out how local development works :)

@XhmikosR
Copy link
Contributor

XhmikosR commented Mar 2, 2019

OK, I sorted everything out, found an issue when building the docs on Windows too, so I'm gonna submit a few patches.

For the inlining part, I believe it's Netlify's image optimization setting? Or is it something in eleventy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: website involving mochajs.org, but not necessarily involving docs good first issue new contributors should look here! semver-patch implementation requires increase of "patch" version number; "bug fixes"
Projects
None yet
Development

No branches or pull requests

3 participants