mirror of
https://github.com/daylinmorgan/nimpkgs.git
synced 2024-12-21 18:50:43 -06:00
add fun fact to homepage
This commit is contained in:
parent
81cfcaea17
commit
77dbe8af05
1 changed files with 18 additions and 4 deletions
|
@ -1,12 +1,27 @@
|
|||
import std/[sequtils, strutils, strformat]
|
||||
import karax/[karaxdsl, vdom]
|
||||
|
||||
import ../components/[search, tag, package]
|
||||
import ../context
|
||||
|
||||
# TODO: add more "fun" facts?
|
||||
proc getFact(): string =
|
||||
let nPackages = nimpkgsList().filterIt("nim" in toLowerAscii($it.name)).len()
|
||||
result = fmt"Currently {nPackages} packages use the word nim!"
|
||||
|
||||
proc funFact(): VNode =
|
||||
buildHtml(tdiv):
|
||||
span(class = "font-bold"): text "Fun Fact"
|
||||
text ": "
|
||||
text getFact()
|
||||
|
||||
|
||||
proc render*(): VNode =
|
||||
result = buildHtml(tdiv(class = "justify-center")):
|
||||
tdiv(class = "flex flex-col space-y-5"):
|
||||
tdiv(class = "md:text-4xl text-2xl font-bold font-mono-casual text-center"):
|
||||
text "discover Nim's ecosystem of third-party libraries and tools"
|
||||
tdiv(class = "text-center"):
|
||||
tdiv(class = "md:text-4xl text-2xl font-bold font-mono-casual my-1"):
|
||||
text "discover Nim's ecosystem of third-party libraries and tools"
|
||||
funFact()
|
||||
tdiv(class = "grow md:w-4/5 mx-auto"):
|
||||
tdiv(class = "flex flex-col md:flex-row grow"):
|
||||
searchBar()
|
||||
|
@ -19,4 +34,3 @@ proc render*(): VNode =
|
|||
tdiv():
|
||||
tdiv(): text "recently released versions:"
|
||||
recentPackageVersionsList()
|
||||
|
||||
|
|
Loading…
Reference in a new issue