You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by ti...@apache.org on 2024/12/07 12:16:42 UTC

(datafusion-site) branch main updated: Adjust site URL to be relative to /blog (#44)

This is an automated email from the ASF dual-hosted git repository.

timsaucer pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-site.git


The following commit(s) were added to refs/heads/main by this push:
     new 6c828f3  Adjust site URL to be relative to /blog (#44)
6c828f3 is described below

commit 6c828f3b03fc6fbeb13ecdb96df3bdeea4220371
Author: Tim Saucer <ti...@gmail.com>
AuthorDate: Sat Dec 7 07:16:38 2024 -0500

    Adjust site URL to be relative to /blog (#44)
    
    * Set relative paths without blog to account for where asf puts the site on the server
    
    * Set github action to put the output into blog subdirectory to match main site
    
    * Set paths back to main
    
    * Update README with instructions on using staged builds
    
    * Fix path to about page
    
    * Add note to readme that the staging feature only works on branches of the main repo, not on branches of forks
    
    ---------
    
    Co-authored-by: Tim Saucer <ti...@maymobility.com>
---
 .github/workflows/stage-site.yml  |  1 +
 README.md                         | 24 +++++++++++++++++++++++-
 content/theme/templates/menu.html |  2 +-
 pelicanconf.py                    |  7 ++++---
 4 files changed, 29 insertions(+), 5 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/README.md b/README.md
index 7c4882b..ee556d9 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,30 @@
 
 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/ It is important
+to note that this staging feature only works for branches on the main repo.
+If you are working on a forked repo, you will need to use the docker approach
+below.
+
+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 +50,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.
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 @@
         <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>
diff --git a/pelicanconf.py b/pelicanconf.py
index ebc16a9..b2ab9d8 100644
--- a/pelicanconf.py
+++ b/pelicanconf.py
@@ -37,9 +37,10 @@ AUTHORS_SAVE_AS = ''
 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, }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org