diff options
author | Vincent Ambo <mail@tazj.in> | 2021-11-05T13·19+0100 |
---|---|---|
committer | tazjin <mail@tazj.in> | 2021-11-08T10·39+0000 |
commit | 875ef0a605c298e3033ef950119092d09e21f306 (patch) | |
tree | d81aaa06061953fad90a5b8f165cd31d023c5eb9 /users/tazjin | |
parent | bb980158a785b0ce23d25fa0f74c996311df7a67 (diff) |
fix(web/blog): make base URL configurable for atom feeds r/3025
This was previously hardcoded to tazj.in, which is not going to work of course. Instead it now takes the blog config which has a new baseUrl parameter. For ease of use, the configs of my and the TVL blog have been moved into a location that is accessible in the tree for reuse. Change-Id: I94e71aaa7859db4380eb7013740a17f6b6a02620 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3777 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'users/tazjin')
-rw-r--r-- | users/tazjin/blog/default.nix | 7 | ||||
-rw-r--r-- | users/tazjin/homepage/feed.nix | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/users/tazjin/blog/default.nix b/users/tazjin/blog/default.nix index c65b5cb50bf0..6ac89e46656a 100644 --- a/users/tazjin/blog/default.nix +++ b/users/tazjin/blog/default.nix @@ -5,8 +5,9 @@ with depot.nix.yants; let inherit (builtins) hasAttr filter; - blogConfig = { + config = { name = "tazjin's blog"; + baseUrl = "https://tazj.in/blog"; footer = '' <p class="footer"> @@ -26,12 +27,12 @@ let mkdir -p $out ${lib.concatStringsSep "\n" (map (post: - "cp ${renderPost blogConfig post} $out/${post.key}.html" + "cp ${renderPost config post} $out/${post.key}.html" ) posts)} ''; in { - inherit posts rendered; + inherit posts rendered config; # Generate embeddable nginx configuration for redirects from old post URLs oldRedirects = lib.concatStringsSep "\n" (map (post: '' diff --git a/users/tazjin/homepage/feed.nix b/users/tazjin/homepage/feed.nix index 2c6634e65976..2a033444e8ba 100644 --- a/users/tazjin/homepage/feed.nix +++ b/users/tazjin/homepage/feed.nix @@ -22,7 +22,7 @@ let }; }); - allEntries = (map blog.toFeedEntry depot.users.tazjin.blog.posts) + allEntries = (with depot.users.tazjin.blog; map (blog.toFeedEntry config) posts) ++ (map pageEntryToEntry pageEntries); feed = { |