-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: start working on a contributors page
- Loading branch information
Showing
7 changed files
with
81 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: Contributors | ||
desc: A list of Mine in Abyss project contributors | ||
template: contributors | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Developers: | ||
- name: "Offz" | ||
gravatar: 4b5b974e1b62531d62abebe89b6279b122fc02cfcedfa6170d3ba0706e791af1 | ||
blurb: This is some text | ||
Builders: [] | ||
Artists: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package components | ||
|
||
import kotlinx.html.* | ||
import kotlinx.serialization.Serializable | ||
import java.security.MessageDigest | ||
import kotlin.text.Charsets.UTF_8 | ||
|
||
@Serializable | ||
data class Profile( | ||
val name: String, | ||
val gravatar: String, | ||
val blurb: String, | ||
) | ||
|
||
fun FlowContent.contributorCard(profile: Profile) = with(profile) { | ||
|
||
outlined { | ||
div("not-prose flex flex-row items-center gap-4") { | ||
lazyImg( | ||
src = "https://gravatar.com/avatar/$gravatar?size=256", | ||
alt = name, | ||
classes = "w-24 h-24 rounded-l-md" | ||
) {} | ||
div("flex flex-col") { | ||
h2("text-xl font-bold") { +name } | ||
p("text-sm") { +blurb } | ||
} | ||
} | ||
} | ||
} | ||
|
||
object HashUtil { | ||
@OptIn(ExperimentalStdlibApi::class) | ||
fun hash(input: String): String { | ||
return MessageDigest.getInstance("SHA-256").digest(input.toByteArray(UTF_8)).toHexString() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package pages | ||
|
||
import com.charleskorn.kaml.Yaml | ||
import com.charleskorn.kaml.decodeFromStream | ||
import components.Profile | ||
import components.contributorCard | ||
import kotlinx.html.div | ||
import kotlinx.html.h2 | ||
import me.dvyy.shocky.markdown | ||
import me.dvyy.shocky.page.Page | ||
import templates.default | ||
import kotlin.io.path.Path | ||
import kotlin.io.path.inputStream | ||
|
||
fun Page.contributors() = default { | ||
markdown(""" | ||
This is a WIP page we hope will showcase the cool people contributing to this project soon! | ||
""".trimIndent()) | ||
val contributors = | ||
Yaml.default.decodeFromStream<Map<String, List<Profile>>>(Path("site/contributors.yml").inputStream()) | ||
contributors.forEach { (team, profiles) -> | ||
h2 { +team } | ||
div("grid grid-cols-1 md:grid-cols-3 gap-4") { | ||
for (profile in profiles) contributorCard(profile) | ||
} | ||
} | ||
} |