4
0
Fork 0
Αυτό το commit περιλαμβάνεται σε:
Fanis Dokianakis 2024-08-03 20:11:09 +03:00
γονέας 6881133236
commit e3de307c16
3 αρχεία άλλαξαν με 58 προσθήκες και 0 διαγραφές

2
.gitignore εξωτερικό

@ -1,2 +1,4 @@
output/* output/*
cache/* cache/*
mercury_git/*
mercury

21
build.sh Κανονικό αρχείο

@ -0,0 +1,21 @@
#!/bin/bash
# clone mercury repo
git clone --depth 1 https://github.com/kgaughan/mercury.git mercury_git
# apply patches
cd mercury
for p in ../patches/*.patch; do
git apply ${p}
done
# build
make build
if [ -e mercury ]; then
mv mercury ../
else
exit 1
fi
./mercury --config planet.toml

35
patches/1.patch Κανονικό αρχείο

@ -0,0 +1,35 @@
diff --git a/internal/config.go b/internal/config.go
index 60b6a33..540e0d9 100644
--- a/internal/config.go
+++ b/internal/config.go
@@ -21,7 +21,7 @@ type Config struct {
FeedID string `toml:"feed_id"`
Cache string `toml:"cache"`
Timeout utils.Duration `toml:"timeout"`
- themePath string `toml:"theme"`
+ ThemePath string `toml:"theme"`
Theme fs.FS `toml:"-"`
Output string `toml:"output"`
Feeds []manifest.Feed `toml:"feed"`
@@ -33,7 +33,7 @@ type Config struct {
func (c *Config) Load(path string) error {
c.Name = "Planet"
c.Cache = "./cache"
- c.themePath = ""
+ c.ThemePath = ""
c.Output = "./output"
c.ItemsPerPage = 10
c.MaxPages = 5
@@ -48,10 +48,10 @@ func (c *Config) Load(path string) error {
}
c.Cache = filepath.Join(configDir, c.Cache)
- if c.themePath == "" {
+ if c.ThemePath == "" {
c.Theme = dflt.Theme
} else {
- themePath := filepath.Join(configDir, c.themePath)
+ themePath := filepath.Join(configDir, c.ThemePath)
if _, err := os.Stat(themePath); os.IsNotExist(err) {
return fmt.Errorf("theme %q not found: %w", themePath, err)
}