You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by ti...@apache.org on 2024/03/10 06:16:13 UTC

(comdev-site) branch main updated: fix: defensively access filepath (#161)

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

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


The following commit(s) were added to refs/heads/main by this push:
     new ad3a762a fix: defensively access filepath (#161)
ad3a762a is described below

commit ad3a762aac64bb531751d962b7ee4d6ddf77f00a
Author: tison <wa...@gmail.com>
AuthorDate: Sun Mar 10 14:16:08 2024 +0800

    fix: defensively access filepath (#161)
    
    Signed-off-by: tison <wa...@gmail.com>
---
 .editorconfig                        |  7 +++++++
 README.md                            | 10 +++++-----
 hugo.toml                            |  2 +-
 layouts/partials/website-source.html |  7 +++++--
 4 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 00000000..5694b924
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,7 @@
+root = true
+
+[*]
+end_of_line = lf
+indent_style = space
+insert_final_newline = true
+trim_trailing_whitespace = true
diff --git a/README.md b/README.md
index 669e8721..bd7f3c3f 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,11 @@
-<!--                                                                                                                                                                                                    
+<!--
 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
@@ -30,7 +30,7 @@ Changes to the `main` or `preview/*` branches of this repository trigger the [co
 
 There's currently (April 2020) a lag of about ten minutes for the corresponding Jenkins job to start, if you commit directly to the GitHub repository, but you can also start the job manually if you have the required Jenkins access rights.
 
-For the `main` branch, the generated content is pushed to the `asf-site` branch, and 
+For the `main` branch, the generated content is pushed to the `asf-site` branch, and
 the [ASF's gitpubsub mechanism](https://blogs.apache.org/infra/entry/git_based_websites_available) then synchronizes that content to the live [community.apache.org](https://community.apache.org/) website, usually within a few seconds.
 
 Branches named `preview/<name>` are staged automatically, a branch named `preview/0421b` for example
@@ -51,9 +51,9 @@ You need a recent version of `hugo`, to find out which one is used to deploy thi
 look at the Jenkins build output, linked above.
 
 To generate the static website, execute `hugo` to generate the website under `target/content` and execute
-`npx -y pagefind --source target/content` to index the content for Pagefind (the search bar on the website).
+`npx -y pagefind --site target/content` to index the content for Pagefind (the search bar on the website).
 
 During development, it may be useful to run an incremental build. For this to work, execute
 `hugo server -D -d /tmp/comdev-generated-site` to continuously (re)generate and serve the website on `localhost:1313`
-(-D means include draft pages). In another terminal, execute `npx -y pagefind --source /tmp/comdev-generated-site` to
+(-D means include draft pages). In another terminal, execute `npx -y pagefind --site /tmp/comdev-generated-site` to
 index the site content for Pagefind (the search bar on the website).
diff --git a/hugo.toml b/hugo.toml
index 2fae7c62..1be1a905 100644
--- a/hugo.toml
+++ b/hugo.toml
@@ -9,7 +9,7 @@ disablePathToLower = true
 uglyURLs = true
 enableRobotsTXT = true
 disableBrowserError = true
-timeout = 3000
+timeout = "30s"
 
 ignoreFiles = [ ] # No files to ignore
 
diff --git a/layouts/partials/website-source.html b/layouts/partials/website-source.html
index 3c92acc2..a5605f1f 100644
--- a/layouts/partials/website-source.html
+++ b/layouts/partials/website-source.html
@@ -2,6 +2,9 @@
   This website is generated from the <a href="{{ .Site.Params.repositoryUrl }}">comdev-site repository</a>
   {{ if or .IsPage .IsSection .IsHome }}
     <br/>
-    Source of this page: <a href="{{ .Site.Params.repositoryContentBaseUrl }}/{{ .Page.File.Path }}" title="Source of this page">{{ .Page.File.Path }}</a>
+    Source of this page:
+      <a href="{{ .Site.Params.repositoryContentBaseUrl }}/{{ with .Page.File }}{{ .Path }}{{ end }}" title="Source of this page">
+        {{ with .Page.File }}{{ .Path }}{{ end }}
+      </a>
   {{ end }}
-</p>
\ No newline at end of file
+</p>