-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Share HTML template renderers and create a watcher framework #20218
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
Merged
zeripath
merged 28 commits into
go-gitea:main
from
zeripath:load-templates-once-and-better-reload
Aug 28, 2022
Merged
Changes from 9 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
1409281
Share HTML template renderers and create a watcher framework
zeripath 07dc4f2
placate lint
zeripath f265ce5
fix windows
zeripath 726bf7c
Merge branch 'main' into load-templates-once-and-better-reload
zeripath aa90128
Init needs a ctx
zeripath 0209fa4
make SSPI also share the templates too
zeripath a04e94a
Merge branch 'main' into load-templates-once-and-better-reload
zeripath 7dd067b
Merge branch 'main' into load-templates-once-and-better-reload
zeripath f61f79c
Merge branch 'main' into load-templates-once-and-better-reload
zeripath cbdc8bc
use todo only
zeripath 9e63150
Merge branch 'main' into load-templates-once-and-better-reload
zeripath 1159e0f
Merge branch 'main' into load-templates-once-and-better-reload
zeripath 959595b
Switch to use syncthing/notify instead of fsnotify/fsnotify
zeripath aca2416
Merge remote-tracking branch 'origin/main' into load-templates-once-a…
zeripath 426eb8f
Revert "Switch to use syncthing/notify instead of fsnotify/fsnotify"
zeripath f3b8468
Merge branch 'main' into load-templates-once-and-better-reload
zeripath eb8cf0f
Merge remote-tracking branch 'origin/main' into load-templates-once-a…
zeripath 408a726
Merge branch 'main' into load-templates-once-and-better-reload
zeripath ab27d13
Merge branch 'main' into load-templates-once-and-better-reload
zeripath bfab646
Merge remote-tracking branch 'origin/main' into load-templates-once-a…
zeripath 3841573
as per review
zeripath 2dbfc50
Fix tests
zeripath 0ff8921
placate lint
zeripath a442905
Merge branch 'main' into load-templates-once-and-better-reload
zeripath c5bdfef
Update modules/templates/htmlrenderer.go
zeripath 55c4ec6
placate lint
zeripath f7a5cd7
as per wxiaoguang
zeripath aec5c2f
Merge remote-tracking branch 'origin/main' into load-templates-once-a…
zeripath File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2022 The Gitea Authors. All rights reserved. | ||
// Use of this source code is governed by a MIT-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package options | ||
|
||
import ( | ||
"fmt" | ||
"io/fs" | ||
"os" | ||
"path/filepath" | ||
) | ||
|
||
func walkAssetDir(root string, callback func(path, name string, d fs.DirEntry, err error) error) error { | ||
if err := filepath.WalkDir(root, func(path string, d fs.DirEntry, err error) error { | ||
name := path[len(root):] | ||
zeripath marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if len(name) > 0 && name[0] == '/' { | ||
name = name[1:] | ||
} | ||
if err != nil { | ||
zeripath marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if os.IsNotExist(err) { | ||
return callback(path, name, d, err) | ||
} | ||
return err | ||
} | ||
if d.Name() == ".DS_Store" && d.IsDir() { // Because Macs... | ||
return fs.SkipDir | ||
} | ||
return callback(path, name, d, err) | ||
}); err != nil && !os.IsNotExist(err) { | ||
return fmt.Errorf("unable to get files for assets in %s: %w", root, err) | ||
} | ||
return nil | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.