Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0943a22
add workflow to generate and commit HTML
nchammas Jul 1, 2026
19e05f4
ignore `site/`
nchammas Jul 1, 2026
8bebf64
allow pushes on my branch for testing
nchammas Jul 1, 2026
eb4acbf
[html] allow pushes on my branch for testing
github-actions[bot] Jul 1, 2026
4053a05
make sitemap generation more deterministic
nchammas Jul 1, 2026
edaf0e3
[html] make sitemap generation more deterministic
github-actions[bot] Jul 1, 2026
ed18d51
eliminate extraneous whitespace
nchammas Jul 1, 2026
3579f84
[html] eliminate extraneous whitespace
github-actions[bot] Jul 1, 2026
fd110d9
remove content/ symlink
nchammas Jul 1, 2026
8f290c8
update docs on building site
nchammas Jul 1, 2026
b4f7a69
split pr vs asf-site workflows
nchammas Jul 1, 2026
9000cfd
clarify purpose of workflow condition
nchammas Jul 1, 2026
c8a37b3
capitalization
nchammas Jul 2, 2026
6eab236
add concurrency group
nchammas Jul 3, 2026
31d85be
add note about `[html]`
nchammas Jul 8, 2026
bf80b5e
check commit author + factor out common steps
nchammas Jul 9, 2026
29f56ea
`shell` is required in composite actions
nchammas Jul 10, 2026
0711d6b
latest build passes; remove testing branch
nchammas Jul 10, 2026
7a30b5e
Merge branch 'asf-site' into automated-html
nchammas Jul 12, 2026
d7a3216
restore `content/`
nchammas Jul 12, 2026
fd2387e
use same bundler version as everywhere else
nchammas Jul 12, 2026
9161b66
add critical note about `content`
nchammas Jul 12, 2026
1c42a37
clarifying comment
nchammas Jul 12, 2026
60d7c2b
remove note about committing html
nchammas Jul 12, 2026
e61f664
merge contributing into main readme
nchammas Jul 12, 2026
61c2d75
handle whitespace in file names correctly
nchammas Jul 12, 2026
50a174f
fix link anchors
nchammas Jul 12, 2026
533b045
revert local changes to site
nchammas Jul 12, 2026
b180842
minor readme tweaks
nchammas Jul 12, 2026
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
1 change: 0 additions & 1 deletion .github/CONTRIBUTING.md

This file was deleted.

1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

22 changes: 22 additions & 0 deletions .github/actions/build-html/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build HTML

description: Set up Ruby and run the Jekyll build.

inputs:
ruby-version:
description: Ruby version to use.
required: false
default: "3.4"

runs:
using: composite
steps:
- name: Set up Ruby and Bundler
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ inputs.ruby-version }}
# This will use the version of Bundler specified in `Gemfile.lock`.
bundler-cache: true
- name: Run documentation build
shell: bash
run: bundle exec jekyll build
76 changes: 0 additions & 76 deletions .github/workflows/doc_gen.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/html-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Build HTML

on:
pull_request:
branches:
- asf-site

jobs:
build:
name: Build HTML
runs-on: ubuntu-24.04
steps:
- name: Checkout Spark Website repository
uses: actions/checkout@v7
- name: Build HTML
uses: ./.github/actions/build-html
43 changes: 43 additions & 0 deletions .github/workflows/html-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and Push HTML

on:
push:
branches:
- asf-site

jobs:
commit:
name: Build and commit HTML to `asf-site`
# This condition is important. We don't want to trigger this job if the last
# commit was created _by_ this job!
if: >-
!(
contains(github.event.head_commit.message, '[html]') &&
github.event.head_commit.author.name == 'github-actions[bot]'
)
# Not technically necessary, but helps avoid spurious failures if multiple
# commits are pushed in rapid succession.
concurrency:
group: html-push-${{ github.ref }}
cancel-in-progress: true
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- name: Checkout Spark Website repository
uses: actions/checkout@v7
- name: Build HTML
uses: ./.github/actions/build-html
- name: Commit and push generated HTML
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# `-f` because we told git to otherwise ignore `site/`
git add -f site/
if git diff --cached --quiet; then
echo "No changes to commit."
else
COMMIT_TITLE=$(git log -1 --pretty=%s)
git commit -m "[html] $COMMIT_TITLE"
git push
fi
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ target/
.jekyll-cache/
.jekyll-metadata
.local_ruby_bundle
site/python
site/
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ RUBY VERSION
ruby 3.2.3p157

BUNDLED WITH
2.4.19
2.4.22
61 changes: 36 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
## Generating the website HTML
# Apache Spark Main Website

In this directory you will find text files formatted using Markdown, with an `.md` suffix.
This repository captures the main Apache Spark website located at https://spark.apache.org. The programming docs under https://spark.apache.org/docs/ are [in the main Spark repo][main], not here. They are built separately for each release of Spark and then copied to the website under the `docs/` directory.

Building the site requires [Ruby 3](https://www.ruby-lang.org), [Jekyll](http://jekyllrb.com/docs), and
[Rouge](https://github.com/rouge-ruby/rouge). The most reliable way to ensure a compatible environment
is to use the official Docker build image from the Apache Spark repository.
[main]: https://github.com/apache/spark/tree/master/docs#readme

## Contributing

To contribute changes, build and test the site locally, then submit a pull request with your changes. You only need to commit changes to the Markdown source. A [GitHub Actions workflow](.github/workflows/html-push.yml) will generate the corresponding HTML under `site/` and push it for you.

The `site/` directory is tracked in git as a deployment artifact. To hide local changes to it from `git status` and `git diff`, run:

```sh
git ls-files -z site/ | xargs -0 git update-index --skip-worktree
```

To undo this, run the same command with `--no-skip-worktree` instead.

## Building the site locally

Building the site requires [Ruby 3](https://www.ruby-lang.org), [Jekyll](http://jekyllrb.com/docs), and [Rouge](https://github.com/rouge-ruby/rouge).

```
gem install bundler -v 2.4.22
bundle install
bundle exec jekyll serve
```

### Building the site with Docker

The most reliable way to ensure a compatible environment is to use the official Docker build image from the Apache Spark repository.

If you haven't already, clone the [Apache Spark](https://github.com/apache/spark) repository. Navigate to
the Spark root directory and run the following command to create the builder image:
Expand All @@ -21,29 +45,16 @@ the Markdown files in the Docker container.
.dev/build-docs.sh
```

## Docs sub-dir

The docs are not generated as part of the website. They are built separately for each release
of Spark from the Spark source repository and then copied to the website under the docs
directory. See the instructions for building those in the readme in the Spark
project's `/docs` directory.

## Rouge and Pygments

We also use [Rouge](https://github.com/rouge-ruby/rouge) for syntax highlighting in documentation Markdown pages.
Its HTML output is compatible with CSS files designed for [Pygments](https://pygments.org/).
## Deploying to production

To mark a block of code in your Markdown to be syntax highlighted by `jekyll` during the
compile phase, use the following syntax:
The website is deployed automatically by [ASF Infra][infra]. The deployment configuration is tracked by [.asf.yaml](./.asf.yaml) and is [documented here][asf-docs].

{% highlight scala %}
// Your Scala code goes here, you can replace Scala with many other
// supported languages too.
{% endhighlight %}
One deployment detail that appears to be critical is the presence of the [`content`](./content/) symlink to `site/`. Even though ASF Infra is [aware of Jekyll][jek], we perhaps do not have the exact setup required for them to automatically use our [Jekyll config](./_config.yml) to understand where the site content lives. Without the `content` symlink, the website will just show a plain directory listing of the files in this repo.

You probably don't need to install that unless you want to regenerate the Pygments CSS file.
It requires Python, and can be installed by running `sudo easy_install Pygments`.
[infra]: https://infra.apache.org
[asf-docs]: https://github.com/apache/infrastructure-asfyaml/tree/main#readme
[jek]: https://github.com/apache/infrastructure-asfyaml/tree/76d241ccef02e5397e10c173ebf04c07525311ea#jekyll_cms

## Merge PR

To merge pull request, use the `merge_pr.py` script which also squashes the commits.
To merge a pull request, use the `merge_pr.py` script. This script also squashes the commits.
5 changes: 2 additions & 3 deletions committers.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,8 @@ an `apache` remote (the default `PUSH_REMOTE_NAME`, used for pushing the squashe
```

The script is interactive and walks you through selecting the PR and pushing the merge to the
`asf-site` branch. Before merging, make sure the pull request includes the regenerated HTML under
`site/` in addition to the Markdown/HTML source changes; see the repository's `README.md` for how
the site is built.
`asf-site` branch. See the repository's [README](https://github.com/apache/spark-website#readme)
for more details on how the site is built.

<h3>Policy on backporting bug fixes</h3>

Expand Down
15 changes: 12 additions & 3 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,18 @@ sitemap: false
<changefreq>weekly</changefreq>
</url>
{% endfor %}
{% for page in site.pages %}{% if page.sitemap != false %}<url>
{%- comment -%}
Explicitly sort `site.pages` so that the order is consistent and we don't get spurious git diffs.
`site.posts` doesn't have this issue because it's already sorted.
See: https://jekyllrb.com/docs/variables/#site-variables
{%- endcomment -%}
{%- assign sorted_pages = site.pages | sort: "url" -%}
{%- for page in sorted_pages -%}
{%- if page.sitemap != false -%}
<url>
<loc>{{ site.url }}{{ page.url }}</loc>
<changefreq>weekly</changefreq>
</url>{% endif %}
{% endfor %}
</url>
{% endif %}
{%- endfor -%}
</urlset>