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

Adjust site URL to be relative to /blog #44

Merged
merged 6 commits into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
1 change: 1 addition & 0 deletions .github/workflows/stage-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ jobs:
with:
destination: 'asf-staging'
gfm: 'false'
output: 'blog'
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,27 @@

This repository contains the Apache DataFusion blog at https://datafusion.apache.org/blog/

## Testing

There are two ways to preview your blog post before publishing the site. You can
either locally build and test the site or you can use the auto staging feature
of the CI system. To locally build the site on your machine, follow the docker
instructions below.

To use the staging feature of the CI system, push a branch that starts with
`site/` and create a PR to merge this branch into `main`. When you do so, it
will trigger a CI process that will build the site and push it to the branch
`asf-staging`. Once this completes, the ASF infrastructure will auto publish
this staged branch to https://datafusion.staged.apache.org/

The most recently run staging CI pipeline will be published to this site. If you
Copy link
Contributor

Choose a reason for hiding this comment

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

I tested it out and I think this workflow doesn't work for forks -- see review comments

Suggested change
The most recently run staging CI pipeline will be published to this site. If you
This workflow only works for branches in this repository (not for forks).
In order to use https://datafusion.staged.apache.org/ you need to be a committer
and create the branch directly in this repository.
The most recently run staging CI pipeline will be published to this site. If you

need to republish any branch, simply rerun the `Stage Site` workflow.

## Setup for Docker

To locally build and preview the site on your computer, you will need to build
a docker container using these instructions:

```shell
git clone https://github.com/apache/infrastructure-actions.git
cd infrastructure-actions
Expand All @@ -28,7 +47,7 @@ See the [ASF-Pelican](https://infra.apache.org/asf-pelican.html) site for most d
on how this process works.

To preview your site live, create a branch named `site/my-feature-x`. This should
auto-publish to https://datafusion.staged.apache.org/blog
auto-publish to https://datafusion.staged.apache.org/

When you are satisfied with the staged branch, merging into `main` should cause
the site to build via github actions and publish.
Expand Down
2 changes: 1 addition & 1 deletion content/theme/templates/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="collapse navbar-collapse" id="navbarADP">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" href="/about.html">About</a>
<a class="nav-link" href="/blog/about.html">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/blog/feed.xml">RSS</a>
Expand Down
7 changes: 4 additions & 3 deletions pelicanconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@
ARCHIVES_SAVE_AS = ''
# Disable articles by pointing to a (should-be-absent) subdir
ARTICLE_PATHS = [ 'blog' ]
# needed to create blogs page
ARTICLE_URL = 'blog/{date:%Y}/{date:%m}/{date:%d}/{filename}'
ARTICLE_SAVE_AS = 'blog/{date:%Y}/{date:%m}/{date:%d}/{filename}/index.html'
# needed to create blogs page. Do not put the preceeding /blog here because
# that will be added by asf infra when it posts the site
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it is also worth noting here we use this url scheme to preserve old links

Suggested change
# that will be added by asf infra when it posts the site
# (Use this particular URL scheme to maintain link compatibility with older versions of this site)

ARTICLE_URL = '{date:%Y}/{date:%m}/{date:%d}/{filename}'
ARTICLE_SAVE_AS = '{date:%Y}/{date:%m}/{date:%d}/{filename}/index.html'
# Disable all processing of .html files
READERS = { 'html': None, }

Expand Down
Loading