feat: add Atom feeds and JSON/CSV import/export
Phase 5 — Feeds & Import/Export:
- Atom feeds: global (/feed.xml), per-user (/u/{name}/feed.xml),
per-tag (/tags/{name}/feed.xml). Uses gorilla/feeds.
- JSON export: all user's faves with tags, pretty-printed
- CSV export: standard format with header row
- JSON import: validates and creates faves with tags
- CSV import: flexible column mapping from header row
- Import/export pages with format documentation
- Feed items include enclosure for images, author info
- Limited-visibility profiles excluded from feeds
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
13aec5be6e
commit
4e9db3f995
7 changed files with 463 additions and 0 deletions
32
web/templates/pages/import.html
Normal file
32
web/templates/pages/import.html
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{{define "content"}}
|
||||
<h1>Importer favoritter</h1>
|
||||
|
||||
<article>
|
||||
<p>Last opp en JSON- eller CSV-fil med favoritter. Bilder støttes ikke ved import.</p>
|
||||
<form method="POST" action="{{basePath}}/import" enctype="multipart/form-data">
|
||||
<input type="hidden" name="csrf_token" value="{{.CSRFToken}}">
|
||||
<label for="file">
|
||||
Velg fil (JSON eller CSV)
|
||||
<input type="file" id="file" name="file" required
|
||||
accept=".json,.csv,application/json,text/csv">
|
||||
</label>
|
||||
<button type="submit">Importer</button>
|
||||
</form>
|
||||
|
||||
<details>
|
||||
<summary>Forventet format</summary>
|
||||
<h3>JSON</h3>
|
||||
<pre><code>[
|
||||
{
|
||||
"description": "Blade Runner 2049",
|
||||
"url": "https://example.com",
|
||||
"privacy": "public",
|
||||
"tags": ["film", "sci-fi"]
|
||||
}
|
||||
]</code></pre>
|
||||
<h3>CSV</h3>
|
||||
<pre><code>description,url,privacy,tags
|
||||
Blade Runner 2049,https://example.com,public,"film,sci-fi"</code></pre>
|
||||
</details>
|
||||
</article>
|
||||
{{end}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue