Skip to content

Commit

Permalink
Release 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ashokgelal committed Feb 12, 2020
1 parent dfd1e28 commit cba2d93
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 19 deletions.
Binary file modified AlpasDocs.alfredworkflow
Binary file not shown.
30 changes: 14 additions & 16 deletions alpas.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,22 @@
$parsedown = new Parsedown;
$algolia = new Algolia('BH4D9OD16A', 'e017bb0b99fe3193f750d48a4e7d441e');

AlgoliaUserAgent::addSuffixUserAgentSegment('Alpas Docs Alfred Workflow', '1.0.0');
AlgoliaUserAgent::addSuffixUserAgentSegment('Alpas Docs Alfred Workflow', '1.0.1');

$index = $algolia->initIndex('alpas');
$search = $index->search($query);
$results = $search['hits'];

$subtextSupported = $subtext === '0' || $subtext === '2';

if (empty($results)) {
if (empty($results)) {
$workflow->result()
->title('No matches')
->icon('google.png')
->subtitle("No match found in the docs. Search Google for: \"Alpas+{$query}\"")
->arg("https://www.google.com/search?q=alpas+{$query}")
->quicklookurl("https://www.google.com/search?q=alpas+{$query}")
->valid(true);

echo $workflow->output();
exit;
}
$workflow->result()
->title('No matches')
->icon('google.png')
->subtitle("No match found in the docs. Search Google for: \"Alpas+{$query}\"")
->arg("https://www.google.com/search?q=alpas+{$query}")
->quicklookurl("https://www.google.com/search?q=alpas+{$query}")
->valid(true);

echo $workflow->output();
exit;
}

Expand All @@ -47,7 +42,10 @@
$subtitle = $hit['hierarchy']['lvl0'];
while ($currentLvl < $highestLvl) {
$currentLvl = $currentLvl + 1;
$subtitle = $subtitle.' » '.$hit['hierarchy']['lvl'.$currentLvl];
$lvl = $hit['hierarchy']['lvl'.$currentLvl];
if (!empty($lvl)) {
$subtitle = $subtitle.''.$lvl;
}
}

$workflow->result()
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "alpas/docsalfred",
"description": "Alpas docs search workflow for Alfred.",
"version": "1.1.0",
"version": "1.0.1",
"keywords": ["alfred", "alfred-workflow", "alpas", "algolia"],
"homepage": "https://github.com/alpas",
"support": {
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<key>variablesdontexport</key>
<array/>
<key>version</key>
<string>1.0.0</string>
<string>1.0.1</string>
<key>webaddress</key>
<string>https://alpas.dev</string>
</dict>
Expand Down
Binary file modified screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cba2d93

Please sign in to comment.