diff --git a/.gitignore b/.gitignore index e3e5aba..5e780f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ output/* cache/* +mercury_git/* +mercury diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..1a37734 --- /dev/null +++ b/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 diff --git a/patches/1.patch b/patches/1.patch new file mode 100644 index 0000000..e1d4f0c --- /dev/null +++ b/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) + }