ExtraStatic: powerful and easy publishing

Skip to content

Fix contributors

Chris Dawson requested to merge fix_contributors into main

This enables contributor badges.

contributors

To enable contributors, use an override, probably by adding to src/Postroll.svelte.

<script>
  import Contributors from '$svekyll/Contributors.svelte';  
</script>

<Contributors/>

Then, enable contributor badges in the _config.yml like this:

contributors:
  enabled: true
  message: "These people reviewed this post, thanks!"
  show_gravatars: true
  list_names: true

The items are wrapped in classes which you can override in your user.css

  .svekyll-contributor-names {
    @apply text-xs text-gray-400;
  }
  .svekyll-contributor-offset {
    @apply -inset-x-4;
    position: relative;
  }
  .svekyll-contributor {
    @apply w-12 h-12 rounded-full relative inline-block;
  }

  .svekyll-contributor-list-names {
    @appply italic;
  }

That will then scan your git repository for authors, md5 their email address to obscure them, and place gravatars or their names into your blog.

TODO:

  • Actually pull from git. Right now this relies on CONTRIBUTORS as an env var (like this: CONTRIBUTORS='[ "Chris Dawson:xrdawson@gmail.com", "Bob Johnson:bob@bob.com", "Fooey Foo:foo@foo.com" ]' node $(which yarn) build
  • Actually create a unique CONTRIBUTORS env var for each post, don't use the same one for every post.
  • Fix alignment of gravatars. The third one in the image does not have the correct offset.
Edited by Chris Dawson

Merge request reports

Loading