Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 65 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,73 @@ It's built with [Hugo](https://gohugo.io/) and hosted at https://iceberg.apache.
The Iceberg documentation site is actually constructed from two hugo sites. The first, is the landing page. The second site,
is the documentation site which contains the full Iceberg documentation, including the javadoc. The landing page and
documentation sites are completely self-contained in the `./landing-page` and `./docs` directories, respectively.
The Javadocs are in the `./javadoc` directory.

# Landing Page Deployment
Copy link
Author

Choose a reason for hiding this comment

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

I moved up contribution guide because readers are most likely interested in that

## Relationship to the Iceberg Repository

The `documentation` folder in the [Iceberg repository](https://github.com/apache/iceberg) contains all the markdown docs used by the website.
The `common` subfolder contains contents used by the landing page.
The `versioned` subfolder contains the contents different for each version.

During each new release, the release manager copies contents from the Iceberg repository to this docs repository and cuts a new version branch.
Contents under `common` are copied to `./landing-page/contents/common` here,
and contents under `versioned` are copied to `./docs/contents/docs` here.
Javadocs generated from the release are copied to the `javadoc` directory.

# How to Contribute

## Submitting Pull Requests

Changes to the markdown contents should be submitted directly in the Iceberg repository.

Changes to the website appearance (e.g. HTML, CSS changes) should be submitted to this repository against the `main` branch.

Changes to the documentation of old Iceberg versions should be submitted to this repository against the specific version branch.

## Reporting Issues

All issues related to the doc website should still be submitted to the [Iceberg repository](https://github.com/apache/iceberg).
The GitHub Issues feature of this repository is disabled.

## Running Locally

Clone this repository to run the website locally:
```shell
git clone [email protected]:apache/iceberg-docs.git
cd iceberg-docs
```

To start the landing page site locally, run:
```shell
cd landing-page && hugo serve
```

To start the documentation site locally, run:
```shell
cd docs && hugo serve
```

If you would like to see how the latest website looks based on the documentation in the Iceberg repository, you can copy docs to this repository by:
Copy link
Author

Choose a reason for hiding this comment

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

need to refine this workflow a bit, does the docs/content/docs path contains all the documentations user might modify?

Copy link
Author

@jackye1995 jackye1995 Feb 4, 2022

Choose a reason for hiding this comment

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

Looks like there is another part in the landing-page/content/common

Copy link
Author

Choose a reason for hiding this comment

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

okay so I assume the iceberg repo would have a documentation folder and common and docs folder inside mapping to the 2 sites here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, exactly right. In apache/iceberg we would have two directories that are intuitively named like documentation/common and documentation/versioned and they would hold the contents in docs/content/docs and landing-page/content/common, respectively. The release manager would then just do a full hard-copy over of those two directories (might be worth mentioning that it should be a full copy, meaning deleted files are removed in the destinations as well).

Copy link
Contributor

Choose a reason for hiding this comment

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

Once this PR and PR #27 is merged, I'll go ahead and open the PR against apache/iceberg to add those documentation/common and documentation/versioned directories.

Copy link
Author

Choose a reason for hiding this comment

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

got it, let me update based on this info

```shell
rm -rf docs/content/docs
rm -rf landing-page/content/common
cp -r <path to iceberg repo>/documentation/versioned docs/content/docs
cp -r <path to iceberg repo>/documentation/common docs/content/common
```

## Scanning For Broken Links

If you'd like to scan for broken links, one available tool is linkcheck that can be found [here](https://github.com/filiph/linkcheck).

# How the Website is Deployed

## Landing Page Deployment

The landing page site is automatically deployed to the root of the `asf-site` branch by the `deploy-landing-page`
job in the [deployment workflow](./.github/workflows/deploy.yml). There is only a single version of the landing
page site, and the `deploy-landing-page` job only runs on commits to the `main` branch.

# Docs Deployment
## Docs Deployment

The docs site is automatically deployed to the `docs` directory in the asf-site branch, into a sub-directory
named after the branch where the commit occured. This is performed by the `deploy-docs` job in the
Expand All @@ -45,11 +104,11 @@ yet exist in the `asf-site` branch, it will be created.
Additionally, the contents of the `javadoc` directory is deployed to a `javadoc/<branch_name>` directory in
the `asf-site` branch.

#### Latest Docs
### Latest Docs
In [./docs/redirect/index.html](./docs/redirect/index.html), a redirect meta tag exists to forward `/docs`
and `/latest` to `/docs/latest`.

# `asf-site` Branch Structure
## `asf-site` Branch Structure

The `asf-site` branch structure is the following:
```
Expand All @@ -75,29 +134,10 @@ in the `asf-site` branch's `javadoc` directory.
A `main` branch commit deploys the landing page site **only** and overwrites the landing page site at
the root of the `asf-site` branch.

# Redirects
## Redirects

Redirects within one of the two sites can easily be done using the `aliases` keyword in the YAML Front Matter.
You can read more about this Hugo URL Management feature [here](https://gohugo.io/content-management/urls/#yaml-front-matter).

For root level redirects that are outside of both sites, the `./redirects` directory contains pages with redirect `meta` tags.
These are all deployed at the root level of the `asf-site` branch by the `Deploy redirects` step in the [deployment workflow](./.github/workflows/deploy.yml).

# Running Locally

To start the landing page site locally, clone this repository and run the following.
```
git clone [email protected]:apache/iceberg-docs.git
cd landing-page && hugo serve
```

To start the documentation site locally, clone this repository and run the following.
```
git clone [email protected]:apache/iceberg-docs.git
git submodule update --init
cd docs && hugo serve
```

# Scanning For Broken Links

If you'd like to scan for broken links, one available tool is linkcheck that can be found [here](https://github.com/filiph/linkcheck).
These are all deployed at the root level of the `asf-site` branch by the `Deploy redirects` step in the [deployment workflow](./.github/workflows/deploy.yml).