From 3d9376842a3de0a759e08e838ee5c49035977a22 Mon Sep 17 00:00:00 2001 From: Tim Saucer Date: Fri, 6 Dec 2024 17:43:16 -0500 Subject: [PATCH 1/6] Set relative paths without blog to account for where asf puts the site on the server --- .asf.yaml | 1 + pelicanconf.py | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.asf.yaml b/.asf.yaml index 7ee5b83..f6a2fe0 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -51,3 +51,4 @@ staging: whoami: asf-staging profile: ~ autostage: site/* + subdir: blog diff --git a/pelicanconf.py b/pelicanconf.py index ebc16a9..9c87195 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -3,8 +3,8 @@ SITENAME = 'Apache DataFusion Blog' SITEDESC = 'The official new and blog for the Apache DataFusion project' SITEDOMAIN = 'datafusion.apache.org' -SITEURL = 'https://datafusion.apache.org/blog' -SITELOGO = 'https://datafusion.apache.org/favicon.ico' +SITEURL = 'https://datafusion.staged.apache.org' +SITELOGO = 'https://datafusion.staged.apache.org/favicon.ico' SITEREPOSITORY = 'https://github.com/apache/datafusion-site/blob/main/content/' CURRENTYEAR = datetime.date.today().year TRADEMARKS = 'Apache HTTP Server, Apache, and the Apache feather logo are trademarks of The Apache Software Foundation.' @@ -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 +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, } @@ -62,7 +63,7 @@ # blogs/README.md is not intended for publication IGNORE_FILES = [ 'theme', 'README.md' ] -FEED_RSS = "blog/feed.xml" +FEED_RSS = "feed.xml" MARKDOWN = { 'extension_configs': { From 57068dcacb9e73bfa50f867e1b31820141e8c614 Mon Sep 17 00:00:00 2001 From: Tim Saucer Date: Fri, 6 Dec 2024 18:19:18 -0500 Subject: [PATCH 2/6] Set github action to put the output into blog subdirectory to match main site --- .github/workflows/stage-site.yml | 1 + pelicanconf.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stage-site.yml b/.github/workflows/stage-site.yml index 80ef6fc..4b50cdf 100644 --- a/.github/workflows/stage-site.yml +++ b/.github/workflows/stage-site.yml @@ -20,3 +20,4 @@ jobs: with: destination: 'asf-staging' gfm: 'false' + output: 'blog' diff --git a/pelicanconf.py b/pelicanconf.py index 9c87195..424ade7 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -3,8 +3,8 @@ SITENAME = 'Apache DataFusion Blog' SITEDESC = 'The official new and blog for the Apache DataFusion project' SITEDOMAIN = 'datafusion.apache.org' -SITEURL = 'https://datafusion.staged.apache.org' -SITELOGO = 'https://datafusion.staged.apache.org/favicon.ico' +SITEURL = 'https://datafusion.apache.org' +SITELOGO = 'https://datafusion.apache.org/favicon.ico' SITEREPOSITORY = 'https://github.com/apache/datafusion-site/blob/main/content/' CURRENTYEAR = datetime.date.today().year TRADEMARKS = 'Apache HTTP Server, Apache, and the Apache feather logo are trademarks of The Apache Software Foundation.' From 7544bf2a2c9a1395d21a80c8da858e0f90778ad7 Mon Sep 17 00:00:00 2001 From: Tim Saucer Date: Fri, 6 Dec 2024 18:32:12 -0500 Subject: [PATCH 3/6] Set paths back to main --- .asf.yaml | 1 - pelicanconf.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.asf.yaml b/.asf.yaml index f6a2fe0..7ee5b83 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -51,4 +51,3 @@ staging: whoami: asf-staging profile: ~ autostage: site/* - subdir: blog diff --git a/pelicanconf.py b/pelicanconf.py index 424ade7..b2ab9d8 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -3,7 +3,7 @@ SITENAME = 'Apache DataFusion Blog' SITEDESC = 'The official new and blog for the Apache DataFusion project' SITEDOMAIN = 'datafusion.apache.org' -SITEURL = 'https://datafusion.apache.org' +SITEURL = 'https://datafusion.apache.org/blog' SITELOGO = 'https://datafusion.apache.org/favicon.ico' SITEREPOSITORY = 'https://github.com/apache/datafusion-site/blob/main/content/' CURRENTYEAR = datetime.date.today().year @@ -63,7 +63,7 @@ # blogs/README.md is not intended for publication IGNORE_FILES = [ 'theme', 'README.md' ] -FEED_RSS = "feed.xml" +FEED_RSS = "blog/feed.xml" MARKDOWN = { 'extension_configs': { From 2c494ac7957bfe4b4f93c38eb1fff7e23f68c1e0 Mon Sep 17 00:00:00 2001 From: Tim Saucer Date: Fri, 6 Dec 2024 18:45:06 -0500 Subject: [PATCH 4/6] Update README with instructions on using staged builds --- README.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7c4882b..3b95706 100644 --- a/README.md +++ b/README.md @@ -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 +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 @@ -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. From 2d88cac8049a3ab1b6c2a6655c8159a5b45c88aa Mon Sep 17 00:00:00 2001 From: Tim Saucer Date: Fri, 6 Dec 2024 18:48:06 -0500 Subject: [PATCH 5/6] Fix path to about page --- content/theme/templates/menu.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/theme/templates/menu.html b/content/theme/templates/menu.html index 742f5a4..916461d 100644 --- a/content/theme/templates/menu.html +++ b/content/theme/templates/menu.html @@ -9,7 +9,7 @@