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

Update website styling and add Google site verification #408

Merged
merged 13 commits into from
Dec 30, 2022

Conversation

Badbond
Copy link
Member

@Badbond Badbond commented Dec 12, 2022

Extracted from the website branch. Therefore, this is effectively already applied apart from a single selective tweak to which I added a comment.

As review, please make sure I included everything in scope. Considered out of scope:

  • Documentation generation (docgen) from source code using a compiler plugin.
  • Ruby setup built on top of docgen to template the Markdown pages.
  • GitHub workflow changes.

Suggested commit message (feel free to tweak):

Update website styling and assets (#408)

Also credits to @oxkitsune and @japborst as authors for some of these changes.

Comment on lines 1 to 2
// Overrides for Just the Docs, see
// https://github.com/just-the-docs/just-the-docs/blob/main/_sass/support/_variables.scss.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I slightly rephrased this compared to the website branch.

@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

Copy link
Member

@rickie rickie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W.r.t. the favicon, I see we added a new one, should we also delete the other?

Left some comments and suggestions :).

<link rel="stylesheet" href="{{ '/assets/css/just-the-docs-eps-light.css' | relative_url }}"
media="(prefers-color-scheme: light)">
media="(prefers-color-scheme: light)">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These spaces seem a bit weird 👀. Is that because of a formatter?

Copy link
Member Author

@Badbond Badbond Dec 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to have changed during cherry-pick from @oxkitsune's branch to mine. This formatting happens to me as part of IntelliJ formatting (CTRL-ALT-L). Currently no CI formatting/linting is in place for these files, nor could I find any so quickly to run it as a one-off. I'm happy with reverting if you'd like. If we go with IntelliJ formatting for now, I'll remove the space at the last line before /> too (committed).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah let's do IntelliJ formatting for now :).

website/_sass/color_schemes/eps-dark.scss Outdated Show resolved Hide resolved
website/_sass/color_schemes/_variables.scss Outdated Show resolved Hide resolved
website/_includes/head_custom.html Outdated Show resolved Hide resolved
website/README.md Outdated Show resolved Hide resolved
website/_includes/head_custom.html Outdated Show resolved Hide resolved
@@ -1,5 +1,25 @@
footer > img#logo {
// Add support for external anchor icons.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This "style" of writing sounds like an XXX to me. WDYT about changing it to: "Adds support for...". Not sure if that is the right way to go, but maybe it makes more sense 🤔.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think such comments are similar to in-code comments (Java example) which can carry the same mood. It is just a hard-to-explain feeling, but to me the style of 'Adds' is a bit awkward in this context and feels more fitting in JavaDoc-type of comments. 😅 But I'd be happy to change this, but then it should be applied in other places too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could meet in the middle and use /*-style comments here? No strong opinion though. (I agree that the grammar is correct as-is!)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a difference in behavior between //-style and /* style commments, though. // do not get compiled to CSS and /* do end up in the compiled CSS. See SASS documentation. Not sure whether it is worth it while sending more bytes over the line.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL! Agree that we can then leave it as-is.

@rickie rickie requested a review from japborst December 12, 2022 13:34
@Badbond
Copy link
Member Author

Badbond commented Dec 12, 2022

To answer many of your questions @rickie. Many changes originate from @oxkitsune and @japborst in the gdejong/docgen_old branch squashed/cherry-picked in the pdsoels/docgen_final branch (which consolidates even more branches). This docgen-final branch was used as a baseline for the as-we-now-know-it website branch (from which these changes are selectively fetched/filtered).

Edit: However, likely master has changed out-of-sync with those docgen branches in #253. So some changes might effectively revert changes merged directly into master. It will be some effort to time-track for every changed line which came first, so let's go with what we like most.

@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

2 similar comments
@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

Comment on lines 12 to 14
&:first-of-type {
margin-left: 0;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@japborst is this change still necessary? It renders fine without for me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reduces the margins when you have multiple labels. What do you mean with "renders fine"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should be more specific. My human eye can't see the difference.

With:
image

Without:
image

It seems that the lines above with !important override the behavior. Perhaps we should change this entire section to:

.label {
  margin-left: 0 !important;
}

But maybe there is a more proper way to do this such that we don't need !important, but I am no CSS expert either 😅

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed offline, added a commit for this suggestion and updated the comment next to it.

@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@@ -0,0 +1 @@
<!-- This file removes the just-the-docs reference in the nav bar's footer. -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we want to remove it? It's OSS software and don't see why we would remove the reference to it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's what we did on the website branch, I believe because we thought it to be cleaner at the time. I am fine with removing it to give some credits, if others agree.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't recall adding this, but might have just forgotten. Let's add it back.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added back.

Comment on lines 12 to 14
&:first-of-type {
margin-left: 0;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reduces the margins when you have multiple labels. What do you mean with "renders fine"?

@Stephan202
Copy link
Member

The build fails for reasons unrelated to this PR; we should merge #410 first. (I'll review this PR once a few approvals are in, since I'm not an expert on this stuff.)

@Badbond
Copy link
Member Author

Badbond commented Dec 13, 2022

Rebased.

@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@rickie rickie added the documentation A documentation update label Dec 13, 2022
@rickie rickie added this to the 0.7.0 milestone Dec 13, 2022
@Badbond
Copy link
Member Author

Badbond commented Dec 13, 2022

@rickie it seems like we can't delete website/favicon.ico (see build failure). There are still references to it in the generated content. When looking at the sources of https://error-prone.picnic.tech/, I can also see a reference to /favicon.ico as well as /assets/images/favicon.ico in the head. As documented here, the contents of custom_head are appended. So we should either keep it in /website/favicon.ico or ignore this specific link in HTML proofer. WDYT?

@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

1 similar comment
@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@rickie
Copy link
Member

rickie commented Dec 15, 2022

Based on the documentation link, shouldn't we also add type="image/x-icon"> to the favicon line?

So IIUC if we would merge this while it's red, it should turn green after it's on master and an actual link right? So now it will complain because it doesn't exist yet?

@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

Copy link
Member Author

@Badbond Badbond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the documentation link, shouldn't we also add type="image/x-icon"> to the favicon line?

I can't quickly find a clear answer what it is used for, but can't hurt to add. Added it.

So IIUC if we would merge this while it's red, it should turn green after it's on master and an actual link right? So now it will complain because it doesn't exist yet?

As discussed offline, no it probably will not turn green. The reference to /favicon.ico in the head is added by either Jekyll or just-the-docs, our reference to /assets/images/favicon.ico in head_custom is appended to the the head, causing the favicon link to be overwritten. I found no way of removing the former link. As discussed, I now excluded /favicon.ico from validation.

@@ -28,7 +28,7 @@ jobs:
working-directory: ./website
# XXX: Drop `--disable_external true` once we fully adopted the
# "Refaster rules" terminology on our website and in the code.
run: bundle exec htmlproofer --disable_external true --check-external-hash false ./_site
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Execution of htmlproofer will eventually live in a Ruby script instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The favicon.ico should be in the root for best browser support, sorry 😕 The error was actually correct by htmlproofer 😉

See here for more details https://realfavicongenerator.net/faq#why_icons_in_root

Copy link
Member

@rickie rickie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM!

@Badbond Badbond requested a review from japborst December 15, 2022 12:37
Copy link
Member

@japborst japborst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@Badbond
Copy link
Member Author

Badbond commented Dec 15, 2022

As discussed offline, we had the root favicon.ico for supporting browsers which ignore the specific favicon path. I reverted the changes made before and instead drop the one in the assets/images directory, including the head_custom line referring to it.

@Badbond Badbond requested a review from Stephan202 December 15, 2022 12:57
@Badbond
Copy link
Member Author

Badbond commented Dec 15, 2022

Ready for your eyes @Stephan202.

@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@Badbond
Copy link
Member Author

Badbond commented Dec 20, 2022

Rebased.

@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@rickie
Copy link
Member

rickie commented Dec 27, 2022

Rebased.

@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@Stephan202
Copy link
Member

(Didn't forget about this PR; will certainly find a moment in the coming days.)

Copy link
Member

@Stephan202 Stephan202 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased and added a small commit. Left a few questions, and didn't scrutinize the CSS too much, but LGTM :)

@@ -36,6 +42,7 @@ social:
- https://github.com/PicnicSupermarket
- https://twitter.com/picnic
- https://www.linkedin.com/company/picnictechnologies

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd omit this empty line, because the twitter section below is also part of the SEO config mentioned above.

Comment on lines +31 to +35
callouts:
summary:
color: blue
note:
color: grey-dk
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking: this will only be used in the next PR, right?

Copy link
Member Author

@Badbond Badbond Dec 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. All changes in this PR won't be effective on master yet but are (almost all -- cases where we didn't, I tested locally against the website branch) already present on the website branch and therefore deployed. After @rickie's docgen modules, I'll open a PR to move the Ruby templating logic and a subsequent PR to change the GHA logic.

@@ -1,5 +1,25 @@
footer > img#logo {
// Add support for external anchor icons.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could meet in the middle and use /*-style comments here? No strong opinion though. (I agree that the grammar is correct as-is!)

Comment on lines +10 to +14
$grey-dk-000: $grey-lt-000;
$grey-dk-100: $grey-lt-100;
$grey-dk-200: $grey-lt-200;
$grey-dk-250: $grey-lt-200;
$grey-dk-300: $grey-lt-300;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking: only 250 having an "off' mapping is intended?

Copy link
Member Author

@Badbond Badbond Dec 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is based on the colors defined by just-the-docs. I believe the idea was for the summary boxes to be light instead of dark in a dark theme, as otherwise it does not stand out as much. As you can see, the light grays only contain 4 entries instead of 5.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow 😄 (Maybe worth a comment; not sure.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Added a comment 👍.

@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@Badbond Badbond requested a review from Stephan202 December 29, 2022 08:14
@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@github-actions
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

Copy link
Member

@Stephan202 Stephan202 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added one more commit. Updated suggested commit message (IIUC there aren't really asset changes here):

Update website styling and add Google site verification (#408)

@@ -1,5 +1,25 @@
footer > img#logo {
// Add support for external anchor icons.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL! Agree that we can then leave it as-is.

@rickie rickie changed the title Update website styling and assets Update website styling and add Google site verification Dec 30, 2022
@rickie rickie merged commit 601fcf2 into master Dec 30, 2022
@rickie rickie deleted the pdsoels/PSM-1720 branch December 30, 2022 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation A documentation update
Development

Successfully merging this pull request may close these issues.

4 participants