diff --git a/code/functions/math/api/java/nu/marginalia/api/math/model/DictionaryResponse.java b/code/functions/math/api/java/nu/marginalia/api/math/model/DictionaryResponse.java index b158730e..05c8ca97 100644 --- a/code/functions/math/api/java/nu/marginalia/api/math/model/DictionaryResponse.java +++ b/code/functions/math/api/java/nu/marginalia/api/math/model/DictionaryResponse.java @@ -7,4 +7,8 @@ public record DictionaryResponse(String word, List entries) { this.word = word; this.entries = entries.stream().toList(); // Make an immutable copy } + + public boolean hasEntries() { + return !entries.isEmpty(); + } } diff --git a/code/services-application/search-service/build.gradle b/code/services-application/search-service/build.gradle index 89287778..126355ea 100644 --- a/code/services-application/search-service/build.gradle +++ b/code/services-application/search-service/build.gradle @@ -50,7 +50,6 @@ dependencies { implementation project(':code:index:api') - implementation project(':code:common:renderer') implementation project(':code:features-search:screenshots') implementation project(':code:features-search:random-websites') diff --git a/code/services-application/search-service/java/nu/marginalia/search/SearchHandlebarsConfigurator.java b/code/services-application/search-service/java/nu/marginalia/search/SearchHandlebarsConfigurator.java deleted file mode 100644 index 8e9f38eb..00000000 --- a/code/services-application/search-service/java/nu/marginalia/search/SearchHandlebarsConfigurator.java +++ /dev/null @@ -1,12 +0,0 @@ -package nu.marginalia.search; - -import com.github.jknack.handlebars.Handlebars; -import nu.marginalia.renderer.config.HandlebarsConfigurator; - -public class SearchHandlebarsConfigurator implements HandlebarsConfigurator { - - @Override - public void configure(Handlebars handlebars) { - - } -} diff --git a/code/services-application/search-service/java/nu/marginalia/search/SearchModule.java b/code/services-application/search-service/java/nu/marginalia/search/SearchModule.java index 5e55aa2a..927eb7df 100644 --- a/code/services-application/search-service/java/nu/marginalia/search/SearchModule.java +++ b/code/services-application/search-service/java/nu/marginalia/search/SearchModule.java @@ -4,13 +4,10 @@ import com.google.inject.AbstractModule; import nu.marginalia.LanguageModels; import nu.marginalia.WebsiteUrl; import nu.marginalia.WmsaHome; -import nu.marginalia.renderer.config.HandlebarsConfigurator; public class SearchModule extends AbstractModule { public void configure() { - bind(HandlebarsConfigurator.class).to(SearchHandlebarsConfigurator.class); - bind(LanguageModels.class).toInstance(WmsaHome.getLanguageModels()); bind(WebsiteUrl.class).toInstance(new WebsiteUrl( diff --git a/code/services-application/search-service/java/nu/marginalia/search/command/CommandEvaluator.java b/code/services-application/search-service/java/nu/marginalia/search/command/CommandEvaluator.java index eb352a93..871fadfe 100644 --- a/code/services-application/search-service/java/nu/marginalia/search/command/CommandEvaluator.java +++ b/code/services-application/search-service/java/nu/marginalia/search/command/CommandEvaluator.java @@ -14,7 +14,7 @@ public class CommandEvaluator { @Inject public CommandEvaluator( - BrowseCommand browse, + BrowseRedirectCommand browse, ConvertCommand convert, DefinitionCommand define, BangCommand bang, diff --git a/code/services-application/search-service/java/nu/marginalia/search/command/commands/BrowseCommand.java b/code/services-application/search-service/java/nu/marginalia/search/command/commands/BrowseRedirectCommand.java similarity index 92% rename from code/services-application/search-service/java/nu/marginalia/search/command/commands/BrowseCommand.java rename to code/services-application/search-service/java/nu/marginalia/search/command/commands/BrowseRedirectCommand.java index 83bf35be..1b57ebca 100644 --- a/code/services-application/search-service/java/nu/marginalia/search/command/commands/BrowseCommand.java +++ b/code/services-application/search-service/java/nu/marginalia/search/command/commands/BrowseRedirectCommand.java @@ -9,11 +9,11 @@ import java.util.Optional; import java.util.function.Predicate; import java.util.regex.Pattern; -public class BrowseCommand implements SearchCommandInterface { +public class BrowseRedirectCommand implements SearchCommandInterface { private final Predicate queryPatternPredicate = Pattern.compile("^browse:[.A-Za-z\\-0-9:]+$").asPredicate(); @Inject - public BrowseCommand() + public BrowseRedirectCommand() { } diff --git a/code/services-application/search-service/java/nu/marginalia/search/command/commands/ConvertCommand.java b/code/services-application/search-service/java/nu/marginalia/search/command/commands/ConvertCommand.java index 17780f48..f4888556 100644 --- a/code/services-application/search-service/java/nu/marginalia/search/command/commands/ConvertCommand.java +++ b/code/services-application/search-service/java/nu/marginalia/search/command/commands/ConvertCommand.java @@ -1,35 +1,35 @@ package nu.marginalia.search.command.commands; import com.google.inject.Inject; -import nu.marginalia.renderer.MustacheRenderer; -import nu.marginalia.renderer.RendererFactory; +import nu.marginalia.search.JteRenderer; import nu.marginalia.search.command.SearchCommandInterface; import nu.marginalia.search.command.SearchParameters; +import nu.marginalia.search.model.NavbarModel; import nu.marginalia.search.svc.SearchUnitConversionService; import spark.Response; -import java.io.IOException; import java.util.Map; import java.util.Optional; public class ConvertCommand implements SearchCommandInterface { private final SearchUnitConversionService searchUnitConversionService; - private final MustacheRenderer> conversionRenderer; + private final JteRenderer renderer; @Inject - public ConvertCommand(SearchUnitConversionService searchUnitConversionService, RendererFactory rendererFactory) throws IOException { + public ConvertCommand(SearchUnitConversionService searchUnitConversionService, + JteRenderer renderer) { this.searchUnitConversionService = searchUnitConversionService; - conversionRenderer = rendererFactory.renderer("search/conversion-results"); + this.renderer = renderer; } @Override public Optional process(Response response, SearchParameters parameters) { var conversion = searchUnitConversionService.tryConversion(parameters.query()); - return conversion.map(s -> conversionRenderer.render(Map.of( - "query", parameters.query(), - "result", s, - "profile", parameters.profileStr()) + return conversion.map(s -> renderer.render("serp/unit-conversion.jte", Map.of( + "parameters", parameters, + "navbar", NavbarModel.SEARCH, + "result", s) )); } diff --git a/code/services-application/search-service/java/nu/marginalia/search/command/commands/DefinitionCommand.java b/code/services-application/search-service/java/nu/marginalia/search/command/commands/DefinitionCommand.java index 3025497f..77a5d828 100644 --- a/code/services-application/search-service/java/nu/marginalia/search/command/commands/DefinitionCommand.java +++ b/code/services-application/search-service/java/nu/marginalia/search/command/commands/DefinitionCommand.java @@ -4,15 +4,14 @@ package nu.marginalia.search.command.commands; import com.google.inject.Inject; import nu.marginalia.api.math.MathClient; import nu.marginalia.api.math.model.DictionaryResponse; -import nu.marginalia.renderer.MustacheRenderer; +import nu.marginalia.search.JteRenderer; import nu.marginalia.search.command.SearchCommandInterface; import nu.marginalia.search.command.SearchParameters; -import nu.marginalia.renderer.RendererFactory; +import nu.marginalia.search.model.NavbarModel; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import spark.Response; -import java.io.IOException; import java.util.Map; import java.util.Optional; import java.util.concurrent.TimeUnit; @@ -22,19 +21,17 @@ import java.util.regex.Pattern; public class DefinitionCommand implements SearchCommandInterface { private final Logger logger = LoggerFactory.getLogger(getClass()); - private final MustacheRenderer dictionaryRenderer; private final MathClient mathClient; + private final JteRenderer renderer; private final Predicate queryPatternPredicate = Pattern.compile("^define:[A-Za-z\\s-0-9]+$").asPredicate(); @Inject - public DefinitionCommand(RendererFactory rendererFactory, MathClient mathClient) - throws IOException - { + public DefinitionCommand(MathClient mathClient, JteRenderer renderer) { - dictionaryRenderer = rendererFactory.renderer("search/dictionary-results"); this.mathClient = mathClient; + this.renderer = renderer; } @Override @@ -43,11 +40,12 @@ public class DefinitionCommand implements SearchCommandInterface { return Optional.empty(); } - var results = lookupDefinition(parameters.query()); + DictionaryResponse result = lookupDefinition(parameters.query()); - return Optional.of(dictionaryRenderer.render(results, - Map.of("query", parameters.query(), - "profile", parameters.profileStr()) + return Optional.of(renderer.render("serp/dict-lookup.jte", + Map.of("parameters", parameters, + "result", result, + "navbar", NavbarModel.SEARCH) )); } diff --git a/code/services-application/search-service/java/nu/marginalia/search/svc/SearchCrosstalkService.java b/code/services-application/search-service/java/nu/marginalia/search/svc/SearchCrosstalkService.java index 968f5927..c6881e96 100644 --- a/code/services-application/search-service/java/nu/marginalia/search/svc/SearchCrosstalkService.java +++ b/code/services-application/search-service/java/nu/marginalia/search/svc/SearchCrosstalkService.java @@ -1,9 +1,9 @@ package nu.marginalia.search.svc; import com.google.inject.Inject; -import nu.marginalia.renderer.MustacheRenderer; -import nu.marginalia.renderer.RendererFactory; +import nu.marginalia.search.JteRenderer; import nu.marginalia.search.SearchOperator; +import nu.marginalia.search.model.NavbarModel; import nu.marginalia.search.model.SimpleSearchResults; import nu.marginalia.search.model.UrlDetails; import org.apache.commons.lang3.StringUtils; @@ -15,18 +15,18 @@ import spark.Response; import java.io.IOException; import java.sql.SQLException; import java.util.List; +import java.util.Map; public class SearchCrosstalkService { private static final Logger logger = LoggerFactory.getLogger(SearchCrosstalkService.class); private final SearchOperator searchOperator; - private final MustacheRenderer renderer; + private final JteRenderer renderer; @Inject - public SearchCrosstalkService(SearchOperator searchOperator, - RendererFactory rendererFactory) throws IOException + public SearchCrosstalkService(SearchOperator searchOperator, JteRenderer renderer) throws IOException { this.searchOperator = searchOperator; - this.renderer = rendererFactory.renderer("search/site-info/site-crosstalk"); + this.renderer = renderer; } public Object handle(Request request, Response response) throws SQLException { @@ -48,23 +48,28 @@ public class SearchCrosstalkService { CrosstalkResult model = new CrosstalkResult(parts[0], parts[1], resAtoB.results, resBtoA.results); - return renderer.render(model); + return renderer.render( + "siteinfo/crosstalk.jte", + Map.of("model", model, + "navbar", NavbarModel.SITEINFO)); } - private record CrosstalkResult(String domainA, + public record CrosstalkResult(String domainA, String domainB, - List forward, - List backward) + List aToB, + List bToA) { - public boolean isFocusDomain() { - return true; // Hack to get the search result templates behave well - } public boolean hasBoth() { - return !forward.isEmpty() && !backward.isEmpty(); + return !aToB.isEmpty() && !bToA.isEmpty(); + } + public boolean hasA() { + return !aToB.isEmpty(); + } + public boolean hasB() { + return !bToA.isEmpty(); } - } } diff --git a/code/services-application/search-service/java/nu/marginalia/search/svc/SearchFrontPageService.java b/code/services-application/search-service/java/nu/marginalia/search/svc/SearchFrontPageService.java index 1c606441..61bb1e39 100644 --- a/code/services-application/search-service/java/nu/marginalia/search/svc/SearchFrontPageService.java +++ b/code/services-application/search-service/java/nu/marginalia/search/svc/SearchFrontPageService.java @@ -4,7 +4,6 @@ import com.google.inject.Inject; import com.google.inject.Singleton; import com.zaxxer.hikari.HikariDataSource; import nu.marginalia.WebsiteUrl; -import nu.marginalia.renderer.RendererFactory; import nu.marginalia.search.JteRenderer; import nu.marginalia.search.model.NavbarModel; import org.slf4j.Logger; @@ -34,8 +33,7 @@ public class SearchFrontPageService { private final Logger logger = LoggerFactory.getLogger(getClass()); @Inject - public SearchFrontPageService(RendererFactory rendererFactory, - HikariDataSource dataSource, + public SearchFrontPageService(HikariDataSource dataSource, JteRenderer jteRenderer, SearchQueryCountService searchVisitorCount, WebsiteUrl websiteUrl ) throws IOException { @@ -51,10 +49,6 @@ public class SearchFrontPageService { return jteRenderer.render("serp/first.jte", Map.of("navbar", NavbarModel.SEARCH, "websiteUrl", websiteUrl) ); -// return template.render(new IndexModel( -// getNewsItems(), -// searchVisitorCount.getQueriesPerMinute() -// )); } diff --git a/code/services-application/search-service/java/nu/marginalia/search/svc/SearchSiteInfoService.java b/code/services-application/search-service/java/nu/marginalia/search/svc/SearchSiteInfoService.java index ebec5717..4d2ea831 100644 --- a/code/services-application/search-service/java/nu/marginalia/search/svc/SearchSiteInfoService.java +++ b/code/services-application/search-service/java/nu/marginalia/search/svc/SearchSiteInfoService.java @@ -11,8 +11,6 @@ import nu.marginalia.api.feeds.RpcFeedItem; import nu.marginalia.api.livecapture.LiveCaptureClient; import nu.marginalia.db.DbDomainQueries; import nu.marginalia.model.EdgeDomain; -import nu.marginalia.renderer.MustacheRenderer; -import nu.marginalia.renderer.RendererFactory; import nu.marginalia.screenshot.ScreenshotService; import nu.marginalia.search.JteRenderer; import nu.marginalia.search.SearchOperator; @@ -26,7 +24,6 @@ import org.slf4j.LoggerFactory; import spark.Request; import spark.Response; -import java.io.IOException; import java.sql.SQLException; import java.util.*; import java.util.concurrent.CompletableFuture; @@ -41,7 +38,6 @@ public class SearchSiteInfoService { private final DomainInfoClient domainInfoClient; private final SearchFlagSiteService flagSiteService; private final DbDomainQueries domainQueries; - private final MustacheRenderer renderer; private final FeedsClient feedsClient; private final LiveCaptureClient liveCaptureClient; private final ScreenshotService screenshotService; @@ -52,22 +48,19 @@ public class SearchSiteInfoService { @Inject public SearchSiteInfoService(SearchOperator searchOperator, DomainInfoClient domainInfoClient, - RendererFactory rendererFactory, SearchFlagSiteService flagSiteService, DbDomainQueries domainQueries, FeedsClient feedsClient, LiveCaptureClient liveCaptureClient, ScreenshotService screenshotService, HikariDataSource dataSource, - JteRenderer jteRenderer) throws IOException + JteRenderer jteRenderer) { this.searchOperator = searchOperator; this.domainInfoClient = domainInfoClient; this.flagSiteService = flagSiteService; this.domainQueries = domainQueries; - this.renderer = rendererFactory.renderer("search/site-info/site-info"); - this.feedsClient = feedsClient; this.liveCaptureClient = liveCaptureClient; this.screenshotService = screenshotService; diff --git a/code/services-application/search-service/resources/jte/serp/dict-lookup.jte b/code/services-application/search-service/resources/jte/serp/dict-lookup.jte new file mode 100644 index 00000000..58b43ff8 --- /dev/null +++ b/code/services-application/search-service/resources/jte/serp/dict-lookup.jte @@ -0,0 +1,86 @@ +@import nu.marginalia.api.math.model.DictionaryEntry +@import nu.marginalia.search.command.SearchParameters +@import nu.marginalia.search.model.NavbarModel +@import nu.marginalia.search.model.SearchFilters +@import nu.marginalia.api.math.model.DictionaryResponse + +@param SearchParameters parameters +@param DictionaryResponse result +@param NavbarModel navbar + +!{SearchFilters filters = new SearchFilters(parameters);} + + + + +@template.part.head(title = "Marginalia Search - " + parameters.query()) + + +@template.part.navbar(navbar = navbar) + +
+
+
+
+ +
+ @template.serp.part.searchform(query = parameters.query(), profile = parameters.profileStr(), filters = filters) +
+
+ +
+
+
+ +
+ + @template.serp.part.sidebar(filters = filters) + + +
+
+
+ ${result.word()} +
+ + @if (result.hasEntries()) + + + + + + + + + @for (DictionaryEntry entry : result.entries()) + + + + + @endfor + +
TypeDefinition
${entry.type()}${entry.definition()}
+ @else +
No definition found.
+ @endif +
+
+
+ +
+ +@template.serp.part.footerHowto() + +@template.part.footerLegal() + +<%-- Put this last to not bother SR users with double menus --%> +@template.serp.part.mobile-menu(filters = filters) + + + + + + \ No newline at end of file diff --git a/code/services-application/search-service/resources/jte/serp/unit-conversion.jte b/code/services-application/search-service/resources/jte/serp/unit-conversion.jte new file mode 100644 index 00000000..75825004 --- /dev/null +++ b/code/services-application/search-service/resources/jte/serp/unit-conversion.jte @@ -0,0 +1,66 @@ +@import nu.marginalia.search.command.SearchParameters +@import nu.marginalia.search.model.NavbarModel +@import nu.marginalia.search.model.SearchFilters + +@param SearchParameters parameters +@param String result +@param NavbarModel navbar + +!{SearchFilters filters = new SearchFilters(parameters);} + + + + +@template.part.head(title = "Marginalia Search - " + parameters.query()) + + +@template.part.navbar(navbar = navbar) + +
+
+
+
+ +
+ @template.serp.part.searchform(query = parameters.query(), profile = parameters.profileStr(), filters = filters) +
+
+ +
+
+
+ +
+ + @template.serp.part.sidebar(filters = filters) + + +
+
+
+ ${parameters.query()} +
+
+ ${result} +
+
+
+
+ +
+ +@template.serp.part.footerHowto() + +@template.part.footerLegal() + +<%-- Put this last to not bother SR users with double menus --%> +@template.serp.part.mobile-menu(filters = filters) + + + + + + \ No newline at end of file diff --git a/code/services-application/search-service/resources/jte/siteinfo/crosstalk.jte b/code/services-application/search-service/resources/jte/siteinfo/crosstalk.jte new file mode 100644 index 00000000..63d5d2e5 --- /dev/null +++ b/code/services-application/search-service/resources/jte/siteinfo/crosstalk.jte @@ -0,0 +1,112 @@ +@import nu.marginalia.search.model.NavbarModel +@import nu.marginalia.search.model.UrlDetails +@import nu.marginalia.model.EdgeDomain +@import nu.marginalia.search.svc.* + +@param SearchCrosstalkService.CrosstalkResult model +@param NavbarModel navbar + + + + +@template.part.head(title = "Marginalia Search - " + model.domainA() + "/" + model.domainB()) + + + +@template.part.navbar(navbar = navbar) + +
+
+
+ + + @if (model.hasBoth()) + +
+ +
+ @elseif (model.hasA()) + +
+ +
+ @else + +
+ +
+ @endif + + + +
+
+
+ +
+ + @if (model.hasA()) +
+
+ + ${model.domainA()} + + +
+ + @for (UrlDetails details : model.aToB()) +
$unsafe{details.displayTitle()}
+
+ $unsafe{details.displayDescription()} +
+ + @endfor +
+ @endif + + @if (model.hasB()) +
+
+ + ${model.domainB()} + + +
+ + @for (UrlDetails details : model.bToA()) +
$unsafe{details.displayTitle()}
+
+ $unsafe{details.displayDescription()} +
+ + @endfor +
+ @endif + +
+ + +@template.part.footerLegal() + + + \ No newline at end of file diff --git a/code/services-application/search-service/resources/static/search/css/style.css b/code/services-application/search-service/resources/static/search/css/style.css index bc1eaa70..35102d2a 100644 --- a/code/services-application/search-service/resources/static/search/css/style.css +++ b/code/services-application/search-service/resources/static/search/css/style.css @@ -1727,6 +1727,10 @@ video { display: inline; } + .md\:hidden { + display: none; + } + .md\:w-32 { width: 8rem; } @@ -1755,6 +1759,10 @@ video { place-items: start; } + .md\:place-items-baseline { + place-items: baseline; + } + .md\:gap-8 { gap: 2rem; } @@ -1771,6 +1779,10 @@ video { margin-left: calc(2rem * calc(1 - var(--tw-space-x-reverse))); } + .md\:p-4 { + padding: 1rem; + } + .md\:px-4 { padding-left: 1rem; padding-right: 1rem; diff --git a/code/services-application/search-service/resources/templates/search/browse-result.hdb b/code/services-application/search-service/resources/templates/search/browse-result.hdb deleted file mode 100644 index fa7a06f1..00000000 --- a/code/services-application/search-service/resources/templates/search/browse-result.hdb +++ /dev/null @@ -1,12 +0,0 @@ -
-

{{displayDomain}}

- - - {{displayDomain}} screenshot - - - -
\ No newline at end of file diff --git a/code/services-application/search-service/resources/templates/search/browse-results.hdb b/code/services-application/search-service/resources/templates/search/browse-results.hdb deleted file mode 100644 index 0c674c10..00000000 --- a/code/services-application/search-service/resources/templates/search/browse-results.hdb +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Marginalia Search - {{query}} - - - - - - - - - -{{>search/parts/search-header}} -{{>search/parts/search-form}} - -
-{{#if focusDomain}} - Showing domains similar to {{focusDomain}}. -{{/if}} -{{#unless focusDomain}} -This list of domains is random. Refresh to get -new domains, or click Similar Domains to -take the helm. -{{/unless}} -
- -
-{{#each results}}{{>search/browse-result}}{{/each}} -
- -{{>search/parts/search-footer}} - diff --git a/code/services-application/search-service/resources/templates/search/conversion-results.hdb b/code/services-application/search-service/resources/templates/search/conversion-results.hdb deleted file mode 100644 index 6c58b4a4..00000000 --- a/code/services-application/search-service/resources/templates/search/conversion-results.hdb +++ /dev/null @@ -1,23 +0,0 @@ - - - - - Marginalia Search - {{query}} - - - - - - - - -{{>search/parts/search-header}} -{{>search/parts/search-form}} - -
- {{query}} = {{result}} -
- - -{{>search/parts/search-footer}} - \ No newline at end of file diff --git a/code/services-application/search-service/resources/templates/search/dictionary-results.hdb b/code/services-application/search-service/resources/templates/search/dictionary-results.hdb deleted file mode 100644 index 12a25be9..00000000 --- a/code/services-application/search-service/resources/templates/search/dictionary-results.hdb +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Marginalia Search - {{query}} - - - - - - - - -{{>search/parts/search-header}} -{{>search/parts/search-form}} - -
-{{#unless entries}} -No definitions were found for that word -{{/unless}} - -{{#if entries}} -
    -{{#each entries}} -
  • {{word}}, {{type}}: {{definition}}
  • -{{/each}} -
-{{/if}} -
- -{{#if entries}} -
-

Legal

-This data is derived from wiktionary, -available under GFDL and CC BY-SA 3.0. More Information. -
-{{/if}} - -{{>search/parts/search-footer}} - diff --git a/code/services-application/search-service/resources/templates/search/error-page-search.hdb b/code/services-application/search-service/resources/templates/search/error-page-search.hdb deleted file mode 100644 index a84ef2ab..00000000 --- a/code/services-application/search-service/resources/templates/search/error-page-search.hdb +++ /dev/null @@ -1,24 +0,0 @@ - - - - - Marginalia Search - {{title}} - - - - - - - - - -{{>search/parts/search-header}} -{{>search/parts/search-form}} - -
-

{{ title }}

-
{{{message}}}
-
- -{{>search/parts/search-footer}} - diff --git a/code/services-application/search-service/resources/templates/search/error-page.hdb b/code/services-application/search-service/resources/templates/search/error-page.hdb deleted file mode 100644 index fbef861e..00000000 --- a/code/services-application/search-service/resources/templates/search/error-page.hdb +++ /dev/null @@ -1,20 +0,0 @@ - - - Error - - - - -
-

Error

-

Oops! It appears the index server is {{indexState}}.

-

The server was probably restarted to bring online some changes. Restarting the index typically takes - a few minutes, during which searches can't be served.

- -

In the event of a longer outage, the @marginalianu feed - on Twitter may have details, otherwise you can always send me an email at kontakt@marginalia.nu.

- -

This page will attempt to refresh automatically every few seconds.

-
- - \ No newline at end of file diff --git a/code/services-application/search-service/resources/templates/search/index/index-about.hdb b/code/services-application/search-service/resources/templates/search/index/index-about.hdb deleted file mode 100644 index 7328d2ee..00000000 --- a/code/services-application/search-service/resources/templates/search/index/index-about.hdb +++ /dev/null @@ -1,22 +0,0 @@ -
-

About

-
-

This is an independent DIY search engine that focuses on non-commercial content, and attempts to - show you sites you perhaps weren't aware of in favor of the sort of sites you probably already knew - existed.

-

- The software for this search engine is all custom-built, and all crawling and indexing is - done in-house. The project is open source. Feel free to poke about in the source code or contribute - to the development! -

-

- The search engine is currently serving about {{searchPerMinute}} queries/minute. -

-

Consider supporting the - project!

-
-
- Read More -
-
diff --git a/code/services-application/search-service/resources/templates/search/index/index-news.hdb b/code/services-application/search-service/resources/templates/search/index/index-news.hdb deleted file mode 100644 index 286c4451..00000000 --- a/code/services-application/search-service/resources/templates/search/index/index-news.hdb +++ /dev/null @@ -1,17 +0,0 @@ - -{{#if news}} -
-

Publicity, Discussion and Events

-
-
- {{#each news}} -
{{title}}
-
{{date}} {{source}}
- {{/each}} -
-
- -
-{{/if}} \ No newline at end of file diff --git a/code/services-application/search-service/resources/templates/search/index/index-tips.hdb b/code/services-application/search-service/resources/templates/search/index/index-tips.hdb deleted file mode 100644 index c50273d0..00000000 --- a/code/services-application/search-service/resources/templates/search/index/index-tips.hdb +++ /dev/null @@ -1,21 +0,0 @@ -
-

Tips

-
-

- This search engine isn't particularly well equipped to answering queries - posed like questions, instead try to imagine some text that might appear - in the website you are looking for, and search for that.

-

- Where this search engine really shines is finding small, old and obscure websites about some - given topic, perhaps - old video games, - a mystery, - theology, - the occult, - knitting, - computer science, - or art. -

- -
-
\ No newline at end of file diff --git a/code/services-application/search-service/resources/templates/search/index/index.hdb b/code/services-application/search-service/resources/templates/search/index/index.hdb deleted file mode 100644 index e81faf8c..00000000 --- a/code/services-application/search-service/resources/templates/search/index/index.hdb +++ /dev/null @@ -1,31 +0,0 @@ - - - - - Marginalia Search - - - - - - - - - - - - - - - - -{{>search/parts/search-header}} -{{>search/parts/search-form}} -
-{{>search/index/index-news}} -{{>search/index/index-about}} -{{>search/index/index-tips}} -
- -{{>search/parts/search-footer}} - diff --git a/code/services-application/search-service/resources/templates/search/parts/search-filters.hdb b/code/services-application/search-service/resources/templates/search/parts/search-filters.hdb deleted file mode 100644 index efb020cf..00000000 --- a/code/services-application/search-service/resources/templates/search/parts/search-filters.hdb +++ /dev/null @@ -1,46 +0,0 @@ -

Filters

-
    - {{#with removeJsOption}} - - {{/with}} - {{#with reduceAdtechOption}} - - {{/with}} - {{#with showRecentOption}} - - {{/with}} - {{#with searchTitleOption}} - - {{/with}} -
-

Domains

-
    - {{#each filterGroups}} - {{#each .}} -
  • {{displayName}}
  • - {{/each}} -
    - {{/each}} -
- - \ No newline at end of file diff --git a/code/services-application/search-service/resources/templates/search/parts/search-footer.hdb b/code/services-application/search-service/resources/templates/search/parts/search-footer.hdb deleted file mode 100644 index 747e7dd0..00000000 --- a/code/services-application/search-service/resources/templates/search/parts/search-footer.hdb +++ /dev/null @@ -1,124 +0,0 @@ -
-
-

Syntax

- This is a keyword-based search engine. When entering multiple search terms, the search engine will - attempt to match them against documents where the terms occur in close proximity.

- - Search terms can be excluded with a hyphen.

- - While the search engine at present does not allow full text search, quotes can be used to - specifically search for names or terms in the title. Using quotes will also cause the search engine - to be as literal as possible in interpreting the query.

- - Parentheses can be used to add terms to the query without giving weight to the terms when ranking - the search results.

- -

Samples

-
-
soup -chicken
-
Look for keywords that contain soup, but not - chicken.
-
"keyboard"
-
Look for pages containing the exact word - keyboard, not keyboards or the like.
-
"steve mcqueen"
-
Look for pages containing the exact words steve mcqueen - in that order, with no words in between.
-
apology (plato)
-
Look for pages containing apology and plato, but only rank them - based on their relevance to apology
-
-
-
-

Special Keywords

- Several special keywords are supported by the search engine. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeywordMeaning
site:example.comDisplay site information about example.com
site:example.com keywordSearch example.com for keyword
browse:example.comShow similar websites to example.com
ip:127.0.0.1Search documents hosted at 127.0.0.1
links:example.comSearch documents linking to example.com
tld:edu keywordSearch documents with the top level domain edu.
?tld:edu keywordPrefer but do not require results with the top level domain edu. - This syntax is also possible for links:..., ip:... and site:...
q>5The amount of javascript and modern features is at least 5 (on a scale 0 to 25)
q<5The amount of javascript and modern features is at most 5 (on a scale 0 to 25)
year>2005(beta) The document was ostensibly published in or after 2005
year=2005(beta) The document was ostensibly published in 2005
year<2005(beta) The document was ostensibly published in or before 2005
rank>50The ranking of the website is at least 50 in a span of 1 - 255
rank<50The ranking of the website is at most 50 in a span of 1 - 255
count>10 The search term must appear in at least 10 results form the domain
count<10 The search term must appear in at most 10 results from the domain
format:html5Filter documents using the HTML5 standard. This is typically modern websites.
format:xhtmlFilter documents using the XHTML standard
format:html123Filter documents using the HTML standards 1, 2, and 3. This is typically very old websites.
generator:wordpressFilter documents with the specified generator, in this case wordpress
file:zipFilter documents containing a link to a zip file (most file-endings work)
file:audioFilter documents containing a link to an audio file
file:videoFilter documents containing a link to a video file
file:archiveFilter documents containing a link to a compressed archive
file:documentFilter documents containing a link to a document
-special:mediaFilter out documents with audio or video tags
-special:scriptsFilter out documents with javascript
-special:affiliateFilter out documents with likely Amazon affiliate links
-special:trackingFilter out documents with analytics or tracking code
-special:cookiesFilter out documents with cookies
-

-
-

Results Legend

-

- The estimated relevance of the search result is indicated using the color saturation - of the color of the search result, as well as the order the results are presented. -

-

- Information about the position of the match is indicated using a dot matrix - in the bottom bar of each search result. Each dot represents four sentences, - and are presented in an order of top-to-bottom, left-to-right. - -

⣿⠃⠀⠀   — The terms occur heavily toward the beginning of the document. -

⠠⠀⡄⠁   — The terms occur sparsely throughout the document. -

⠀⠁⠀⠀   — The terms occur only in a single sentence. -

-

Potentially problems with the document are presented with a warning triangle, e.g. ⚠ 3. - Desktop users can mouse-over this to get a detailed breakdown. -

- - -
- - diff --git a/code/services-application/search-service/resources/templates/search/parts/search-form.hdb b/code/services-application/search-service/resources/templates/search/parts/search-form.hdb deleted file mode 100644 index 82b525e5..00000000 --- a/code/services-application/search-service/resources/templates/search/parts/search-form.hdb +++ /dev/null @@ -1,18 +0,0 @@ -
- -
- - \ No newline at end of file diff --git a/code/services-application/search-service/resources/templates/search/parts/search-header.hdb b/code/services-application/search-service/resources/templates/search/parts/search-header.hdb deleted file mode 100644 index 805ea8a9..00000000 --- a/code/services-application/search-service/resources/templates/search/parts/search-header.hdb +++ /dev/null @@ -1,21 +0,0 @@ - -
- -
- - -
-
- - - \ No newline at end of file diff --git a/code/services-application/search-service/resources/templates/search/parts/search-result-rest.hdb b/code/services-application/search-service/resources/templates/search/parts/search-result-rest.hdb deleted file mode 100644 index d0dd1a4e..00000000 --- a/code/services-application/search-service/resources/templates/search/parts/search-result-rest.hdb +++ /dev/null @@ -1,32 +0,0 @@ - -
-{{#with first}} - -

{{title}}

-

{{description}}

- -{{/with}} -
- Also from {{first.url.domain}} -
- -{{#with first}} -
- Info - {{resultsFromSameDomain}}+ -
- {{#each problems}} - {{name}} - {{/each}} - -
-
-{{/with}} -
- -
\ No newline at end of file diff --git a/code/services-application/search-service/resources/templates/search/parts/search-result.hdb b/code/services-application/search-service/resources/templates/search/parts/search-result.hdb deleted file mode 100644 index e448fcdb..00000000 --- a/code/services-application/search-service/resources/templates/search/parts/search-result.hdb +++ /dev/null @@ -1,22 +0,0 @@ - -
- - -

{{title}}

-

{{description}}

- -
- {{#unless focusDomain}} - Info - {{#if hasMoreResults}}{{resultsFromSameDomain}}+{{/if}}{{/unless}} -
- {{#each problems}} - {{name}} - {{/each}} - -
Terms appear in {{positionsCount}} positions
-
-
-
-
\ No newline at end of file diff --git a/code/services-application/search-service/resources/templates/search/search-results.hdb b/code/services-application/search-service/resources/templates/search/search-results.hdb deleted file mode 100644 index fd4ce717..00000000 --- a/code/services-application/search-service/resources/templates/search/search-results.hdb +++ /dev/null @@ -1,75 +0,0 @@ - - - - - Marginalia Search - {{query}} - - - - - - - - - -{{#if newFilter}}
Search Filters Updated
{{/if}} - - - -{{>search/parts/search-header}} -{{>search/parts/search-form}} - - - - - -{{>search/parts/search-footer}} - - \ No newline at end of file diff --git a/code/services-application/search-service/resources/templates/search/site-info/site-crosstalk.hdb b/code/services-application/search-service/resources/templates/search/site-info/site-crosstalk.hdb deleted file mode 100644 index 8d70b42d..00000000 --- a/code/services-application/search-service/resources/templates/search/site-info/site-crosstalk.hdb +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Marginalia Search - {{domainA}} and {{domainB}} - - - - - - - - -{{>search/parts/search-header}} -{{>search/parts/search-form}} - - - -
- Showing results containing links between {{domainA}} and {{domainB}}. -
-{{#each tests}}{{.}}{{/each}} -
-
- {{#each forward}} - {{>search/parts/search-result}} - {{/each}} -
-
- {{#each backward}} - {{>search/parts/search-result}} - {{/each}} -
-
- - -{{>search/parts/search-footer}} - - - diff --git a/code/services-application/search-service/resources/templates/search/site-info/site-info-feed.hdb b/code/services-application/search-service/resources/templates/search/site-info/site-info-feed.hdb deleted file mode 100644 index c3e52d81..00000000 --- a/code/services-application/search-service/resources/templates/search/site-info/site-info-feed.hdb +++ /dev/null @@ -1,22 +0,0 @@ -{{#if feed.items}} -{{#with feed}} -

Feed

- -
- {{#each items}} -
{{title}}
-
{{pubDay}}
{{{descriptionSafe}}}
- {{/each}} -
-{{/with}} -{{/if}} - -{{#unless feed.items}}{{#if samples}} -

Sample

-
-{{#each samples}} -
{{title}}
-
{{description}}
-{{/each}} -
-{{/if}}{{/unless}} \ No newline at end of file diff --git a/code/services-application/search-service/resources/templates/search/site-info/site-info-index-blacklisted.hdb b/code/services-application/search-service/resources/templates/search/site-info/site-info-index-blacklisted.hdb deleted file mode 100644 index 4fc787de..00000000 --- a/code/services-application/search-service/resources/templates/search/site-info/site-info-index-blacklisted.hdb +++ /dev/null @@ -1,8 +0,0 @@ -

This website is blacklisted. This excludes it from crawling and indexing.

- -

This is usually because of some form of misbehavior on the webmaster's end. - Either annoying search engine spam, or tasteless content bad faith content.

- -

Occasionally this is done hastily and in error. If you would like the decision - reviewed, you may use the report form to file an appeal. -

\ No newline at end of file diff --git a/code/services-application/search-service/resources/templates/search/site-info/site-info-index-indexed.hdb b/code/services-application/search-service/resources/templates/search/site-info/site-info-index-indexed.hdb deleted file mode 100644 index d138452b..00000000 --- a/code/services-application/search-service/resources/templates/search/site-info/site-info-index-indexed.hdb +++ /dev/null @@ -1,13 +0,0 @@ -
- Index - State: {{state}}
- Domain ID: {{domainId}}
- Node Affinity: {{nodeAffinity}}
- Pages Known: {{pagesKnown}}
- Pages Crawled: {{pagesFetched}}
- Pages Indexed: {{pagesIndexed}}
-

- IP: {{ip}} {{#if ipCountry}}{{getIpFlag}}{{/if}}
- AS: {{#if asn}}{{asn}} {{asnOrg}} {{asnCountry}}{{/if}}
-
-
\ No newline at end of file diff --git a/code/services-application/search-service/resources/templates/search/site-info/site-info-index-suggest.hdb b/code/services-application/search-service/resources/templates/search/site-info/site-info-index-suggest.hdb deleted file mode 100644 index f8ee2119..00000000 --- a/code/services-application/search-service/resources/templates/search/site-info/site-info-index-suggest.hdb +++ /dev/null @@ -1,12 +0,0 @@ -
-
- Crawling - This website is not queued for crawling. If you would like it to be crawled, - use the checkbox and button below.

- - -
-
- -

-
\ No newline at end of file diff --git a/code/services-application/search-service/resources/templates/search/site-info/site-info-index-unknown.hdb b/code/services-application/search-service/resources/templates/search/site-info/site-info-index-unknown.hdb deleted file mode 100644 index 00b4d279..00000000 --- a/code/services-application/search-service/resources/templates/search/site-info/site-info-index-unknown.hdb +++ /dev/null @@ -1,9 +0,0 @@ -
- Crawling - This website is not known to the search engine. - - To submit the website for crawling, follow these instructions. -
\ No newline at end of file diff --git a/code/services-application/search-service/resources/templates/search/site-info/site-info-index.hdb b/code/services-application/search-service/resources/templates/search/site-info/site-info-index.hdb deleted file mode 100644 index 43ed2450..00000000 --- a/code/services-application/search-service/resources/templates/search/site-info/site-info-index.hdb +++ /dev/null @@ -1,23 +0,0 @@ -

Indexing Information

-{{#if domainState.blacklisted}} - {{>search/site-info/site-info-index-blacklisted}} -{{/if}} - -{{#if domainState.unknownDomain}} - {{>search/site-info/site-info-index-unknown}} -{{/if}} - -{{#if domainState.inCrawlQueue}} -

-This website is in the queue for crawling. -It may take up to a month before it is indexed. -

-{{/if}} - -{{#if domainState.suggestForCrawling}} - {{>search/site-info/site-info-index-suggest}} -{{/if}} - -{{#if domainState.indexed}} - {{>search/site-info/site-info-index-indexed}} -{{/if}} \ No newline at end of file diff --git a/code/services-application/search-service/resources/templates/search/site-info/site-info-links.hdb b/code/services-application/search-service/resources/templates/search/site-info/site-info-links.hdb deleted file mode 100644 index fa869930..00000000 --- a/code/services-application/search-service/resources/templates/search/site-info/site-info-links.hdb +++ /dev/null @@ -1,7 +0,0 @@ -

Links

-
- Link Graph - Ranking: {{ranking}}%
- Incoming Links: {{incomingLinks}}
- Outbound Links: {{outboundLinks}}
-
\ No newline at end of file diff --git a/code/services-application/search-service/resources/templates/search/site-info/site-info-report.hdb b/code/services-application/search-service/resources/templates/search/site-info/site-info-report.hdb deleted file mode 100644 index 2b888a3e..00000000 --- a/code/services-application/search-service/resources/templates/search/site-info/site-info-report.hdb +++ /dev/null @@ -1,60 +0,0 @@ -
- {{#if submitted}} -

Your complaint against {{domain}} has been submitted

-

The review process is manual and may take a while. If urgent action is necessary, - reach me at kontakt@marginalia.nu! -

- {{/if}} - - {{#unless submitted}} -

Flag {{domain}} for review

-

- Note, this is not intended to police acceptable thoughts or ideas. -

- That said, offensive content in obvious bad faith is not tolerated, especially when designed - to crop up when you didn't go looking for it. How and where it is said is more - important than what is said. -

- This form can also be used to appeal unfairly blacklisted sites. -

- -

-
- Flag for Review - -
- -
-
-
-
-
-
-
-
-
- -
-
-

- Communicating through forms and tables is a bit impersonal, - you may also reach a human being through email at kontakt@marginalia.nu. - {{/unless}} - - {{#if complaints}} -


-

Complaints against {{domain}}

- - - {{#each complaints}} - - - - - - {{/each}} -
CategorySubmittedReviewed
{{category}}{{submitTime}}{{#if reviewed}}✓{{/if}}
- {{/if}} -
\ No newline at end of file diff --git a/code/services-application/search-service/resources/templates/search/site-info/site-info-summary.hdb b/code/services-application/search-service/resources/templates/search/site-info/site-info-summary.hdb deleted file mode 100644 index d913a0a6..00000000 --- a/code/services-application/search-service/resources/templates/search/site-info/site-info-summary.hdb +++ /dev/null @@ -1,124 +0,0 @@ -
- A visual exploration mode is also available. -
- - -
-
-

🌎 {{domain}}

- - - {{#if hasScreenshot}} - - Screenshot of {{domain}} - - {{/if}} - - {{#unless hasScreenshot}} -

Screenshot not yet available.

- {{/unless}} - - {{#with domainInformation}} - {{> search/site-info/site-info-feed}} - {{> search/site-info/site-info-index}} - {{> search/site-info/site-info-links}} - {{/with}} -
- - {{#if linking}} - - {{/if}} - - - {{#if similar}} -
-

Similar Domains

- - - - - - - - - {{#each similar}} - - - - - - - - - {{/each}} -
MetaRankDomainSimilarity
- {{#if indexed}} - {{#if active}} - 👀 - {{/if}} - {{#unless active}} - 🔥 - {{/unless}} - {{/if}} - - {{#if screenshot}}📷{{/if}} - - {{#if linkType.isLinked}} - {{{linkType}}} - {{/if}} - - {{{rankSymbols}}} - - {{url.domain}} - {{relatedness}}
- -
-

Note: Because two domains are considered similar does not always mean they're in - cahoots. Similarity is a measure of how often they appear in the same contexts, - which may be an association like peas and carrots, but some pairings are also defined by their - contrasting opposition, like Sparta and Athens.

-
- {{/if}} - -
\ No newline at end of file diff --git a/code/services-application/search-service/resources/templates/search/site-info/site-info.hdb b/code/services-application/search-service/resources/templates/search/site-info/site-info.hdb deleted file mode 100644 index 5a8a3e89..00000000 --- a/code/services-application/search-service/resources/templates/search/site-info/site-info.hdb +++ /dev/null @@ -1,58 +0,0 @@ - - - - - Marginalia Search - {{domain}} - - - - - - - - -{{>search/parts/search-header}} - -{{>search/parts/search-form}} - - -{{#with view}} - -{{/with}} - -{{#if view.links}} -
- Showing search results with links to {{domain}}. -
- {{#each results}}{{>search/parts/search-result}}{{/each}} -{{/if}} - -{{#if view.docs}} -
- Showing documents found in {{domain}}. -
- - {{#each results}}{{>search/parts/search-result}}{{/each}} -{{/if}} - -{{#if view.report}} - {{>search/site-info/site-info-report}} -{{/if}} - -{{#if view.info}} - {{>search/site-info/site-info-summary}} -{{/if}} - -{{>search/parts/search-footer}} - - -