Add option to ignore title when scraping and provide a custom title instead. Closes #3

This commit is contained in:
2022-06-05 11:19:44 +09:30
parent ee01887394
commit e0eefa2d11
9 changed files with 35 additions and 7 deletions

View File

@@ -8,7 +8,9 @@
<title>linkwallet</title>
<link rel="stylesheet" href="/assets/css/foundation.min.css">
<link rel="stylesheet" href="/assets/css/app.css">
<script src="/assets/js/htmx.min.js" defer></script>
<script src="/assets/js/vendor/htmx.min.js" defer></script>
<script src="/assets/js/vendor/hyperscript_web.min.js"></script>
</head>
<body>

View File

@@ -7,7 +7,7 @@
<form onsubmit="return false">
<div class="grid-x grid-padding-x">
<div class="large-6 cell">
<label>Paste a URL</label>
<label>URL</label>
<input type="text" name="url" value="{{ .url }}"
hx-trigger=""
/>

View File

@@ -9,7 +9,7 @@
<p>Then whenever you are on a webpage you would like to bookmark, just
click the bookmarklet.</p>
<a class="button" href="javascript:void(window.open('{{ .config.BaseURL }}/bookmarklet?url=' +encodeURIComponent(window.location), 'windowName', 'width=640,height=480'))">Bookmarklet</a>
<a class="button" href="javascript:void(window.open('{{ .config.BaseURL }}/bookmarklet?url=' +encodeURIComponent(window.location)+'&title='+encodeURIComponent(document.title), 'windowName', 'width=640,height=480'))">Bookmarklet</a>
{{ else }}

View File

@@ -3,7 +3,11 @@
<table>
<tr>
<th>Title</th>
<td>{{ .bookmark.Info.Title }}</td>
<td>
<input type="text" name="title" {{ if not .bookmark.PreserveTitle }}disabled{{ end }} id="title" value="{{ .bookmark.Info.Title }}">
<input id="checkbox" name="override_title" value="on" {{ if .bookmark.PreserveTitle }}checked{{end}} type="checkbox" _="on click toggle @disabled on #title">
<label for="checkbox">override scraped title (ignore page title when scraping)</label>
</td>
</tr>
<tr>
<th>URL</th>