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

New Kubeapps website #4705

Merged
merged 49 commits into from
May 17, 2022
Merged

New Kubeapps website #4705

merged 49 commits into from
May 17, 2022

Conversation

antgamdia
Copy link
Contributor

@antgamdia antgamdia commented May 13, 2022

Description of the change

This (big) PR is adding the new Kubeapps website source in our repo. It is based upon the VMware open-source project template, but have been adapted to our needs.
Under the hood, it is using Hugo (the instructions to build/run locally the website are in the readme file) for generating the static files and Netlify to deploy it (not public yet, see #3953)

More details: inline

Benefits

A brand new Kubeapps website!

Possible drawbacks

Broken links to files

Applicable issues

Additional information

Known broken links (10 broken out of 777):

---- Images (due to how deep they are)
--> FIXED! Some files have been moved so that the images get properly rendered

--- links under /docs/latest/project/...
--> FIXED! Even if they are symlinks and we can't modify the project files, we can add a workaround in the code in charge of rendering the links. Having applied this fix results in no more broken links! 

--- Every non-md file
--> FIXED! We have replaced the relative link with the link to the main branch in github. Whereas it is not 100% compatible with multiple versions, at least, links get rendered. 

--- Links to folders
--> FIXED! Idem, using a link to github instead. Same tradeoffs.

antgamdia and others added 30 commits May 10, 2022 17:05
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: ppbaena <ppbaena@gmail.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>

Conflicts:
	docs/background/update-api-docs.md
	site/content/docs/latest/background/update-api-docs.md
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
@netlify
Copy link

netlify bot commented May 13, 2022

Deploy Preview for kubeapps-dev ready!

Name Link
🔨 Latest commit cab62f3
🔍 Latest deploy log https://app.netlify.com/sites/kubeapps-dev/deploys/6282646eb412f00008db1526
😎 Deploy Preview https://deploy-preview-4705--kubeapps-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

antgamdia added 2 commits May 13, 2022 13:24
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
docs/README.md Outdated
| [How-to guides](./howto/) | They guide you through the steps involved in addressing key problems and use-cases. |
| [Background](./background/) | Dive into the overall architecture and implementation details of Kubeapps. |
| [Reference](./reference/) | Technical information - developer guides, design proposals, examples, translations, etc. |
The documentation files have moved to [/site/content/docs/latest](/site/content/docs/latest).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Big downside... docs have to be under the hugo site subfolder in order to get them rendered :( That's why I'm moving the docks down there.
Good news is that we will get pretty URLs like: /docs/latest/howto/oidc/azure-active-directory/ based on the md's name

Copy link
Contributor

Choose a reason for hiding this comment

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

They can't be symlinked like you've done for other files? (Might not be the best solution, as then relative refs to other static content might be painful, just wondering).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've tried to create a symlink to the folder but it didn't work in GitHub: it rendered as a text file with a link to the symlinked folder :(
However, instead of just saying "ey, we have moved it", we can leave the links to the howtos, background, refs, so that users can click on them and get redirected to the proper file. I'll do that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh - I actually meant whether it was possible the other way around - leave the docs where they are currently, and symlink to them from the hugo content source. But yep, guessing. you've tried all the options.

Copy link
Contributor

Choose a reason for hiding this comment

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

And, I think it's fine having them in ./site/content/ anyway. Although, why are is the docs/latest/ needed? Aren't the docs in our main branch always going to be the latest? (ie. why have you not used site/content/tutorials/getting-started.md rather than site/content/docs/latest/tutorials/getting-started.md? - I assume there's a good reason, just keen to understand). I assume the latest is so we can have multiple versions in our one main branch so hugo can render docs for multiple versions at once? And I assume the extra docs is so we can have ./site/content/static/ etc. as well. Just wondering if there might be a simpler structure to achieve those (particularly the first, whether we could have just one copy of the site in the branch - not sure).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, it would have been easier if it wasn't for the template. It is prepared to host several docs versions or, if there is only one, it gets served under latest. The template has some parameters for handling that and the whole template is prepared for that. I didn't want to diverge that much from the official template, so that's why I left the core structure.
Anyway, happy to change it in a follow-up PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh - it's a constraint of the template... yeah, I agree, let's stick to the template :)


## Check writing

In order to validate and ensure a proper style of writing, it is recommended to run the [vale validator](https://vale.sh/docs/vale-cli/installation/) with a set of [style rules](https://github.com/errata-ai/styles). The rules are present in the project codebase in the directory. Some of them have been slightly modified to fit our project needs.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The rules have been added to the repo, under the folder styles

Copy link
Contributor

Choose a reason for hiding this comment

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

Excellent. Assuming people can add exceptions intentionally if needed, it'd be great to have the build fail if the validator picks a breach of the style rules?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well... there are plenty of pre-defined warnings and errors. I have disabled some of them, but others remain as is. If we happen to add it to the building process, certainly we can tweak the rules and determine which are errors vs warnings for us.
Unfortunately, AFAIK, there is no way to set sth as an exception, but we can convert it into a warning.

Here's a example of the output:


 content\docs\latest\tutorials\using-an-OIDC-provider.md
 1:1   warning  Try to keep the Flesch reading  Readability.FleschReadingEase
                ease score (39.42) above 40
                (college).
 3:28  error    Using 'simple' may come across  alex.Condescending
                as condescending.
 14:1  error    Don't start a sentence with     write-good.ThereIs
                'There are'.
 48:1  error    Don't start a sentence with     write-good.ThereIs
                'There are'.


 content\docs\latest\tutorials\managing-carvel-packages.md
 89:128  error  Don't start a sentence with     write-good.ThereIs
                'There are'.
 215:45  error  Using 'easily' may come across  alex.Condescending
                as condescending.

For instance, with this report I would try to reduce the complexity of the sentences in using-an-OIDC-provider.md and rephrase some sentences to remove, if possible, some easily and simple words. However, I don't see it is really a problem to start with there are..... Perhaps I'd remove that rule or, at least, mark it as a warning, not an error

Comment on lines +32 to +35
docs_search: false
docs_search_api_key: api_key
docs_search_index_name: index_name
docs_versioning: true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The search feature is pending, as we will use an external indexing system that requires us to be "production ready" first.

github_url: "https://github.com/vmware-tanzu/kubeapps/"
googleSiteVerification: xxxx
gtmId: UA-1874455-13
oneTrustId: 3b23306b-6d55-4552-bcf0-1c1276db55e9-test
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Configuring oneTrustId is pending as well

</div>
<div class="content">
<h3>
<a target="_blank" rel="noopener" href="https://github.com/vmware-tanzu/kubeapps/"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The templating {{ params.xxxx }} don't work here, it would have to be a partial not a content, but the template was this way. Let's change in the future maybe.

@@ -27,8 +27,8 @@ or to allow other users the ability to deploy charts from App Repositories in a

When creating an AppRepository in Kubeapps, you can now additionally choose (or create) an [imagePullSecret](https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod) to be associated with the AppRepository:

<img src="../img/app-repo-pull-secret.png" alt="AppRepository with imagePullSecret" width="600px">
<img src="../img/app-repo-pull-secret-2.png" alt="AppRepository with imagePullSecret" width="600px">
![AppRepository with imagePullSecret](../img/app-repo-pull-secret.png)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Required for displaying the imgs

@@ -0,0 +1,11 @@
This directory is expected to contain symlinks to certain files of the root project directory. This way, these files will be rendered in Hugo.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As we can't add external (not in the hugo folder) files for them to be rendered as normal files, we need to create a symlink so that they get "virtually" into the website folder.

@@ -12,7 +12,6 @@ This folder contains documents/links used to design new features for Kubeapps.
- [Simpler deployments](./dashboard/deployment-improvements.md)
- [Improve UX in application view](./dashboard/application-view-revamp.md)
- [Upgrade to Clarity design](./clarity-ui.md)
- [Notify Available Chart Updates](https://docs.google.com/document/d/1oG9nerd5CurWSIwH33kKCsOCtkSFMgcm8SuTJyuSnxs/)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Broken link

@@ -0,0 +1,93 @@
toc:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The menu is manual, so we would need to add new featured documentation items by hand.

to = "/404/"
status = 404

# [[headers]]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if it is required, but I left it here until we add the search feature

antgamdia added 3 commits May 13, 2022 14:49
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
@castelblanque
Copy link
Collaborator

This is cool! Great job, and awesome that preview comment from the bot 😄

antgamdia added 2 commits May 13, 2022 17:05
Make them point to github instead

Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
@antgamdia
Copy link
Contributor Author

antgamdia commented May 13, 2022

Here's a summary of the broken links so far:

Links referenced from the project files
https://kubeapps-dev.netlify.app/docs/latest/project/CODE_OF_CONDUCT.md<a href>
Linked from: https://kubeapps-dev.netlify.app/docs/latest/project/contributing/ and 1 more

https://kubeapps-dev.netlify.app/docs/latest/project/docs/tutorials/using-an-OIDC-provider.md<a href>
Linked from: https://kubeapps-dev.netlify.app/docs/latest/project/readme/ and 1 more

https://kubeapps-dev.netlify.app/docs/latest/project/docs/howto/OIDC/using-an-OIDC-provider-with-pinniped.md<a href>
Linked from: https://kubeapps-dev.netlify.app/docs/latest/project/readme/ and 1 more

https://kubeapps-dev.netlify.app/docs/latest/project/docs/howto/access-control.md<a href>
Linked from: https://kubeapps-dev.netlify.app/docs/latest/project/readme/ and 1 more

https://kubeapps-dev.netlify.app/docs/latest/project/docs/tutorials/getting-started.md<a href>
Linked from: https://kubeapps-dev.netlify.app/docs/latest/project/readme/ and 1 more

https://kubeapps-dev.netlify.app/docs/latest/project/chart/kubeapps/README.md<a href>
Linked from: https://kubeapps-dev.netlify.app/docs/latest/project/readme/ and 1 more

https://kubeapps-dev.netlify.app/docs/latest/project/docs/howto/dashboard.md<a href>
Linked from: https://kubeapps-dev.netlify.app/docs/latest/project/readme/ and 1 more

https://kubeapps-dev.netlify.app/docs/latest/project/docs/tutorials/kubeapps-on-tkg/README.md<a href>
Linked from: https://kubeapps-dev.netlify.app/docs/latest/project/readme/ and 1 more

https://kubeapps-dev.netlify.app/docs/latest/project/values.yaml<a href>
Linked from: https://kubeapps-dev.netlify.app/docs/latest/project/chart-readme/ and 1 more

https://kubeapps-dev.netlify.app/docs/latest/project/docs/reference/design-proposals<a href>
Linked from: https://kubeapps-dev.netlify.app/docs/latest/project/governance/ and 1 more
Links broken images (update: fixed!)

https://kubeapps-dev.netlify.app/img/design-proposals/overview.png<img src>
Linked from: https://kubeapps-dev.netlify.app/docs/latest/reference/design-proposals/dashboard/error-handling/error-handling/ and 1 more

https://kubeapps-dev.netlify.app/docs/img/dashboard/deployment-form-basic.png<img src>
Linked from: https://kubeapps-dev.netlify.app/docs/latest/reference/design-proposals/dashboard/deployment-improvements/ and 1 more

https://kubeapps-dev.netlify.app/docs/img/dashboard/deployment-form-adv.png<img src>
Linked from: https://kubeapps-dev.netlify.app/docs/latest/reference/design-proposals/dashboard/deployment-improvements/ and 1 more

https://kubeapps-dev.netlify.app/docs/img/dashboard/chart-dependencies.png<img src>
Linked from: https://kubeapps-dev.netlify.app/docs/latest/reference/design-proposals/dashboard/application-view-revamp/ and 1 more

https://kubeapps-dev.netlify.app/docs/img/dashboard/pod-count.png<img src>
Linked from: https://kubeapps-dev.netlify.app/docs/latest/reference/design-proposals/dashboard/application-view-revamp/ and 1 more

https://kubeapps-dev.netlify.app/docs/img/dashboard/credentials-box.png<img src>
Linked from: https://kubeapps-dev.netlify.app/docs/latest/reference/design-proposals/dashboard/application-view-revamp/ and 1 more

https://kubeapps-dev.netlify.app/docs/img/dashboard/configuration-options.png<img src>
Linked from: https://kubeapps-dev.netlify.app/docs/latest/reference/design-proposals/dashboard/application-view-revamp/ and 1 more

https://kubeapps-dev.netlify.app/docs/img/dashboard/url-list.png<img src>
Linked from: https://kubeapps-dev.netlify.app/docs/latest/reference/design-proposals/dashboard/application-view-revamp/ and 1 more

https://kubeapps-dev.netlify.app/docs/img/dashboard/resources-table.png<img src>
Linked from: https://kubeapps-dev.netlify.app/docs/latest/reference/design-proposals/dashboard/application-view-revamp/ and 1 more

https://kubeapps-dev.netlify.app/docs/img/dashboard/appview-revamp.png<img src>
Linked from: https://kubeapps-dev.netlify.app/docs/latest/reference/design-proposals/dashboard/application-view-revamp/ and 1 more

@absoludity
Copy link
Contributor

Excellent work Antonio. Love the preview per branch that the netlify bot provides, very handy.

antgamdia added 3 commits May 16, 2022 10:07
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
@antgamdia antgamdia marked this pull request as ready for review May 16, 2022 09:08
antgamdia added 8 commits May 16, 2022 12:47
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Comment on lines +4 to +20
<!-- BEGIN Workaround to render the links of the symlinked files -->
{{- if in .Page.RelPermalink "/docs/latest/project/" }}
<!-- Replace the links pointing to the project files with the proper link -->
{{- if in .Destination "/docs/" }}
{{ $link = printf "../../../../%s" (replace (replace (replace (replace .Destination "docs/" "docs/latest/") ".md" "") "/README" "") "_" "-" | lower ) }}
{{- end }}
<!-- Replace the chart/kubeapps/readme links with the proper link -->
{{- if in .Destination "/chart/kubeapps/" }}
{{ $link = printf "../%s" (replace (replace (replace .Destination "/chart/kubeapps/" "/chart-readme/") ".md" "") "/README" "" | lower ) }}
{{- end }}
<!-- Replace "_" with "-"" -->
<!-- If we start having issues with it, just apply the substitution if destination is "CODE_OF_CONDUCT" -->
{{- if in .Destination "_" }}
{{ $link = printf "../%s" (replace (replace $link "_" "-") ".md" "" | lower ) }}
{{- end }}
{{- end }}
<!-- END -->
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the workaround to replace some parts of a link's href so that it points to the proper place when becoming rendered in a symlinked file.
With this patch, every link is working!

This was referenced May 16, 2022
Copy link
Collaborator

@ppbaena ppbaena left a comment

Choose a reason for hiding this comment

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

+1

@antgamdia antgamdia merged commit 8cd7116 into main May 17, 2022
@antgamdia antgamdia deleted the site-new branch May 17, 2022 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants