Phase 0: turn Supermarket into a Dockerized local web app
Replace the old Go TUI with a web app (port 8470) that runs in a container as a CoreDesktop sibling: - cmd/supermarket server with htmx web UI: dashboard, company profile, inventory (partners/competitors), AI and credential settings, and a Core & Hermes page - SQLite storage and a secrets store under ~/.local/share/supermarket - AI providers (Anthropic, OpenAI-compatible) behind one interface - MCP server and a Hermes bridge to the Federated Core MCP hub - Import of the old Coremarketing TUI's state - install.sh / update.sh / lib.sh, Dockerfile, compose.yaml, the bin/supermarket launcher and hermes/setup.sh Posting is not wired back up yet; that comes in Phase 1. See PLAN.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
{{define "content"}}{{with .Data}}{{$cfg := .Cfg}}
|
||||
<nav class="tabs">
|
||||
<a href="/settings/ai" aria-current="page">AI provider</a>
|
||||
<a href="/settings/credentials">Credentials</a>
|
||||
</nav>
|
||||
<h1>AI provider</h1>
|
||||
|
||||
<form method="post" action="/settings/ai" id="ai-form">
|
||||
<section class="card">
|
||||
<fieldset class="choice">
|
||||
<legend>Provider</legend>
|
||||
<label class="check"><input type="radio" name="provider" value="anthropic" {{if ne $cfg.Provider "openai"}}checked{{end}} data-toggle="provider">
|
||||
Anthropic (Claude) {{if not .HasAnthropicKey}}<span class="help">— add the API key under <a href="/settings/credentials">Credentials</a></span>{{end}}</label>
|
||||
<label class="check"><input type="radio" name="provider" value="openai" {{if eq $cfg.Provider "openai"}}checked{{end}} data-toggle="provider">
|
||||
A server on your network (Ollama, LM Studio, llama.cpp, vLLM) or another OpenAI-compatible service</label>
|
||||
</fieldset>
|
||||
|
||||
<div data-show-for="openai">
|
||||
<label>Server address <input name="base_url" id="base_url" value="{{$cfg.BaseURL}}" placeholder="http://192.168.1.20:11434" list="servers">
|
||||
<span class="help">Supermarket runs in Docker: for a server on this computer use <code>http://host.docker.internal:11434</code>, and use an IP address rather than a <code>.local</code> name.</span></label>
|
||||
<datalist id="servers">{{range .Servers}}<option value="{{.BaseURL}}">{{.Name}}</option>{{end}}</datalist>
|
||||
{{if .Servers}}<p class="help">Found by CoreDesktop's <code>configure ai-servers</code>: {{range $i, $s := .Servers}}{{if $i}}, {{end}}{{$s.Name}} ({{$s.BaseURL}}){{end}}.</p>{{end}}
|
||||
<button type="button" class="secondary" hx-get="/settings/ai/models" hx-include="#base_url" hx-target="#model-list">List its models</button>
|
||||
<div id="model-list"></div>
|
||||
</div>
|
||||
|
||||
<label>Model <input name="model" value="{{$cfg.Model}}" list="anthropic-models" required></label>
|
||||
<datalist id="anthropic-models">{{range .AnthropicModels}}<option value="{{.}}">{{end}}</datalist>
|
||||
|
||||
<label data-show-for="anthropic">Effort
|
||||
<select name="effort">
|
||||
{{range .Efforts}}<option value="{{.}}" {{if eq $cfg.Effort .}}selected{{end}}>{{.}}</option>{{end}}
|
||||
</select>
|
||||
<span class="help">How hard the model thinks. Medium suits drafting; higher costs more and takes longer.</span>
|
||||
</label>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<h2>Model per task</h2>
|
||||
<p class="help">Leave empty to use the model above. Same provider.</p>
|
||||
{{range .Tasks}}
|
||||
<label>{{.Label}} <input name="task_{{.ID}}" value="{{index $cfg.TaskModels .ID}}" list="anthropic-models"></label>
|
||||
{{end}}
|
||||
</section>
|
||||
|
||||
<div class="actions">
|
||||
<button type="submit">Save</button>
|
||||
<button type="button" class="secondary" hx-post="/settings/ai/test" hx-include="#ai-form" hx-target="#test-result" hx-indicator="#testing">Test</button>
|
||||
<span id="testing" class="htmx-indicator">Asking the model…</span>
|
||||
</div>
|
||||
<div id="test-result"></div>
|
||||
</form>
|
||||
{{end}}{{end}}
|
||||
|
||||
{{define "test-result"}}
|
||||
{{if .Error}}<p class="error">{{.Error}}</p>
|
||||
{{else}}<p class="flash">The model answered in {{.Took}}: “{{.Reply}}”</p>{{end}}
|
||||
{{end}}
|
||||
|
||||
{{define "model-list"}}
|
||||
{{if .Error}}<p class="error">{{.Error}}</p>
|
||||
{{else if .Models}}<p class="help">Models on this server (click one to use it):</p>
|
||||
<ul class="pills">{{range .Models}}<li><button type="button" class="pill" data-fill="model" data-value="{{.}}">{{.}}</button></li>{{end}}</ul>
|
||||
{{else}}<p class="help">The server has no models.</p>{{end}}
|
||||
{{end}}
|
||||
@@ -0,0 +1,53 @@
|
||||
{{define "content"}}{{with .Data}}
|
||||
<h1>Core & Hermes</h1>
|
||||
|
||||
<section class="card">
|
||||
<h2>Federated Core</h2>
|
||||
{{if .Core}}
|
||||
<p><strong>{{.Core.Domain}}</strong> · {{.Core.Email}}{{if .Core.Name}} · {{.Core.Name}}{{end}}</p>
|
||||
<p class="help">From CoreDesktop's <code>configure core</code>. To use another Core, change it there and run <code>update</code>.</p>
|
||||
<div hx-get="/core/checks" hx-trigger="load" hx-swap="outerHTML"><p class="help">Checking the Core's services…</p></div>
|
||||
{{else}}
|
||||
<p>No Core found. Run <code>configure core</code> in CoreDesktop, then <code>update</code>. Without a Core, everything works except EspoCRM, Plausible and publishing through Gitea.</p>
|
||||
{{end}}
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<h2>Hermes bridge</h2>
|
||||
<p>Hermes, CoreDesktop's agent, is the only thing that talks to your Core's MCP hub. It reaches Supermarket at <code>{{.MCPURL}}</code>.</p>
|
||||
{{with .Last}}
|
||||
<p class="ok">Hermes last checked in {{ago .At}}{{if .Note}}: “{{.Note}}”{{end}}.</p>
|
||||
{{if .MCPHubTools}}
|
||||
<details><summary>It can use {{len .MCPHubTools}} tools from the MCP hub</summary>
|
||||
<ul class="pills">{{range .MCPHubTools}}<li><span class="pill">{{.}}</span></li>{{end}}</ul>
|
||||
</details>
|
||||
{{else}}<p class="warn-text">It reported no tools from the MCP hub: check the hub's address and password.</p>{{end}}
|
||||
{{else}}
|
||||
<p>Hermes hasn't checked in yet.</p>
|
||||
{{end}}
|
||||
|
||||
<h3>Test the bridge</h3>
|
||||
<p>Ask Hermes this, in its terminal or through Matrix:</p>
|
||||
<div class="copy"><pre id="prompt">{{.Prompt}}</pre><button type="button" class="secondary" data-copy="prompt">Copy</button></div>
|
||||
<p class="help">Then reload this page.</p>
|
||||
</section>
|
||||
|
||||
<details class="card">
|
||||
<summary>Set up Hermes by hand</summary>
|
||||
<p><code>install.sh</code> does this for you. To do it yourself, add this to <code>~/.hermes/config.yaml</code>:</p>
|
||||
<div class="copy"><pre id="hermes-config">{{.HermesConfig}}</pre><button type="button" class="secondary" data-copy="hermes-config">Copy</button></div>
|
||||
<p>and this to <code>~/.hermes/.env</code>, so no password is in <code>config.yaml</code>:</p>
|
||||
<pre>{{.HermesEnv}}</pre>
|
||||
<p>Hermes runs in CoreDesktop's sandbox, so also let it reach both servers: add <code>mcphub.{{if .Core}}{{.Core.Domain}}{{else}}<your Core's domain>{{end}}</code> and <code>127.0.0.1:8470</code> to <code>network.allowedDomains</code> in <code>~/.config/coredesktop/sandbox/hermes.json</code>. Then restart Hermes' gateway: <code>systemctl --user restart hermes-gateway</code>.</p>
|
||||
<details><summary>Show the MCP token</summary><pre>{{.MCPToken}}</pre><p class="help">Also in <code>mcp-token</code> in the data folder.</p></details>
|
||||
</details>
|
||||
{{end}}{{end}}
|
||||
|
||||
{{define "checks"}}
|
||||
{{if .}}
|
||||
<ul class="checks">
|
||||
{{range .}}<li class="{{if .OK}}ok{{else}}bad{{end}}"><strong>{{.Name}}</strong> <code>{{.URL}}</code> {{.Status}}</li>{{end}}
|
||||
</ul>
|
||||
<p class="help">These are the usual addresses on a Federated Core.</p>
|
||||
{{end}}
|
||||
{{end}}
|
||||
@@ -0,0 +1,44 @@
|
||||
{{define "content"}}{{with .Data}}{{$set := .Set}}
|
||||
<nav class="tabs">
|
||||
<a href="/settings/ai">AI provider</a>
|
||||
<a href="/settings/credentials" aria-current="page">Credentials</a>
|
||||
</nav>
|
||||
<h1>Credentials</h1>
|
||||
<p class="lede">Kept in <code>secrets.json</code> in Supermarket's data folder, readable only by you. Saved values are never shown: leave a field empty to keep what's saved.</p>
|
||||
|
||||
<form method="post" action="/settings/credentials">
|
||||
{{$group := ""}}
|
||||
{{range .Fields}}
|
||||
{{if ne .Group $group}}{{if $group}}</section>{{end}}{{$group = .Group}}<section class="card"><h2>{{.Group}}</h2>{{end}}
|
||||
<div class="secret">
|
||||
<label>{{.Label}}
|
||||
<input type="password" name="{{.Name}}" autocomplete="off" placeholder="{{if index $set .Name}}saved — type to replace{{else}}not set{{end}}">
|
||||
{{if .Help}}<span class="help">{{.Help}}</span>{{end}}
|
||||
</label>
|
||||
{{if index $set .Name}}<label class="check small"><input type="checkbox" name="remove:{{.Name}}"> remove</label>{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{if $group}}</section>{{end}}
|
||||
<div class="actions"><button type="submit">Save</button></div>
|
||||
</form>
|
||||
|
||||
<section class="card">
|
||||
<h2>Sign in to post</h2>
|
||||
<div class="connect">
|
||||
<div>
|
||||
<h3>X</h3>
|
||||
{{with index .Connections "x"}}{{if .Account}}<p>Connected as @{{.Account}}, {{ago .At}}.</p>{{end}}{{end}}
|
||||
{{if and (index $set .XToken) (not (index .Connections "x").Account)}}<p>A token is saved.</p>{{end}}
|
||||
<p class="help">In the X developer portal, add this callback URL to your app: <code>{{.XRedirect}}</code></p>
|
||||
<form method="post" action="/auth/x/start"><button type="submit" {{if not (index $set "x.client_id")}}disabled{{end}}>{{if index $set .XToken}}Reconnect{{else}}Connect{{end}} X</button></form>
|
||||
</div>
|
||||
<div>
|
||||
<h3>LinkedIn</h3>
|
||||
{{with index .Connections "linkedin"}}{{if .Account}}<p>Connected, {{ago .At}}.</p>{{end}}{{end}}
|
||||
{{if and (index $set .LIToken) (not (index .Connections "linkedin").Account)}}<p>A token is saved.</p>{{end}}
|
||||
<p class="help">In your LinkedIn app's Auth settings, add this redirect URL: <code>{{.LIRedirect}}</code></p>
|
||||
<form method="post" action="/auth/linkedin/start"><button type="submit" {{if not (and (index $set "linkedin.client_id") (index $set "linkedin.client_secret"))}}disabled{{end}}>{{if index $set .LIToken}}Reconnect{{else}}Connect{{end}} LinkedIn</button></form>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{end}}{{end}}
|
||||
@@ -0,0 +1,39 @@
|
||||
{{define "content"}}{{with .Data}}
|
||||
<h1>Overview</h1>
|
||||
|
||||
<section class="card">
|
||||
<h2>Setup</h2>
|
||||
<ul class="steps">
|
||||
{{range .Steps}}
|
||||
<li class="{{if .Done}}done{{else}}todo{{end}}">
|
||||
<a href="{{.Link}}"><strong>{{.Label}}</strong></a>
|
||||
<span>{{.Detail}}</span>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
{{if .ImportErr}}
|
||||
<section class="card warn">
|
||||
<h2>Import from the old app failed</h2>
|
||||
<p>{{.ImportErr}}</p>
|
||||
<p>The old files are untouched in the data folder's <code>import/</code> directory. Fix the file named above and restart Supermarket (<code>supermarket restart</code>) to try again.</p>
|
||||
</section>
|
||||
{{else if .ImportStatus}}
|
||||
<details class="card">
|
||||
<summary>Imported from the old terminal app {{ago .ImportStatus.At}}</summary>
|
||||
<ul>{{range .ImportStatus.Summary}}<li>{{.}}</li>{{end}}</ul>
|
||||
{{if .QueuedPosts}}<p>{{.QueuedPosts}} queued posts are kept for the Content module (Phase 1).</p>{{end}}
|
||||
</details>
|
||||
{{end}}
|
||||
|
||||
<h2>Modules</h2>
|
||||
<div class="grid">
|
||||
{{range .Modules}}
|
||||
<section class="card module">
|
||||
<h3>{{.Name}} <span class="badge">{{.Phase}}</span></h3>
|
||||
<p>{{.Body}}</p>
|
||||
</section>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}{{end}}
|
||||
@@ -0,0 +1,51 @@
|
||||
{{define "content"}}{{with .Data}}{{$e := .E}}
|
||||
<p><a href="/inventory">← Inventory</a></p>
|
||||
<h1>{{if $e.ID}}{{$e.Name}}{{else}}New entry{{end}}</h1>
|
||||
|
||||
<form method="post" action="/inventory/save">
|
||||
<input type="hidden" name="id" value="{{$e.ID}}">
|
||||
<section class="card">
|
||||
<div class="cols">
|
||||
<label>Name <input name="name" value="{{$e.Name}}" required></label>
|
||||
<label>Relationship
|
||||
<select name="relationship">
|
||||
{{range .Relationships}}<option value="{{.}}" {{if eq $e.Relationship .}}selected{{end}}>{{.}}</option>{{end}}
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
<label>Description <textarea name="description" rows="2">{{$e.Description}}</textarea></label>
|
||||
<label>Talking points <textarea name="talking_points" rows="4">{{$e.TalkingPoints}}</textarea>
|
||||
<span class="help">Partners: how you work together. Competitors: how you differ, where you win, and what not to claim.</span></label>
|
||||
<label>Naming them in posts (competitors only)
|
||||
<select name="mention_policy">
|
||||
<option value="category" {{if ne $e.MentionPolicy "name"}}selected{{end}}>Don't name them; talk about the category</option>
|
||||
<option value="name" {{if eq $e.MentionPolicy "name"}}selected{{end}}>Posts may name them</option>
|
||||
</select>
|
||||
</label>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<h2>Where to watch them</h2>
|
||||
<div class="cols">
|
||||
<label>X handle <input name="twitter_handle" value="{{$e.TwitterHandle}}" placeholder="without @"></label>
|
||||
<label>YouTube channel ID <input name="youtube_channel_id" value="{{$e.YouTubeChannelID}}" placeholder="UC…"></label>
|
||||
<label>Instagram handle <input name="instagram_handle" value="{{$e.InstagramHandle}}"></label>
|
||||
<label>LinkedIn page <input name="linkedin" value="{{$e.LinkedIn}}"></label>
|
||||
<label>Websites <textarea name="websites" rows="3">{{lines $e.Websites}}</textarea><span class="help">One per line.</span></label>
|
||||
<label>RSS or Atom feeds <textarea name="rss" rows="3">{{lines $e.RSS}}</textarea><span class="help">One per line.</span></label>
|
||||
<label>Subreddits <textarea name="subreddits" rows="3">{{lines $e.Subreddits}}</textarea><span class="help">One per line, without r/.</span></label>
|
||||
<label>Hashtags <input name="hashtags" value="{{join $e.Hashtags " "}}" placeholder="#Example #OpenSource"></label>
|
||||
</div>
|
||||
<label>Keywords <textarea name="keywords" rows="3">{{lines $e.Keywords}}</textarea>
|
||||
<span class="help">Terms they own or compete on, one per line.</span></label>
|
||||
</section>
|
||||
|
||||
<div class="actions"><button type="submit">Save</button></div>
|
||||
</form>
|
||||
|
||||
{{if $e.ID}}
|
||||
<form method="post" action="/inventory/{{$e.ID}}/delete" class="danger-zone" data-confirm="Delete {{$e.Name}} from the inventory?">
|
||||
<button type="submit" class="danger">Delete {{$e.Name}}</button>
|
||||
</form>
|
||||
{{end}}
|
||||
{{end}}{{end}}
|
||||
@@ -0,0 +1,33 @@
|
||||
{{define "content"}}{{with .Data}}
|
||||
<p><a href="/inventory">← Inventory</a></p>
|
||||
<h1>Import inventory</h1>
|
||||
|
||||
{{with .Result}}
|
||||
<section class="card {{if .Errors}}warn{{end}}">
|
||||
<p>{{.Added}} added, {{.Updated}} updated, {{.Skipped}} skipped (already in the inventory).</p>
|
||||
{{if .Errors}}<ul>{{range .Errors}}<li>{{.}}</li>{{end}}</ul>{{end}}
|
||||
<p><a href="/inventory">See the inventory</a></p>
|
||||
</section>
|
||||
{{end}}
|
||||
|
||||
<form class="card" method="post" action="/inventory/import" enctype="multipart/form-data">
|
||||
<p>YAML: a list of entries, or a document with an <code>inventory:</code> list. The old app's <code>config.yaml</code> works too (its <code>applications:</code> list).</p>
|
||||
<label>Paste <textarea name="yaml" rows="12" placeholder="inventory:
|
||||
- name: Example
|
||||
relationship: competitor
|
||||
twitter_handle: example
|
||||
hashtags: ['#Example']">{{.YAML}}</textarea></label>
|
||||
<label>…or choose a file <input type="file" name="file" accept=".yaml,.yml,text/yaml"></label>
|
||||
<div class="cols">
|
||||
<label>Relationship for entries without one
|
||||
<select name="relationship">{{range .Relationships}}<option value="{{.}}">{{.}}</option>{{end}}</select>
|
||||
</label>
|
||||
<label class="check"><input type="checkbox" name="overwrite"> Replace entries that already exist</label>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button type="submit">Import</button>
|
||||
<button type="submit" name="example" value="federated" class="secondary">Load the Federated example</button>
|
||||
</div>
|
||||
<p class="help">The Federated example is the 21 open source applications on a Federated Core, as partners.</p>
|
||||
</form>
|
||||
{{end}}{{end}}
|
||||
@@ -0,0 +1,40 @@
|
||||
{{define "content"}}{{with .Data}}
|
||||
<div class="heading">
|
||||
<h1>Inventory</h1>
|
||||
<div class="buttons">
|
||||
<a class="button" href="/inventory/new">New entry</a>
|
||||
<a class="button secondary" href="/inventory/import">Import</a>
|
||||
<a class="button secondary" href="/inventory/export">Export</a>
|
||||
</div>
|
||||
</div>
|
||||
<p class="lede"><strong>Partners</strong>: Supermarket amplifies their news.
|
||||
<strong>Competitors</strong>: it positions your products against theirs.
|
||||
<strong>Watch</strong>: news to curate, no promotion either way.</p>
|
||||
|
||||
<nav class="tabs">
|
||||
<a href="/inventory" {{if eq .Relationship ""}}aria-current="page"{{end}}>All</a>
|
||||
{{$cur := .Relationship}}
|
||||
{{range .Relationships}}<a href="/inventory?relationship={{.}}" {{if eq $cur .}}aria-current="page"{{end}}>{{.}}</a>{{end}}
|
||||
</nav>
|
||||
|
||||
{{if .Entries}}
|
||||
<table class="list">
|
||||
<thead><tr><th>Name</th><th>Relationship</th><th>X</th><th>YouTube</th><th>Description</th></tr></thead>
|
||||
<tbody>
|
||||
{{range .Entries}}
|
||||
<tr>
|
||||
<td><a href="/inventory/{{.ID}}">{{.Name}}</a></td>
|
||||
<td><span class="badge {{.Relationship}}">{{.Relationship}}</span></td>
|
||||
<td>{{if .TwitterHandle}}@{{.TwitterHandle}}{{end}}</td>
|
||||
<td>{{if .YouTubeChannelID}}✓{{end}}</td>
|
||||
<td>{{truncate 90 .Description}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{else}}
|
||||
<section class="card empty">
|
||||
<p>Nothing here yet. Add the partners and competitors you post about, or <a href="/inventory/import">import a list</a>.</p>
|
||||
</section>
|
||||
{{end}}
|
||||
{{end}}{{end}}
|
||||
@@ -0,0 +1,30 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="htmx-config" content='{"includeIndicatorStyles": false}'>
|
||||
<title>{{.Title}} · Supermarket</title>
|
||||
<link rel="stylesheet" href="/static/app.css">
|
||||
<script src="/static/htmx.min.js" defer></script>
|
||||
<script src="/static/app.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<header class="topbar">
|
||||
<a class="brand" href="/">Core<span>marketing</span></a>
|
||||
<nav>
|
||||
<a href="/" {{if eq .Nav "home"}}aria-current="page"{{end}}>Overview</a>
|
||||
<a href="/profile" {{if eq .Nav "profile"}}aria-current="page"{{end}}>Profile</a>
|
||||
<a href="/inventory" {{if eq .Nav "inventory"}}aria-current="page"{{end}}>Inventory</a>
|
||||
<a href="/settings/ai" {{if eq .Nav "settings"}}aria-current="page"{{end}}>Settings</a>
|
||||
<a href="/core" {{if eq .Nav "core"}}aria-current="page"{{end}}>Core & Hermes</a>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
{{if .Flash}}<p class="flash" role="status">{{.Flash}}</p>{{end}}
|
||||
{{if .Error}}<p class="error" role="alert">{{.Error}}</p>{{end}}
|
||||
{{template "content" .}}
|
||||
</main>
|
||||
<footer>Supermarket {{.Version}}</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,4 @@
|
||||
{{define "content"}}
|
||||
<h1>{{.Title}}</h1>
|
||||
{{with .Data}}<p><a href="{{.Back}}">← Back</a></p>{{end}}
|
||||
{{end}}
|
||||
@@ -0,0 +1,105 @@
|
||||
{{define "content"}}{{with .Data}}
|
||||
<h1>Company profile</h1>
|
||||
<p class="lede">Everything Supermarket writes, targets and audits starts here.</p>
|
||||
|
||||
<form class="card inline-form" method="post" action="/profile/draft">
|
||||
<label for="draft_url"><strong>Draft from your website</strong></label>
|
||||
<p class="help">Reads your home page and a few pages it links to (about, products, pricing), and fills in what's empty below. Nothing is saved until you press Save.</p>
|
||||
<div class="row">
|
||||
<input id="draft_url" name="draft_url" type="url" placeholder="https://example.com" value="{{.DraftURL}}" required>
|
||||
<button type="submit" class="secondary">Draft</button>
|
||||
</div>
|
||||
<p class="help">Takes up to a minute or two.</p>
|
||||
</form>
|
||||
|
||||
{{if .Drafted}}<p class="flash">Here's a draft. Check every field, correct what's wrong, then Save.</p>{{end}}
|
||||
|
||||
<form method="post" action="/profile">
|
||||
{{with .P}}
|
||||
<section class="card">
|
||||
<h2>The company</h2>
|
||||
<label>Name <input name="name" value="{{.Name}}" required></label>
|
||||
<label>What it does <textarea name="description" rows="3" required>{{.Description}}</textarea>
|
||||
<span class="help">Two or three sentences: what you sell and to whom.</span></label>
|
||||
<label>Positioning <textarea name="positioning" rows="2">{{.Positioning}}</textarea>
|
||||
<span class="help">How you differ from the alternatives.</span></label>
|
||||
<label>Voice <textarea name="voice" rows="2">{{.Voice}}</textarea>
|
||||
<span class="help">How posts should sound, e.g. "plain, practical, friendly; no hype".</span></label>
|
||||
<label>Words and claims to avoid <textarea name="avoid" rows="3">{{lines .Avoid}}</textarea>
|
||||
<span class="help">One per line.</span></label>
|
||||
<label>Keywords <textarea name="keywords" rows="4">{{lines .Keywords}}</textarea>
|
||||
<span class="help">Search phrases you want to rank for, one per line.</span></label>
|
||||
</section>
|
||||
{{end}}
|
||||
|
||||
<section class="card">
|
||||
<h2>Products</h2>
|
||||
{{range $i, $p := .Products}}
|
||||
<fieldset>
|
||||
<legend>{{if $p.Name}}{{$p.Name}}{{else}}Add a product{{end}}</legend>
|
||||
<div class="cols">
|
||||
<label>Name <input name="product_name" value="{{$p.Name}}"></label>
|
||||
<label>Page <input name="product_url" type="url" value="{{$p.URL}}" placeholder="https://"></label>
|
||||
</div>
|
||||
<label>Description <textarea name="product_description" rows="2">{{$p.Description}}</textarea></label>
|
||||
<div class="cols">
|
||||
<label>Pricing <input name="product_pricing" value="{{$p.Pricing}}" placeholder="e.g. from $15/month"></label>
|
||||
<label>Benefits <textarea name="product_benefits" rows="3">{{lines $p.Benefits}}</textarea>
|
||||
<span class="help">One per line.</span></label>
|
||||
</div>
|
||||
</fieldset>
|
||||
{{end}}
|
||||
<p class="help">To remove a product, clear its name. Save to get another empty row.</p>
|
||||
</section>
|
||||
|
||||
{{with .P.Targets}}
|
||||
<section class="card">
|
||||
<h2>Targets</h2>
|
||||
<p class="help">Your ideal customers. One entry per line in each box.</p>
|
||||
<div class="cols">
|
||||
<label>Industries <textarea name="industries" rows="4">{{lines .Industries}}</textarea></label>
|
||||
<label>Company sizes <textarea name="company_sizes" rows="4">{{lines .CompanySizes}}</textarea></label>
|
||||
<label>Roles you sell to <textarea name="roles" rows="4">{{lines .Roles}}</textarea></label>
|
||||
<label>Regions <textarea name="regions" rows="4">{{lines .Regions}}</textarea></label>
|
||||
<label>Problems you solve <textarea name="problems" rows="4">{{lines .Problems}}</textarea></label>
|
||||
<label>Buying signals <textarea name="buying_signals" rows="4">{{lines .BuyingSignals}}</textarea>
|
||||
<span class="help">e.g. "hiring a sysadmin", "asking for a Google Workspace alternative"</span></label>
|
||||
<label>Technologies they use <textarea name="technologies" rows="4">{{lines .Technologies}}</textarea></label>
|
||||
</div>
|
||||
</section>
|
||||
{{end}}
|
||||
|
||||
<section class="card">
|
||||
<h2>Websites</h2>
|
||||
{{range .Websites}}
|
||||
<fieldset>
|
||||
<legend>{{if .URL}}{{.URL}}{{else}}Add a website{{end}}</legend>
|
||||
<div class="cols">
|
||||
<label>Address <input name="website_url" type="url" value="{{.URL}}" placeholder="https://"></label>
|
||||
<label>Hugo repository on Gitea <input name="website_repo" value="{{.Repo}}" placeholder="https://gitea.example.com/org/site.git"></label>
|
||||
<label>Branch that gets published <input name="website_branch" value="{{.Branch}}" placeholder="main"></label>
|
||||
<label>Plausible site <input name="website_plausible" value="{{.PlausibleSite}}" placeholder="example.com"></label>
|
||||
<label>Google Search Console property <input name="website_gsc" value="{{.SearchConsoleProperty}}" placeholder="sc-domain:example.com"></label>
|
||||
<label>Bing Webmaster site <input name="website_bing" value="{{.BingSite}}" placeholder="https://example.com/"></label>
|
||||
</div>
|
||||
</fieldset>
|
||||
{{end}}
|
||||
<p class="help">To remove a website, clear its address.</p>
|
||||
</section>
|
||||
|
||||
{{with .P.Accounts}}
|
||||
<section class="card">
|
||||
<h2>Accounts</h2>
|
||||
<div class="cols">
|
||||
<label>X handle <input name="account_x" value="{{.X}}" placeholder="without @"></label>
|
||||
<label>LinkedIn page <input name="account_linkedin" value="{{.LinkedIn}}" placeholder="https://www.linkedin.com/company/…"></label>
|
||||
<label>Reddit user <input name="account_reddit" value="{{.Reddit}}" placeholder="without u/"></label>
|
||||
<label>Subreddits <textarea name="subreddits" rows="3">{{lines .Subreddits}}</textarea>
|
||||
<span class="help">Where your customers talk, one per line, without r/.</span></label>
|
||||
</div>
|
||||
</section>
|
||||
{{end}}
|
||||
|
||||
<div class="actions"><button type="submit">Save</button></div>
|
||||
</form>
|
||||
{{end}}{{end}}
|
||||
Reference in New Issue
Block a user