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 with Hugo #279

Merged
merged 6 commits into from
Oct 2, 2024
Merged

Website with Hugo #279

merged 6 commits into from
Oct 2, 2024

Conversation

snazy
Copy link
Member

@snazy snazy commented Sep 11, 2024

An approach for the website using Hugo, built to support docs for Polaris releases.

The current state is rather a demo for the versioned docs than something that can be published.

Follow the Quickstart to start/stop Hugo in a Docker container or run it locally, as you prefer.

** Versioned docs demo **

  1. Start Hugo - the Docs & Releases menu at the top has only the In Development menu item.
  2. Stop Hugo
  3. Run the site/bin/checkout-releases.sh script (it requires the versioned-docs branch from my fork)
  4. Start Hugo - the Docs & Releases menu has a couple more menu items.

The "released versions" are categorized into "active" and "EOL" versions - only the "actively maintained" versions appear in the menu in the navbar.

** Quickstart **

Just run the following command to let Hugo serve files from the Polaris site/.

site/bin/run-hugo-in-docker.sh

Then point your browser to http://localhost:1313/

To stop the Hugo run

site/bin/stop-hugo-in-docker.sh

See README.md in the site/ directory for more options

** Versioned docs **

The idea here is that docs of releases live in either a separate branch or a separate Git repo.

The /releases folder would not be in the main Polaris repository (at least not in any code branch). It would be mounted either via git worktree or git clone. Building and testing the site locally works without the /releases folder. For developers, it is probably much easier to have a separate branch in the main Polaris GitHub repository and leverage Git worktrees.

Docs for the current code branch (e.g. main branch) are maintained in the /in-dev/unreleased folder. While we could maintain the docs right in the /in-dev folder, having the in-dev docs in /in-dev/unreleased provides the ability to use relative links that still work when the docs are in an /releases/x.y.z folder (think: links like ../../guides/foo-bar.md).

Within a release's versioned docs folder, the release version number can be included in the markdown using the custom Hugo shortcode {{< releaseVersion >}}.

@snazy
Copy link
Member Author

snazy commented Sep 11, 2024

/cc @annafil

@snazy snazy force-pushed the website-hugo branch 29 times, most recently from de11443 to cf36451 Compare September 12, 2024 12:04
snazy added 2 commits October 1, 2024 08:21
An approach for the website using Hugo, built to support docs for Polaris releases.

The current state is rather a demo for the versioned docs than something that can be published.

Follow the _Quickstart_ to start/stop Hugo in a Docker container or run it locally, as you prefer.

** Versioned docs demo **

1. Start Hugo - the `Docs & Releases` menu at the top has only the `In Development` menu item.
2. Stop Hugo
3. Run the `site/bin/checkout-releases.sh` script (it requires the `versioned-docs` branch from my fork)
4. Start Hugo - the `Docs & Releases` menu has a couple more menu items.

The "released versions" are categorized into "active" and "EOL" versions - only the "actively maintained" versions appear in the menu in the navbar.

** Quickstart **

Just run the following command to let Hugo serve files from the Polaris `site/`.
```bash
site/bin/run-hugo-in-docker.sh
```

Then point your browser to http://localhost:1313/

To stop the Hugo run
```bash
site/bin/stop-hugo-in-docker.sh
```

See `README.md` in the `site/` directory for more options

** Versioned docs **

The idea here is that docs of releases live in either a separate branch or a separate Git repo.

The `/releases` folder would _not_ be in the main Polaris repository (at least not in any code branch). It would be
mounted either via `git worktree` or `git clone`. Building and testing the site locally works without the `/releases`
folder. For developers, it is probably much easier to have a separate branch in the main Polaris GitHub repository
and leverage Git worktrees.

Docs for the current code branch (e.g. `main` branch) are maintained in the `/in-dev/unreleased` folder. While we
could maintain the docs right in the `/in-dev` folder, having the in-dev docs in `/in-dev/unreleased` provides the
ability to use relative links that still work when the docs are in an `/releases/x.y.z` folder (think: links like
`../../guides/foo-bar.md`).

Within a release's versioned docs folder, the release version number can be included in the markdown using the
custom Hugo shortcode `{{< releaseVersion >}}`.
* Use new logo
* remove current `docs/` (after migrating changes in there)
* remove demo content
* update community pages (remove demo content)
* hide "blog" and "guides" (currently empty)
* remove (hopefully) unused files in `spec/`
* added Hugo shortcode to include the "in-dev"/"release-version" openapi specs, depending on the source page
@snazy snazy changed the title Website with Hugo (WIP!) Website with Hugo Oct 1, 2024
@snazy
Copy link
Member Author

snazy commented Oct 1, 2024

I've updated & polished the PR and it is now (nearly) ready. The missing piece is currently a secret for the polaris-site repo to deploy to the polaris-site/asf-site branch.

Copy link
Contributor

@flyrain flyrain left a comment

Choose a reason for hiding this comment

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

Thanks a lot, @snazy, for your work on this! The new site looks fantastic, and I'm really excited about it.

Just a minor observation: there are currently three directories under static—images, img, and favicons—all holding images. It seems like having three separate directories might not be necessary. This isn't a blocker, we can always improve it over time.


menu:
main:
- name: "Docs & Releases"
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: split them into two top level menu?

Copy link
Member Author

Choose a reason for hiding this comment

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

The idea here is to have one set of versioned docs that contain both the docs and download links / distribution information.


openapi: 3.0.3
info:
title: Polaris Management Service
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this file? Can we use the one in directory spec?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah - yea. Those can go away.

@snazy
Copy link
Member Author

snazy commented Oct 2, 2024

Thanks for the review!
I'll merge but also create an immediate follow-up.

@snazy snazy merged commit 012bdcc into apache:main Oct 2, 2024
4 checks passed
@snazy snazy deleted the website-hugo branch October 2, 2024 08:15
@snazy snazy mentioned this pull request Oct 2, 2024
@snazy
Copy link
Member Author

snazy commented Oct 2, 2024

Nice, the GH workflow worked out of the box and populated the new asf-site branch.

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.

2 participants