Skip to content

Commit

Permalink
Merge pull request #24 from brunojppb/title-meta
Browse files Browse the repository at this point in the history
Add Open Graph tags and document how to use environment variables with Turbo
  • Loading branch information
brunojppb authored Sep 12, 2022
2 parents eaf42eb + acbab4b commit ffd7b5e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
14 changes: 13 additions & 1 deletion lib/turbo_web/templates/layout/root.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@
href={Routes.static_path(@conn, "/images/turbo-racer.svg")}
/>
<title>Turbo Racer</title>
<%= live_title_tag(assigns[:page_title] || "Racer") %>

<meta name="author" content="Bruno Paulino">
<meta name="description" content="High-performance backend for Turborepo cache">
<meta name="keywords" content="monorepo,turborepo,typecript,javascript,ci">

<!-- Open Graph meta properties for beautifully rendering link previews on social -->
<!-- See: https://ogp.me/ -->
<meta property="og:type" content="website" />
<meta property="og:url" content={TurboWeb.Endpoint.url()} />
<meta property="og:title" content="Turbo Racer" />
<meta property="og:description" content="High-performance backend for Turborepo cache" />
<meta property="og:image" content={Routes.static_url(@conn, "/images/turbo_racer_cover.jpg")} />

<link phx-track-static rel="stylesheet" href={Routes.static_path(@conn, "/assets/app.css")} />
<script
defer
Expand Down
10 changes: 9 additions & 1 deletion lib/turbo_web/templates/team_token/index.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,18 @@
<%= if Enum.empty?(@tokens) do %>
<p>There are no tokens for this team yet. Please add one.</p>
<% else %>
<p>Usage with Turborepo:</p>
<p class="m-2">Usage with Turborepo:</p>
<code class="block overflow-x-scroll whitespace-pre rounded-lg bg-slate-200">
turbo run build --api="<%= TurboWeb.Endpoint.url() %>" --token="TOKEN_HERE" --team="<%= @team.name %>"
</code>

<p class="mt-4 mb-2">Alternatively, you can export these as environment variables. It will be picked up by Turborepo automatically:</p>
<code class="block overflow-x-scroll whitespace-pre rounded-lg bg-slate-200">
export TURBO_API="<%= TurboWeb.Endpoint.url() %>"
export TURBO_TEAM="<%= @team.name %>"
export TURBO_TOKEN="TOKEN_HERE"
</code>

<p class="mt-2 text-sm text-slate-500">
For more information about remote caching, take a look at the turborepo docs <a class="underline" href="https://turborepo.org/docs/core-concepts/remote-caching#custom-remote-caches" target="_blank">here</a>.
</p>
Expand Down
Binary file added priv/static/images/turbo_racer_cover.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ffd7b5e

Please sign in to comment.