diff --git a/code/features-search/random-websites/src/main/java/nu/marginalia/browse/model/BrowseResult.java b/code/features-search/random-websites/src/main/java/nu/marginalia/browse/model/BrowseResult.java index 41ab01d2..e2e899d0 100644 --- a/code/features-search/random-websites/src/main/java/nu/marginalia/browse/model/BrowseResult.java +++ b/code/features-search/random-websites/src/main/java/nu/marginalia/browse/model/BrowseResult.java @@ -11,4 +11,20 @@ public record BrowseResult (EdgeUrl url, int domainId, double relatedness) { } return domain.toString(); } + + public String displayDomain() { + String ret; + var domain = url.domain; + if ("www".equals(domain.subDomain)) { + ret = domain.domain; + } + else { + ret = domain.toString(); + } + if (ret.length() > 25) { + ret = ret.substring(0, 22) + "..."; + } + return ret; + + } } diff --git a/code/services-application/search-service/src/main/resources/static/search/serp.scss b/code/services-application/search-service/src/main/resources/static/search/serp.scss index 7692c449..ab323fd4 100644 --- a/code/services-application/search-service/src/main/resources/static/search/serp.scss +++ b/code/services-application/search-service/src/main/resources/static/search/serp.scss @@ -224,6 +224,7 @@ section.cards { h2 { @extend .heading; + word-break: break-word; } h2 a { @@ -548,3 +549,5 @@ footer { } } } + +.w3m-helper { display: none; } \ No newline at end of file diff --git a/code/services-application/search-service/src/main/resources/templates/search/browse-result.hdb b/code/services-application/search-service/src/main/resources/templates/search/browse-result.hdb index e20a9e91..7b66c7da 100644 --- a/code/services-application/search-service/src/main/resources/templates/search/browse-result.hdb +++ b/code/services-application/search-service/src/main/resources/templates/search/browse-result.hdb @@ -1,5 +1,5 @@ -
-

{{url.domain}}

+
+

{{displayDomain}}

diff --git a/code/services-application/search-service/src/main/resources/templates/search/browse-results.hdb b/code/services-application/search-service/src/main/resources/templates/search/browse-results.hdb index d4a4a21b..fc045539 100644 --- a/code/services-application/search-service/src/main/resources/templates/search/browse-results.hdb +++ b/code/services-application/search-service/src/main/resources/templates/search/browse-results.hdb @@ -15,8 +15,6 @@ {{>search/parts/search-header}} {{>search/parts/search-form}} -
-
{{#if focusDomain}} Showing domains similar to {{focusDomain}}. @@ -28,8 +26,8 @@ take the helm. {{/unless}}
+
{{#each results}}{{>search/browse-result}}{{/each}} -
{{>search/parts/search-footer}} diff --git a/code/services-application/search-service/src/main/resources/templates/search/parts/search-result.hdb b/code/services-application/search-service/src/main/resources/templates/search/parts/search-result.hdb index dd86187b..bd89cc59 100644 --- a/code/services-application/search-service/src/main/resources/templates/search/parts/search-result.hdb +++ b/code/services-application/search-service/src/main/resources/templates/search/parts/search-result.hdb @@ -16,3 +16,4 @@
+
\ No newline at end of file