File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ title : Contributors
3+ desc : A list of Mine in Abyss project contributors
4+ template : contributors
5+ ---
Original file line number Diff line number Diff line change 1+ Developers :
2+ - name : " Offz"
3+ gravatar : 4b5b974e1b62531d62abebe89b6279b122fc02cfcedfa6170d3ba0706e791af1
4+ blurb : This is some text
5+ Builders : []
6+ Artists : []
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import me.dvyy.shocky.page.CommonFrontMatter
1313import me.dvyy.shocky.page.Page
1414import me.dvyy.shocky.shocky
1515import pages.blogIndex
16+ import pages.contributors
1617import pages.gallery
1718import pages.homePage
1819import templates.blogPost
@@ -33,6 +34,7 @@ suspend fun main(args: Array<String>) = shocky {
3334 template(" gallery" , Page ::gallery)
3435 template(" home" , Page ::homePage)
3536 template(" blog" , Page ::blogPost)
37+ template(" contributors" , Page ::contributors)
3638
3739 pages(" ." )
3840
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ inline fun FlowContent.card(
3838 }
3939 }
4040 }
41- if (showContent) div(if (subtitle = = null ) " p-4" else " px-4 pb-4" ) {
41+ if (showContent) div(if (image ! = null ) " p-4" else " px-4 pb-4" ) {
4242 div(" text-sm" ) {
4343 content()
4444 }
Original file line number Diff line number Diff line change 1+ package components
2+
3+ import kotlinx.html.*
4+ import kotlinx.serialization.Serializable
5+ import java.security.MessageDigest
6+ import kotlin.text.Charsets.UTF_8
7+
8+ @Serializable
9+ data class Profile (
10+ val name : String ,
11+ val gravatar : String ,
12+ val blurb : String ,
13+ )
14+
15+ fun FlowContent.contributorCard (profile : Profile ) = with (profile) {
16+
17+ outlined {
18+ div(" not-prose flex flex-row items-center gap-4" ) {
19+ lazyImg(
20+ src = " https://gravatar.com/avatar/$gravatar ?size=256" ,
21+ alt = name,
22+ classes = " w-24 h-24 rounded-l-md"
23+ ) {}
24+ div(" flex flex-col" ) {
25+ h2(" text-xl font-bold" ) { + name }
26+ p(" text-sm" ) { + blurb }
27+ }
28+ }
29+ }
30+ }
31+
32+ object HashUtil {
33+ @OptIn(ExperimentalStdlibApi ::class )
34+ fun hash (input : String ): String {
35+ return MessageDigest .getInstance(" SHA-256" ).digest(input.toByteArray(UTF_8 )).toHexString()
36+ }
37+ }
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ package pages
33import components.card
44import kotlinx.html.div
55import kotlinx.html.h2
6- import kotlinx.html.hr
76import kotlinx.html.p
87import me.dvyy.shocky.page.Page
98import me.dvyy.shocky.page.Pages
@@ -22,10 +21,10 @@ fun Page.blogIndex() = default {
2221 div(" not-prose grid grid-cols-1 gap-4" ) {
2322 posts.sortedByDescending { it.date }.forEach { post ->
2423 card(post.title, url = post.url) {
24+ div(" flex flex-row gap-2 mb-2" ) {
25+ post.tags.forEach { p(" text-xs font-bold uppercase text-stone-400" ) { + it } }
26+ }
2527 p { + (post.desc ? : " " ) }
26- // div("flex") {
27- // post.tags.forEach { p { +it } }
28- // }
2928 }
3029 }
3130 }
Original file line number Diff line number Diff line change 1+ package pages
2+
3+ import com.charleskorn.kaml.Yaml
4+ import com.charleskorn.kaml.decodeFromStream
5+ import components.Profile
6+ import components.contributorCard
7+ import kotlinx.html.div
8+ import kotlinx.html.h2
9+ import me.dvyy.shocky.markdown
10+ import me.dvyy.shocky.page.Page
11+ import templates.default
12+ import kotlin.io.path.Path
13+ import kotlin.io.path.inputStream
14+
15+ fun Page.contributors () = default {
16+ markdown("""
17+ This is a WIP page we hope will showcase the cool people contributing to this project soon!
18+ """ .trimIndent())
19+ val contributors =
20+ Yaml .default.decodeFromStream<Map <String , List <Profile >>>(Path (" site/contributors.yml" ).inputStream())
21+ contributors.forEach { (team, profiles) ->
22+ h2 { + team }
23+ div(" grid grid-cols-1 md:grid-cols-3 gap-4" ) {
24+ for (profile in profiles) contributorCard(profile)
25+ }
26+ }
27+ }
You can’t perform that action at this time.
0 commit comments