Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
22 changes: 15 additions & 7 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@ on: pull_request
jobs:
lint:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.111.1
HUGO_ENV: production
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: recursive

- name: Run linting script
run: ${PWD}/hack/ci/link-check.sh
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js dependencies
run: npm ci
- name: Build with Hugo
run: hugo
Comment on lines +11 to +20
Copy link
Member Author

Choose a reason for hiding this comment

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

Previously we were running Hugo in a container (see hack/ci/link-check.sh) using klakegg/hugo image, but new versions of Hugo are missing. So now we are installing hugo from github releases.

Copy link
Contributor

Choose a reason for hiding this comment

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

I have no particular problem with the idea of shifting the mechanism if we need to, but I see versions up to 0.101.0 available in docker, so the intention was to access versions closer to HEAD (0.113.0) here?

Copy link
Member Author

Choose a reason for hiding this comment

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

@grokspawn this PR updates Hugo to 0.111.1. It was the latest version at the moment of creating of this PR. I'm happy to update it to the latest version once we merge this PR. It should be significantly smaller PR.

As far as I see Hugo doesn't maintain official docker image and klakegg/hugo is maintained by an individual. Despite most likely there is nothing wrong with it - i'm hesitant to use unofficial image.

Copy link
Contributor

Choose a reason for hiding this comment

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

It is pretty popular on GitHub though: https://github.com/klakegg/docker-hugo

Copy link
Member Author

@m1kola m1kola Jun 22, 2023

Choose a reason for hiding this comment

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

@anik120 I mean... This package is also popular - https://www.npmjs.com/package/is-odd. It got 431k downloads each last week. What it basically does is num % 2 == 1. What are you implying?

When there is a choice between a poorly maintained random docker image from the internet vs 2 lines of bash which get an official release artefact... Choice is obvious to me.

- name: Run linting script
run: ${PWD}/hack/ci/link-check.sh
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

public/
resources/
node_modules/
tech-doc-hugo
.hugo_build.lock

### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
Expand Down
4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

14 changes: 11 additions & 3 deletions assets/scss/_docs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
text-decoration: none;
}
}

h5, h6 {
font-size: var(--of--FontSize--xs);
}
Expand All @@ -51,7 +51,7 @@
h1 {
font-size: var(--of--FontSize--lg);
}

@media (min-width: $ov--breakpoint--lg) {
h6 {
font-size: var(--of--FontSize--xs);
Expand All @@ -72,4 +72,12 @@
font-size: var(--of--FontSize--xl);
}
}
}
}

.td-main {
main {
@include media-breakpoint-up(md) {
padding-top: var(--of--spacer--lg);
}
}
}
18 changes: 9 additions & 9 deletions assets/scss/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
position: fixed;
top: 0;
min-height: 71px;
z-index: 10000;
z-index: var(--of--header-main);
display: grid;
grid-template-columns: max-content 1fr max-content;
align-items: center;
grid-template-areas:
"brand search search"
"nav nav nav";

Copy link
Contributor

Choose a reason for hiding this comment

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

There are a LOT of these sprinkled all over, which makes it really hard to focus on the actual changes. Lot of brain power is just needed for filtering out the noise. I'm guessing this is a text editor setting that needs to be fixed

Copy link
Member Author

Choose a reason for hiding this comment

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

@anik120 I agree - people who commit a bunch of spaces at the end of lines should fix their editors :)

In the meantime - git diff upstream/master -w (or --ignore-space-at-eol) should help with that.

Github UI also has a setting for this. I hope this helps.

Screenshot 2023-06-22 at 21 45 23

@media (min-width: $ov--breakpoint--lg) {
display: flex;
align-items: center;
Expand All @@ -21,7 +21,7 @@
grid-area: brand;
display: flex;
margin: var(--of--spacer--sm);

@media (min-width: $ov--breakpoint--lg) {
&__picture {
min-width: 177px;
Expand Down Expand Up @@ -67,10 +67,10 @@
grid-template-columns: 1fr 1fr;
grid-template-rows: min-content min-content;
@media (min-width: $ov--breakpoint--lg) {
display: flex;
margin: 0;
display: flex;
margin: 0;
}

&__li {
@media (min-width: $ov--breakpoint--lg) {
border: none;
Expand All @@ -85,10 +85,10 @@
&:not(:last-of-type):not(:nth-last-child(-n+2)){
border-bottom: none;
}

}
&__a {
width: 100%;
width: 100%;
display: inline-block;
position: relative;
padding: var(--of--spacer--xs) var(--of--spacer--md);
Expand All @@ -106,7 +106,7 @@
// &.has-dropdown {
// grid-area: link;
// }

}
}
}
45 changes: 24 additions & 21 deletions assets/scss/_variables.scss → assets/scss/_of-variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
--of--FontSize--lg: 1.375rem; //22
--of--FontSize--xl: 1.5rem;//24
--of--FontSize--2xl: 2.625rem; //40

//spacers
--of--spacer--xs: .25rem; //4 purple
--of--spacer--sm: .5rem; //8 light blue
Expand All @@ -16,7 +16,7 @@
--of--spacer--xl: 2rem; //32 pink
--of--spacer--2xl: 3rem; //48 blue
--of--spacer--3xl: 4rem; //64 purple

//color
--of--color-brand--50: #b12239;
--of--color-brand--100: #921c2f;
Expand All @@ -33,48 +33,51 @@
--of--color-black--100: #040404;
--of--color-black--200: #202020;
--of--color-black--300: #000;

//transparencies
--of--color-transparent-background--100: rgba(32,32,32,.90);

//borders
--of--BorderWidth--sm: 2px;
--of--BorderWidth--lg: 4px;
--of--BorderRadius--sm: .1875rem;
--of--BorderRadius--md: .75rem;
--of--BorderRadius--lg: 40rem;

//text
--of--Color--100: var(--of--color-white--100);
--of--Color--200: var(--of--color-white--200);
--of--Color--300: var(--of--color-brand--100);
--of--Color--400: var(--of--color-black--200);
--of--Color--500: var(--of--color-brand--400);
--of--Color--600: var(--of--color-brand--300);



--of--LineHeight--sm: 1.3;
--of--LineHeight--lg: 1.5;

--of--FontWeight--100: 400;
--of--FontWeight--200: 700;

//animation
--of--animation: all .15s linear;

//shadows
--of--BoxShadow--sm: 0px 1px 4px rgba(0,0,0,0.5);

//misc
--of--menu-offset: 56px;
}
//media queries (no custom properties as MQs :(
$ov--breakpoint--xs: 0;
$ov--breakpoint--sm: 576px;
$ov--breakpoint--md: 768px;
$ov--breakpoint--lg: 992px;
$ov--breakpoint--xl: 1200px;
$ov--breakpoint--2xl: 1450px;

//misc
--of--menu-offset: 56px;

// z-indexes
--of--header-main: 10000;
}

//media queries (no custom properties as MQs :(
$ov--breakpoint--xs: 0;
$ov--breakpoint--sm: 576px;
$ov--breakpoint--md: 768px;
$ov--breakpoint--lg: 992px;
$ov--breakpoint--xl: 1200px;
$ov--breakpoint--2xl: 1450px;

// Breadcrumbs
$breadcrumb-font-size: null !default;
Expand Down
34 changes: 1 addition & 33 deletions assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
@@ -1,31 +1,3 @@
@import "../../themes/docsy/assets/scss/support/functions";
@import "../../themes/docsy/assets/scss/bs-variables";
@import "../../themes/docsy/assets/scss/support/mixins";

@import "../../themes/docsy/assets/vendor/bootstrap/scss/bootstrap";

@import "../../themes/docsy/assets/vendor/Font-Awesome/scss/fontawesome.scss";
@import "../../themes/docsy/assets/vendor/Font-Awesome/scss/solid.scss";
@import "../../themes/docsy/assets/vendor/Font-Awesome/scss/brands.scss";

@import "../../themes/docsy/assets/scss/support/utilities";
@import "../../themes/docsy/assets/scss/colors";
@import "../../themes/docsy/assets/scss/boxes";
@import "../../themes/docsy/assets/scss/blog";
@import "../../themes/docsy/assets/scss/code";
@import "../../themes/docsy/assets/scss/nav";
//@import "../../themes/docsy/assets/scss/sidebar-tree";
@import "../../themes/docsy/assets/scss/sidebar-toc";
@import "../../themes/docsy/assets/scss/buttons";
//@import "../../themes/docsy/assets/scss/breadcrumb";
@import "../../themes/docsy/assets/scss/alerts";
@import "../../themes/docsy/assets/scss/content";
@import "../../themes/docsy/assets/scss/search";
@import "../../themes/docsy/assets/scss/main-container";
@import "../../themes/docsy/assets/scss/blocks/blocks";
@import "../../themes/docsy/assets/scss/section-index";
@import "../../themes/docsy/assets/scss/pageinfo";

@if $td-enable-google-fonts {
@import url($web-font-path);
}
Expand Down Expand Up @@ -59,7 +31,7 @@ footer {


@import "functions";
@import "variables";
@import "of-variables";
@import "reset";
@import "type";
@import "sidebar-tree";
Expand All @@ -75,7 +47,3 @@ footer {

//global
@import "global";




15 changes: 12 additions & 3 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ title = "Operator Lifecycle Manager"

enableRobotsTXT = true

# Hugo allows theme composition (and inheritance). The precedence is from left to right.
theme = "docsy"

# Language settings
contentDir = "content/en"
defaultContentLanguage = "en"
Expand Down Expand Up @@ -66,6 +63,7 @@ version_menu = "Releases"
github_repo = "https://github.com/operator-framework/olm-docs"
# An optional link to a related project repo. For example, the sibling repository where your product code lives.
github_project_repo = "https://github.com/operator-framework/operator-lifecycle-manager"
github_branch = "master"

# Enable Algolia DocSearch
algolia_docsearch = true
Expand Down Expand Up @@ -124,3 +122,14 @@ no = 'Sorry to hear that. Please <a href="https://github.com/operator-framework/
name = "github"
url = "https://github.com/operator-framework/operator-lifecycle-manager"
icon = "fab fa-github"

[module]
[module.hugoVersion]
extended = true
min = "0.111.1"
[[module.imports]]
path = "github.com/google/docsy"
disable = false
[[module.imports]]
path = "github.com/google/docsy/dependencies"
disable = false
8 changes: 4 additions & 4 deletions content/en/docs/contribution-guidelines/upgrade-graphs.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,14 @@ flowchart TB

A(v0.0.1) --> B(v0.0.4)
{{</mermaid>}} |
| skips | `ID(<bundle tag>) x--x | <versions that should be skipped> | ID(<bundle tag>)` | {{<mermaid>}}
| skips | `ID(<bundle tag>) x--x \| <versions that should be skipped> \| ID(<bundle tag>)` | {{<mermaid>}}
Copy link
Member Author

Choose a reason for hiding this comment

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

Newer versions of Hugo use goldmark to render markdown with an extension which implements GitHub Flavored Markdown: Tables spec.

Accordingly to the spec pipe in a cell’s content needs be escaping (example).

As a result of proper spec implementation in goldmark tables & graphs get broken with new versions of Hugo.

flowchart TB
classDef head fill:#ffbfcf;
classDef installed fill:#34ebba;

A(v0.0.1) x--x |v0.0.2,v0.0.3| B(v0.0.4)
{{</mermaid>}} |
| skipRange | `ID<bundle tag>) o--o | <range> | ID(<bundle tag>)` | {{<mermaid>}}
| skipRange | `ID<bundle tag>) o--o \| <range> \| ID(<bundle tag>)` | {{<mermaid>}}
flowchart TB
classDef head fill:#ffbfcf;
classDef installed fill:#34ebba;
Expand All @@ -213,14 +213,14 @@ flowchart TB

A(v0.0.1) -.-> B(v0.0.4)
{{</mermaid>}} |
| future skips | `ID(<bundle tag>) x-.-x | <versions that should be skipped> | ID(<bundle tag>)` | {{<mermaid>}}
| future skips | `ID(<bundle tag>) x-.-x \| <versions that should be skipped> \| ID(<bundle tag>)` | {{<mermaid>}}
flowchart TB
classDef head fill:#ffbfcf;
classDef installed fill:#34ebba;

A(v0.0.1) x-.-x |v0.0.2,v0.0.3| B(v0.0.4)
{{</mermaid>}} |
| future skipRange | `ID<bundle tag>) o-.-o | <range> | ID(<bundle tag>)` | {{<mermaid>}}
| future skipRange | `ID<bundle tag>) o-.-o \| <range> \| ID(<bundle tag>)` | {{<mermaid>}}
flowchart TB
classDef head fill:#ffbfcf;
classDef installed fill:#34ebba;
Expand Down
5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/operator-framework/olm-docs

go 1.19

require github.com/google/docsy v0.6.0 // indirect
5 changes: 5 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
github.com/FortAwesome/Font-Awesome v0.0.0-20220831210243-d3a7818c253f/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
github.com/google/docsy v0.6.0 h1:43bVF18t2JihAamelQjjGzx1vO2ljCilVrBgetCA8oI=
github.com/google/docsy v0.6.0/go.mod h1:VKKLqD8PQ7AglJc98yBorATfW7GrNVsn0kGXVYF6G+M=
github.com/google/docsy/dependencies v0.6.0/go.mod h1:EDGc2znMbGUw0RW5kWwy2oGgLt0iVXBmoq4UOqstuNE=
github.com/twbs/bootstrap v4.6.2+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
12 changes: 1 addition & 11 deletions hack/ci/link-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,8 @@ set -ev

CONTAINER_RUN_EXTRA_OPTIONS=${CONTAINER_RUN_EXTRA_OPTIONS:=""}
CONTAINER_ENGINE=${CONTAINER_ENGINE:="docker"}
volume_name="olm-html"

function cleanup() {
exit_status=$?
${CONTAINER_ENGINE} volume rm ${volume_name}
exit $exit_status
}
trap cleanup EXIT

${CONTAINER_ENGINE} volume create ${volume_name}
${CONTAINER_ENGINE} run --rm ${CONTAINER_RUN_EXTRA_OPTIONS} -v "$(pwd):/src" -v ${volume_name}:/src/public klakegg/hugo:0.73.0-ext-ubuntu
Comment on lines -15 to -16
Copy link
Member Author

Choose a reason for hiding this comment

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

See comment in .github/workflows/lint.yaml for more details on this.

# ignore
# 1: links going back to help.github.com are rate-limited and can make this flaky
# 2: docsy autogenerated edit links to original markdown source, which will fail if the markdown file is new
${CONTAINER_ENGINE} run --rm -v ${volume_name}:/target mtlynch/htmlproofer /target --ignore-empty-alt --ignore-status-codes 429 --allow-hash-href --ignore-urls '/help.github.com/,/edit\/master\/.*\.md/'
${CONTAINER_ENGINE} run --rm -v $(pwd)/public:/target mtlynch/htmlproofer /target --ignore-empty-alt --ignore-status-codes 429 --allow-hash-href --ignore-urls '/help.github.com/,/edit\/master\/.*\.md/,/tree\/master\/.*\.md/,/new\/master\/.*filename=change-me\.md/'
Copy link
Contributor

Choose a reason for hiding this comment

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

This implies that we now have to have a local install of hugo to run, right? (e.g. brew install hugo) How are we capturing that new requirement & workflow? For e.g., I would always be able to run this script locally to build+validate changes before review, but first I'll have to install hugo now and manually run something?

I guess this goes back to my earlier comment about how close to hugo HEAD we need to be, because it's just 0.101.0 < 0.113.0 that isn't exposed in the available containers.

Copy link
Member Author

Choose a reason for hiding this comment

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

@grokspawn that was actually my initial goal (not of this PR, but overall): I wanted to be able to run this locally. master branch has readme which is hugoly outdated:

  • It talks about a git submodule for docsy, but there is no submodule. Theme commited into the repo. And there is some mention of https://github.com/google/docsy-example.git in readme... Like - how is it supposed to help me run it locally? How is it related?
  • It assumes that you already have hugo installed.
  • It says that you must have version 0.45 (extended). However there is no darwin-arm64 binary of Hugo for versions which work with olm-docs. I tried to compile it myself and gave up. Docker image also fails on darwin-arm64.

Even ignoring darwin-arm64 related issues - we do not have this captured today. But once we merge this - I'm happy to look into improving local experience with olm.

Copy link
Contributor

Choose a reason for hiding this comment

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

Created #301 to track these other updates needed, so that this PR doesn't get any more complex. 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay. Sounds like we can avoid a massive PR like this if we just update the README then?

It talks about a git submodule for docsy, but there is no submodule. Theme commited into the repo. And there is some mention of https://github.com/google/docsy-example.git in readme... Like - how is it supposed to help me run it locally? How is it related?

This is the submodule: https://github.com/operator-framework/olm-docs/tree/master/themes/docsy, which you do remove in a commit further up the chain too.

Removing the theme from being committed in the repo: what benefit do we get other than saving a little space in the git sever? I.e looking for justification for investing building/review cycles for this effort.

The mention of https://github.com/google/docsy-example.git is clearly a typo, if you read the statement above, it's trying to show the example of cloning the olm-docs repo, but with --git-submodules on.

It assumes that you already have hugo installed.
Looks like there's a missing Getting started page that should be pointing to https://gohugo.io/installation/macos/ for Mac installations.

It says that you must have version 0.45 (extended). However there is no darwin-arm64 binary of Hugo for versions which work with olm-docs. I tried to compile it myself and gave up. Docker image also fails on darwin-arm64.

It says you must have version 0.45 at least. I am going to try installing Hugo on my machine from that link above and go through the steps to see how things go.

Copy link
Member Author

@m1kola m1kola Jun 22, 2023

Choose a reason for hiding this comment

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

Okay. Sounds like we can avoid a massive PR like this if we just update the README then?

No. This whole thing started because I couldn't run the docs site locally. I was forced to create a draft PR and wait for CI to build and publish a preview for me. After spending some time trying to make old version of Hugo work on darwin-arm64 I just gave up and decided to update the thing.

This is the submodule: https://github.com/operator-framework/olm-docs/tree/master/themes/docsy, which you do remove in a commit further up the chain too.

No, this is not a submodule. Maybe it used to be a submodule, but at some point someone committed it and made changes to the vendored code.

Removing the theme from being committed in the repo: what benefit do we get other than saving a little space in the git sever?

I have this in the PR description:

Vendored docsy theme was modified with project-specific changes (scss, layout changes) which made it really hard to update. This PR switches the project to use go modules for vendoring Hugo dependencies. See docsy docs for more details.

I'm not concerned about saving space on GitHub (especially given that this removal doesn't remove anything from the history and technically doesn't save any space). What I'm concerned about is when people accidentally modifying vendored code. It is like committing vendored go modules into your repo and then making changes in ./vendor directory. This either prevents you from updating your dependencies (because you modified them) or makes you lose your changes.

I.e looking for justification for investing building/review cycles for this effort.

Justification is - I couldn't run the thing locally. Not a great dev experience. On top of that - we are using a legacy service (docsearch v2). This is not to mention a bunch of other related tech debt reasons.

After this change we can fix some pain points and open the door for further improvements. For example we can share a theme between sdk.operatorframework.io and olm.operatorframework.io: the only difference is a few colours. This way we can maintain a consistent look in feel between the two.

It says you must have version 0.45 at least. I am going to try installing Hugo on my machine from that link above and go through the steps to see how things go.

There is no binary for darwin-arm64 and if you try to compile Hugo yourself - it fails on compiling dependencies.

Instead of spending time on this I suggest that we proceed with the changs and leave 5 years old version of Hugo behind.

Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
<head>
{{ partial "head.html" . }}
</head>
<body class="td-{{ .Kind }}">
{{ partial "navbar.html" . }}
{{block "masthead" . }}{{ end }}
<body class="td-{{ .Kind }}">
{{ partial "navbar.html" . }}
{{ block "masthead" . }}{{ end }}
{{ block "main" . }}{{ end }}
{{ partial "footer.html" . }}
</div>
{{ partial "footer.html" . }}
{{ partialCached "scripts.html" . }}
</body>
</html>

Loading