diff --git a/README.md b/README.md index ddbc07ac..e0737c34 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ The name comes from: - Automatically provides titles, descriptions and icons of bookmarked websites - Automatically creates snapshots of bookmarked websites on [the Internet Archive Wayback Machine](https://archive.org/web/) - Import and export bookmarks in Netscape HTML format +- Installable as a Progressive Web App (PWA) - Extensions for [Firefox](https://addons.mozilla.org/firefox/addon/linkding-extension/) and [Chrome](https://chrome.google.com/webstore/detail/linkding-extension/beakmhbijpdhipnjhnclmhgjlddhidpe), as well as a bookmarklet - Light and dark themes - REST API for developing 3rd party apps diff --git a/bookmarks/frontend/components/SearchAutoComplete.svelte b/bookmarks/frontend/components/SearchAutoComplete.svelte index d31ff0bd..61aade0a 100644 --- a/bookmarks/frontend/components/SearchAutoComplete.svelte +++ b/bookmarks/frontend/components/SearchAutoComplete.svelte @@ -258,4 +258,4 @@ z-index: 2; } - \ No newline at end of file + diff --git a/bookmarks/static/apple-touch-icon.png b/bookmarks/static/apple-touch-icon.png index ed7b395a..cf68e2f6 100644 Binary files a/bookmarks/static/apple-touch-icon.png and b/bookmarks/static/apple-touch-icon.png differ diff --git a/bookmarks/static/favicon.ico b/bookmarks/static/favicon.ico new file mode 100644 index 00000000..1c455420 Binary files /dev/null and b/bookmarks/static/favicon.ico differ diff --git a/bookmarks/static/favicon.png b/bookmarks/static/favicon.png deleted file mode 100644 index f5c32c2a..00000000 Binary files a/bookmarks/static/favicon.png and /dev/null differ diff --git a/bookmarks/static/favicon.svg b/bookmarks/static/favicon.svg new file mode 100644 index 00000000..2241e7a1 --- /dev/null +++ b/bookmarks/static/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/bookmarks/static/linkding-screenshot.png b/bookmarks/static/linkding-screenshot.png new file mode 100644 index 00000000..69931c02 Binary files /dev/null and b/bookmarks/static/linkding-screenshot.png differ diff --git a/bookmarks/static/logo-192.png b/bookmarks/static/logo-192.png new file mode 100644 index 00000000..91912fa9 Binary files /dev/null and b/bookmarks/static/logo-192.png differ diff --git a/bookmarks/static/logo-512.png b/bookmarks/static/logo-512.png new file mode 100644 index 00000000..236f9721 Binary files /dev/null and b/bookmarks/static/logo-512.png differ diff --git a/bookmarks/static/logo.png b/bookmarks/static/logo.png index 893029e5..67552a01 100644 Binary files a/bookmarks/static/logo.png and b/bookmarks/static/logo.png differ diff --git a/bookmarks/static/logo.svg b/bookmarks/static/logo.svg new file mode 100644 index 00000000..9cda95c0 --- /dev/null +++ b/bookmarks/static/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/bookmarks/static/maskable-logo-192.png b/bookmarks/static/maskable-logo-192.png new file mode 100644 index 00000000..25ce6a62 Binary files /dev/null and b/bookmarks/static/maskable-logo-192.png differ diff --git a/bookmarks/static/maskable-logo-512.png b/bookmarks/static/maskable-logo-512.png new file mode 100644 index 00000000..3a811034 Binary files /dev/null and b/bookmarks/static/maskable-logo-512.png differ diff --git a/bookmarks/static/maskable-logo.svg b/bookmarks/static/maskable-logo.svg new file mode 100644 index 00000000..2fa2ce53 --- /dev/null +++ b/bookmarks/static/maskable-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/bookmarks/static/safari-pinned-tab.svg b/bookmarks/static/safari-pinned-tab.svg new file mode 100644 index 00000000..554e4acc --- /dev/null +++ b/bookmarks/static/safari-pinned-tab.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/bookmarks/templates/bookmarks/layout.html b/bookmarks/templates/bookmarks/layout.html index cb595b8b..ff4f336b 100644 --- a/bookmarks/templates/bookmarks/layout.html +++ b/bookmarks/templates/bookmarks/layout.html @@ -6,8 +6,10 @@
- - + + + + @@ -19,14 +21,18 @@ {# Include specific theme variant based on user profile setting #} {% if request.user_profile.theme == 'light' %} + {% elif request.user_profile.theme == 'dark' %} + {% else %} {# Use auto theme as fallback #} + + {% endif %} diff --git a/bookmarks/tests/test_metadata_view.py b/bookmarks/tests/test_metadata_view.py index c353058a..b6318db7 100644 --- a/bookmarks/tests/test_metadata_view.py +++ b/bookmarks/tests/test_metadata_view.py @@ -11,9 +11,91 @@ def test_default_manifest(self): response_body = response.json() expected_body = { "short_name": "linkding", + "name": "linkding", + "description": "Self-hosted bookmark service", "start_url": "bookmarks", "display": "standalone", "scope": "/", + "theme_color": "#5856e0", + "background_color": "#ffffff", + "icons": [ + { + "src": "/static/logo.svg", + "type": "image/svg+xml", + "sizes": "512x512", + "purpose": "any" + }, + { + "src": "/static/logo-512.png", + "type": "image/png", + "sizes": "512x512", + "purpose": "any" + }, + { + "src": "/static/logo-192.png", + "type": "image/png", + "sizes": "192x192", + "purpose": "any" + }, + { + "src": "/static/maskable-logo.svg", + "type": "image/svg+xml", + "sizes": "512x512", + "purpose": "maskable" + }, + { + "src": "/static/maskable-logo-512.png", + "type": "image/png", + "sizes": "512x512", + "purpose": "maskable" + }, + { + "src": "/static/maskable-logo-192.png", + "type": "image/png", + "sizes": "192x192", + "purpose": "maskable" + }, + ], + "shortcuts": [ + { + "name": "Add bookmark", + "url": "/bookmarks/new", + }, + { + "name": "Archived", + "url": "/bookmarks/archived", + }, + { + "name": "Unread", + "url": "/bookmarks?unread=yes", + }, + { + "name": "Untagged", + "url": "/bookmarks?q=!untagged", + }, + { + "name": "Shared", + "url": "/bookmarks/shared", + } + ], + "screenshots": [ + { + "src": "/static/linkding-screenshot.png", + "type": "image/png", + "sizes": "2158x1160", + "form_factor": "wide" + } + ], + "share_target": { + "action": "/bookmarks/new", + "method": "GET", + "enctype": "application/x-www-form-urlencoded", + "params": { + "url": "url", + "text": "url", + "title": "title", + } + } } self.assertDictEqual(response_body, expected_body) @@ -26,8 +108,90 @@ def test_manifest_respects_context_path(self): response_body = response.json() expected_body = { "short_name": "linkding", + "name": "linkding", + "description": "Self-hosted bookmark service", "start_url": "bookmarks", "display": "standalone", "scope": "/linkding/", + "theme_color": "#5856e0", + "background_color": "#ffffff", + "icons": [ + { + "src": "/linkding/static/logo.svg", + "type": "image/svg+xml", + "sizes": "512x512", + "purpose": "any" + }, + { + "src": "/linkding/static/logo-512.png", + "type": "image/png", + "sizes": "512x512", + "purpose": "any" + }, + { + "src": "/linkding/static/logo-192.png", + "type": "image/png", + "sizes": "192x192", + "purpose": "any" + }, + { + "src": "/linkding/static/maskable-logo.svg", + "type": "image/svg+xml", + "sizes": "512x512", + "purpose": "maskable" + }, + { + "src": "/linkding/static/maskable-logo-512.png", + "type": "image/png", + "sizes": "512x512", + "purpose": "maskable" + }, + { + "src": "/linkding/static/maskable-logo-192.png", + "type": "image/png", + "sizes": "192x192", + "purpose": "maskable" + }, + ], + "shortcuts": [ + { + "name": "Add bookmark", + "url": "/linkding/bookmarks/new", + }, + { + "name": "Archived", + "url": "/linkding/bookmarks/archived", + }, + { + "name": "Unread", + "url": "/linkding/bookmarks?unread=yes", + }, + { + "name": "Untagged", + "url": "/linkding/bookmarks?q=!untagged", + }, + { + "name": "Shared", + "url": "/linkding/bookmarks/shared", + } + ], + "screenshots": [ + { + "src": "/linkding/static/linkding-screenshot.png", + "type": "image/png", + "sizes": "2158x1160", + "form_factor": "wide" + } + ], + "share_target": { + "action": "/linkding/bookmarks/new", + "method": "GET", + "enctype": "application/x-www-form-urlencoded", + "params": { + "url": "url", + "text": "url", + "title": "title", + } + } } self.assertDictEqual(response_body, expected_body) diff --git a/bookmarks/views/manifest.py b/bookmarks/views/manifest.py index a4b39113..42eca5f9 100644 --- a/bookmarks/views/manifest.py +++ b/bookmarks/views/manifest.py @@ -5,9 +5,91 @@ def manifest(request): response = { "short_name": "linkding", + "name": "linkding", + "description": "Self-hosted bookmark service", "start_url": "bookmarks", "display": "standalone", "scope": "/" + settings.LD_CONTEXT_PATH, + "theme_color": "#5856e0", + "background_color": "#161822" if request.user_profile.theme == "dark" else "#ffffff", + "icons": [ + { + "src": "/" + settings.LD_CONTEXT_PATH + "static/logo.svg", + "type": "image/svg+xml", + "sizes": "512x512", + "purpose": "any" + }, + { + "src": "/" + settings.LD_CONTEXT_PATH + "static/logo-512.png", + "type": "image/png", + "sizes": "512x512", + "purpose": "any" + }, + { + "src": "/" + settings.LD_CONTEXT_PATH + "static/logo-192.png", + "type": "image/png", + "sizes": "192x192", + "purpose": "any" + }, + { + "src": "/" + settings.LD_CONTEXT_PATH + "static/maskable-logo.svg", + "type": "image/svg+xml", + "sizes": "512x512", + "purpose": "maskable" + }, + { + "src": "/" + settings.LD_CONTEXT_PATH + "static/maskable-logo-512.png", + "type": "image/png", + "sizes": "512x512", + "purpose": "maskable" + }, + { + "src": "/" + settings.LD_CONTEXT_PATH + "static/maskable-logo-192.png", + "type": "image/png", + "sizes": "192x192", + "purpose": "maskable" + }, + ], + "shortcuts": [ + { + "name": "Add bookmark", + "url": "/" + settings.LD_CONTEXT_PATH + "bookmarks/new", + }, + { + "name": "Archived", + "url": "/" + settings.LD_CONTEXT_PATH + "bookmarks/archived", + }, + { + "name": "Unread", + "url": "/" + settings.LD_CONTEXT_PATH + "bookmarks?unread=yes", + }, + { + "name": "Untagged", + "url": "/" + settings.LD_CONTEXT_PATH + "bookmarks?q=!untagged", + }, + { + "name": "Shared", + "url": "/" + settings.LD_CONTEXT_PATH + "bookmarks/shared", + } + ], + "screenshots": [ + { + "src": "/" + settings.LD_CONTEXT_PATH + "static/linkding-screenshot.png", + "type": "image/png", + "sizes": "2158x1160", + "form_factor": "wide" + } + ], + "share_target": { + "action": "/" + settings.LD_CONTEXT_PATH + "bookmarks/new", + "method": "GET", + "enctype": "application/x-www-form-urlencoded", + "params": { + "url": "url", + "text": "url", + "title": "title", + } + } } return JsonResponse(response, status=200) diff --git a/rollup.config.js b/rollup.config.js index f91e1e87..944b14ff 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -37,4 +37,4 @@ export default { watch: { clearScreen: false } -}; \ No newline at end of file +};