This is an automated email from the ASF dual-hosted git repository.
github-bot pushed a commit to branch site
in repository https://gitbox.apache.org/repos/asf/calcite.git
The following commit(s) were added to refs/heads/site by this push:
new f3331507d8 [CALCITE-6845] Self-host website images
f3331507d8 is described below
commit f3331507d807a9edc00eb571665dde3115ba583c
Author: Francis Chuang <[email protected]>
AuthorDate: Tue Feb 18 09:46:30 2025 +1100
[CALCITE-6845] Self-host website images
---
site/README.md | 50 ++++++---------------------------------
site/_layouts/news_item.html | 2 +-
site/_sass/_style.scss | 1 -
site/community/index.md | 8 +++----
site/docker-compose.yml | 4 ++--
site/download-avatars.sh | 23 ++++++++++++++++++
site/img/SupportApache-small.png | Bin 0 -> 96596 bytes
site/index.html | 2 +-
8 files changed, 38 insertions(+), 52 deletions(-)
diff --git a/site/README.md b/site/README.md
index c85bf6bdf0..9cba819dcb 100644
--- a/site/README.md
+++ b/site/README.md
@@ -23,59 +23,23 @@ # Apache Calcite docs site
[calcite.apache.org](https://calcite.apache.org/). The actual generated
content of the website
is present in the [calcite-site](https://github.com/apache/calcite-site)
repository.
-# Previewing the website locally
-
-## Manually
-
-### Setup your environment
-
-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`
-3. `sudo apt-get install rubygems ruby2.7-dev zlib1g-dev` (linux)
- `Use RubyInstaller to install rubygems as recommended at
https://www.ruby-lang.org/en/downloads/` (Windows)
-4. `sudo gem install bundler`
- `gem install bundler` (Windows)
-5. `bundle install`
-
-### Add javadoc
-
-1. `cd ..`
-2. `./gradlew javadocAggregate`
-3. `rm -rf site/target/javadocAggregate`
- `rmdir site\target\javadocAggregate /S /Q` (Windows)
-4. `mkdir site/target`
- `mkdir site\target` (Windows)
-5. `mv build/docs/javadocAggregate site/target`
- `for /d %a in (build\docs\javadocAggregate*) do move %a site\target`
(Windows)
-
-### Running 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](http://localhost:4000)
-
-## Using 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. `env docker compose run build-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.
diff --git a/site/_layouts/news_item.html b/site/_layouts/news_item.html
index 7b2ed91d87..930799b962 100644
--- a/site/_layouts/news_item.html
+++ b/site/_layouts/news_item.html
@@ -29,7 +29,7 @@ <h2>
{% if c.avatar %}
{% assign avatar = c.avatar %}
{% else %}
- {% capture avatar %}https://github.com/{{ c.githubId }}.png{%
endcapture %}
+ {% capture avatar %}{{ site.baseurl }}/img/avatars/{{ c.githubId
}}.png{% endcapture %}
{% endif %}
{% endif %}
{% endfor %}
diff --git a/site/_sass/_style.scss b/site/_sass/_style.scss
index 9fa593cf30..3cb0b280c7 100644
--- a/site/_sass/_style.scss
+++ b/site/_sass/_style.scss
@@ -447,7 +447,6 @@ aside {
text-align: center;
padding-top: 40px;
position: relative;
- background: url(../img/article-footer.png) top center no-repeat;
margin: 40px -20px 10px;
> div { width: 49.5%; }
diff --git a/site/community/index.md b/site/community/index.md
index e447fc3be2..dc9e1cd887 100644
--- a/site/community/index.md
+++ b/site/community/index.md
@@ -30,16 +30,16 @@ # Upcoming talks
# Project Members
-Name (Apache ID) | Github | Org | Role
-:--------------- | :----- | :-- | :---
-{% for c in site.data.contributors %}{% unless c.emeritus %}{% if c.homepage
%}<a href="{{ c.homepage }}">{{ c.name }}</a>{% else %}{{ c.name }}{% endif %}
(<a href="https://people.apache.org/phonebook.html?uid={{ c.apacheId }}">{{
c.apacheId }}</a>) {{ c.pronouns }} | <a href="https://github.com/{{ c.githubId
}}"><img width="64" src="{% unless c.avatar %}https://github.com/{{ c.githubId
}}.png{% else %}{{ c.avatar }}{% endunless %}"></a> | {{ c.org }} | {{ c.role }}
+Name (Apache ID) | Github
| Org | Role
+:---------------
|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
:-- | :---
+{% for c in site.data.contributors %}{% unless c.emeritus %}{% if c.homepage
%}<a href="{{ c.homepage }}">{{ c.name }}</a>{% else %}{{ c.name }}{% endif %}
(<a href="https://people.apache.org/phonebook.html?uid={{ c.apacheId }}">{{
c.apacheId }}</a>) {{ c.pronouns }} | <a href="https://github.com/{{ c.githubId
}}"><img width="64" src="{% unless c.avatar %}{{ site.baseurl }}/img/avatars/{{
c.githubId }}.png{% else %}{{ c.avatar }}{% endunless %}"></a> | {{ c.org }} |
{{ c.role }}
{% endunless %}{% endfor %}
Emeritus members
Name (Apache ID) | Github | Org | Role
:--------------- | :----- | :-- | :---
-{% for c in site.data.contributors %}{% if c.emeritus %}{% if c.homepage %}<a
href="{{ c.homepage }}">{{ c.name }}</a>{% else %}{{ c.name }}{% endif %} (<a
href="https://people.apache.org/phonebook.html?uid={{ c.apacheId }}">{{
c.apacheId }}</a>) {{ c.pronouns }} | <a href="https://github.com/{{ c.githubId
}}"><img width="64" src="{% unless c.avatar %}https://github.com/{{ c.githubId
}}.png{% else %}{{ c.avatar }}{% endunless %}"></a> | {{ c.org }} | {{ c.role }}
+{% for c in site.data.contributors %}{% if c.emeritus %}{% if c.homepage %}<a
href="{{ c.homepage }}">{{ c.name }}</a>{% else %}{{ c.name }}{% endif %} (<a
href="https://people.apache.org/phonebook.html?uid={{ c.apacheId }}">{{
c.apacheId }}</a>) {{ c.pronouns }} | <a href="https://github.com/{{ c.githubId
}}"><img width="64" src="{% unless c.avatar %}{{ site.baseurl }}/img/avatars/{{
c.githubId }}.png{% else %}{{ c.avatar }}{% endunless %}"></a> | {{ c.org }} |
{{ c.role }}
{% endif %}{% endfor %}
# Mailing Lists
diff --git a/site/docker-compose.yml b/site/docker-compose.yml
index cae63c9e22..ffcabbd178 100644
--- a/site/docker-compose.yml
+++ b/site/docker-compose.yml
@@ -18,14 +18,14 @@ services:
dev:
image: ruby:3.3.7-slim-bullseye
working_dir: /root
- command: sh -c "apt-get update && apt-get install -y build-essential
libssl-dev zlib1g-dev ruby-dev bundler && bundle install && bundle exec jekyll
serve --host=0.0.0.0 --watch --force_polling"
+ command: sh -c "apt-get update && apt-get install -y build-essential
libssl-dev zlib1g-dev ruby-dev bundler wget && wget -O /usr/bin/yq
https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 &&
chmod +x /usr/bin/yq && ./download-avatars.sh && bundle install && bundle exec
jekyll serve --host=0.0.0.0 --watch --force_polling"
ports:
- 4000:4000
volumes:
- .:/root
build-site:
image: ruby:3.3.7-slim-bullseye
- command: sh -c "rm -rf /home/jekyll/.bundle /home/jekyll/Gemfile.lock
/home/jekyll/.jekyll-cache /home/target/ && apt-get update && apt-get install
-y build-essential libssl-dev zlib1g-dev ruby-dev bundler && cd /home/jekyll &&
bundle install && bundle exec jekyll build && mkdir ./.git && chmod 777 ./*"
+ command: sh -c "rm -rf /home/jekyll/.bundle /home/jekyll/Gemfile.lock
/home/jekyll/.jekyll-cache /home/target/ && apt-get update && apt-get install
-y build-essential libssl-dev zlib1g-dev ruby-dev bundler wget && wget -O
/usr/bin/yq
https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 &&
chmod +x /usr/bin/yq && ./download-avatars.sh && cd /home/jekyll && bundle
install && bundle exec jekyll build && mkdir ./.git && chmod 777 ./*"
volumes:
- .:/home/jekyll
generate-javadoc:
diff --git a/site/download-avatars.sh b/site/download-avatars.sh
new file mode 100755
index 0000000000..afe4e028dd
--- /dev/null
+++ b/site/download-avatars.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+mkdir -p img/avatars
+contributors=$(yq '.[].githubId' _data/contributors.yml)
+
+for contributor in $contributors; do
+ wget -q -O "img/avatars/$contributor.png"
"https://github.com/$contributor.png"
+done
diff --git a/site/img/SupportApache-small.png b/site/img/SupportApache-small.png
new file mode 100644
index 0000000000..4a23e05255
Binary files /dev/null and b/site/img/SupportApache-small.png differ
diff --git a/site/index.html b/site/index.html
index 3f75dff4c1..3598a899ca 100644
--- a/site/index.html
+++ b/site/index.html
@@ -86,7 +86,7 @@ <h3>Sub-Projects</h3>
<div class="grid">
<div class="unit one-third">
<a href="https://www.apache.org/foundation/contributing.html">
- <img src="https://apache.org/images/SupportApache-small.png"
width="300" height="300" alt="Support Apache">
+ <img src="{{ site.baseurl }}/img/SupportApache-small.png" width="300"
height="300" alt="Support Apache">
</a>
</div>
<div class="unit two-thirds">