Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add version #39

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/packages/web/page.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import gleam/json
import gleam/list
import gleam/option
import gleam/order
import gleam/result
import gleam/string
import gleam/string_builder.{type StringBuilder}
import lustre/attribute.{attribute}
Expand Down Expand Up @@ -180,6 +181,11 @@ fn package_list_item(package: PackageSummary) -> Element(Nil) {
|> dict.get("Repository")
|> option.from_result

let latest_version_string = case package.latest_versions |> list.last {
Ok(version) -> " @ v" <> version
Error(_) -> ""
}

let links =
[
package.docs_url
Expand All @@ -195,6 +201,7 @@ fn package_list_item(package: PackageSummary) -> Element(Nil) {
]),
html.h2([attribute.class("package-name")], [
external_link_text(url, package.name),
html.small([], [element.text(latest_version_string)]),
]),
html.p([attribute.class("package-description")], [
element.text(package.description),
Expand Down