Skip to content

Commit

Permalink
fix: defensively access filepath (#161)
Browse files Browse the repository at this point in the history
Signed-off-by: tison <wander4096@gmail.com>
  • Loading branch information
tisonkun authored Mar 10, 2024
1 parent 050ca22 commit ad3a762
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
root = true

[*]
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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).
2 changes: 1 addition & 1 deletion hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ disablePathToLower = true
uglyURLs = true
enableRobotsTXT = true
disableBrowserError = true
timeout = 3000
timeout = "30s"

ignoreFiles = [ ] # No files to ignore

Expand Down
7 changes: 5 additions & 2 deletions layouts/partials/website-source.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
</p>

0 comments on commit ad3a762

Please sign in to comment.