feat(tvix/website): add structured data for search engines

This closes b/303.

Change-Id: Icaeccba23a2590c22106bed6e859ed3188c87a02
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9540
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Autosubmit: tazjin <tazjin@tvl.su>
This commit is contained in:
Vincent Ambo 2023-10-04 23:38:38 +03:00 committed by tazjin
parent cb807ad79b
commit ddbb25e145

View file

@ -1,6 +1,21 @@
{ depot, lib, pkgs, ... }: { depot, lib, pkgs, ... }:
let let
description = "Rust implementation of the purely-functional Nix package manager";
# https://developers.google.com/search/docs/advanced/structured-data/
# https://schema.org/SoftwareApplication
structuredData = {
"@context" = "https://schema.org";
"@type" = "SoftwareApplication";
name = "Tvix";
url = "https://tvix.dev";
abstract = description;
applicationCategory = "DeveloperApplication";
contributor = "https://tvl.fyi";
image = "https://tvix.dev/logo.webp";
};
# All Tvix-related blog posts from the main TVL website # All Tvix-related blog posts from the main TVL website
tvixPosts = builtins.filter tvixPosts = builtins.filter
(post: !(post.draft or false) && (lib.hasInfix "Tvix" post.title)) (post: !(post.draft or false) && (lib.hasInfix "Tvix" post.title))
@ -14,6 +29,13 @@ let
${builtins.readFile ./landing-en.md} ${builtins.readFile ./landing-en.md}
${builtins.concatStringsSep "\n" postListEntries} ${builtins.concatStringsSep "\n" postListEntries}
''; '';
extraHead = ''
<meta name="description" content="${description}">
<script type="application/ld+json">
${builtins.toJSON structuredData}
</script>
'';
}; };
in in