Skip to content

Commit

Permalink
improvement: overhaul the front page
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Jul 4, 2023
1 parent 3832da2 commit 798e342
Show file tree
Hide file tree
Showing 9 changed files with 164 additions and 126 deletions.
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
elixir 1.14.0
elixir 1.15.0
nodejs 18.12.0
erlang 25.1.2
erlang 26.0.1
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ defmodule AshHq.Docs.Extensions.RenderMarkdown.Changes.RenderMarkdown do
AshHq.Docs.Extensions.RenderMarkdown.table_of_contents?(changeset.resource)
) do
{:error, html_doc, error_messages} ->
Logger.warn("""
Logger.warning("""
Error while transforming to HTML: #{inspect(error_messages)}
Transforming:
Expand Down
2 changes: 1 addition & 1 deletion lib/ash_hq_web/components/app_view/top_bar.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ defmodule AshHqWeb.Components.AppView.TopBar do
<div
id="top-bar"
class={
"flex justify-between items-center py-4 px-4 h-20 top-0 z-50",
"flex justify-between items-center py-4 px-4 h-20 top-0 z-50 2xl:w-[1500px] self-center",
sticky: @live_action == :docs_dsl,
"border-b border-base-light-300 dark:border-base-dark-700 bg-white dark:bg-base-dark-850":
@live_action == :docs_dsl
Expand Down
28 changes: 28 additions & 0 deletions lib/ash_hq_web/components/feature.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
defmodule AshHqWeb.Components.Feature do
@moduledoc "A feature in the home page feature exposè"
use Surface.Component

import AshHqWeb.Tails

prop name, :string, required: true
prop class, :string, default: nil

slot icon
slot description

def render(assigns) do
~F"""
<div class="flex flex-col items-center">
<div class={classes(["w-16 h-16 text-primary-light-600 dark:text-primary-dark-400", @class])}>
<#slot {@icon} />
</div>
<div class="font-bold text-3xl mt-4">
{@name}
</div>
<div class="text-xl mt-4">
<#slot {@description} />
</div>
</div>
"""
end
end
2 changes: 1 addition & 1 deletion lib/ash_hq_web/pages/docs.ex
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ defmodule AshHqWeb.Pages.Docs do
|> Enum.flat_map(fn mod_name ->
case find_module(libraries, selected_versions, mod_name) do
nil ->
Logger.warn("No such module found called #{inspect(mod_name)}")
Logger.warning("No such module found called #{inspect(mod_name)}")
[]

module ->
Expand Down
223 changes: 113 additions & 110 deletions lib/ash_hq_web/pages/home.ex

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ defmodule AshHq.MixProject do
{:ash_phoenix, github: "ash-project/ash_phoenix", override: true},
{:ash_graphql, github: "ash-project/ash_graphql"},
{:ash_json_api, github: "ash-project/ash_json_api"},
{:gun, "== 2.0.1", env: :prod, hex: "remedy_gun", override: true},
{:ash_authentication, "~> 3.10"},
{:ash_authentication_phoenix, "~> 1.6"},
{:ash_blog, github: "ash-project/ash_blog"},
Expand Down
22 changes: 11 additions & 11 deletions mix.lock

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions priv/scripts/build_dsl_docs.exs
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,12 @@ defmodule Utils do
defp type({:in, choices}), do: Enum.map_join(choices, " | ", &inspect/1)
defp type({:or, subtypes}), do: Enum.map_join(subtypes, " | ", &type/1)
defp type({:list, subtype}), do: type(subtype) <> "[]"

defp type({:wrap_list, subtype}) do
str = type(subtype)
str <> "[] | " <> str
end

defp type({:list_of, subtype}), do: type({:list, subtype})
defp type({:mfa_or_fun, arity}), do: "MFA | function/#{arity}"
defp type(:literal), do: "any literal"
Expand Down

0 comments on commit 798e342

Please sign in to comment.