Search! Closes #38
Squashed commit of the following: commit edc3e917d710f34c2ac487474db37a8acf2134c9 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Nov 25 19:51:32 2016 +0000 Update changelog commit 78668c68557c4121bf4b8862b76102ac87c81787 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Nov 25 19:50:39 2016 +0000 Add the search feature commit dfe8447dcb236e03a7870f40e53a4276fc06e580 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Nov 25 19:26:23 2016 +0000 Add a search form in the footer commit 626b0124653d9697e1ac6d3424805af41546ba17 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Nov 25 18:00:38 2016 +0000 Installing/setting up scout commit 52d7d7e7e058247fa73963b4dd45aa8649df4b9f Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Nov 25 17:50:56 2016 +0000 Add search dependencies
This commit is contained in:
parent
eb51253f33
commit
b53221a94a
15 changed files with 305 additions and 4 deletions
|
@ -47,3 +47,6 @@ TWITTER_CONSUMER_KEY=
|
||||||
TWITTER_CONSUMER_SECRET=
|
TWITTER_CONSUMER_SECRET=
|
||||||
TWITTER_ACCESS_TOKEN=
|
TWITTER_ACCESS_TOKEN=
|
||||||
TWITTER_ACCESS_TOKEN_SECRET=
|
TWITTER_ACCESS_TOKEN_SECRET=
|
||||||
|
|
||||||
|
ALGOLIA_APP_ID=
|
||||||
|
ALGOLIA_SECRET=
|
||||||
|
|
26
app/Http/Controllers/SearchController.php
Normal file
26
app/Http/Controllers/SearchController.php
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Note;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class SearchController extends Controller
|
||||||
|
{
|
||||||
|
public function search(Request $request)
|
||||||
|
{
|
||||||
|
$notes = Note::search($request->terms)->paginate(10);
|
||||||
|
foreach ($notes as $note) {
|
||||||
|
$note->iso8601_time = $note->updated_at->toISO8601String();
|
||||||
|
$note->human_time = $note->updated_at->diffForHumans();
|
||||||
|
$photoURLs = [];
|
||||||
|
$photos = $note->getMedia();
|
||||||
|
foreach ($photos as $photo) {
|
||||||
|
$photoURLs[] = $photo->getUrl();
|
||||||
|
}
|
||||||
|
$note->photoURLs = $photoURLs;
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('search', compact('notes'));
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,6 +3,7 @@
|
||||||
namespace App;
|
namespace App;
|
||||||
|
|
||||||
use Normalizer;
|
use Normalizer;
|
||||||
|
use Laravel\Scout\Searchable;
|
||||||
use Jonnybarnes\IndieWeb\Numbers;
|
use Jonnybarnes\IndieWeb\Numbers;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use League\CommonMark\CommonMarkConverter;
|
use League\CommonMark\CommonMarkConverter;
|
||||||
|
@ -13,6 +14,7 @@ use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||||
|
|
||||||
class Note extends Model implements HasMedia
|
class Note extends Model implements HasMedia
|
||||||
{
|
{
|
||||||
|
use Searchable;
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
use HasMediaTrait;
|
use HasMediaTrait;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## Version {next}
|
||||||
|
- Add a basic search feature using Laravel Scout and Algolia (issue#38)
|
||||||
|
|
||||||
## Version 0.0.16.3 (2016-11-25)
|
## Version 0.0.16.3 (2016-11-25)
|
||||||
- StyleCI fix
|
- StyleCI fix
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,9 @@
|
||||||
"league/flysystem-aws-s3-v3": "^1.0",
|
"league/flysystem-aws-s3-v3": "^1.0",
|
||||||
"phaza/laravel-postgis": "~3.1",
|
"phaza/laravel-postgis": "~3.1",
|
||||||
"lcobucci/jwt": "^3.1",
|
"lcobucci/jwt": "^3.1",
|
||||||
"sensiolabs/security-checker": "^4.0"
|
"sensiolabs/security-checker": "^4.0",
|
||||||
|
"laravel/scout": "^1.1",
|
||||||
|
"algolia/algoliasearch-client-php": "^1.11"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"fzaninotto/faker": "~1.4",
|
"fzaninotto/faker": "~1.4",
|
||||||
|
|
116
composer.lock
generated
116
composer.lock
generated
|
@ -4,8 +4,59 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "6109ed77e9efda6af2d9607834c88beb",
|
"content-hash": "f9c5f3db6efad2ea0d257e1240b1370a",
|
||||||
"packages": [
|
"packages": [
|
||||||
|
{
|
||||||
|
"name": "algolia/algoliasearch-client-php",
|
||||||
|
"version": "1.11.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/algolia/algoliasearch-client-php.git",
|
||||||
|
"reference": "d4f29a1fe82f3d6361a516276849bd98dd014cc0"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/algolia/algoliasearch-client-php/zipball/d4f29a1fe82f3d6361a516276849bd98dd014cc0",
|
||||||
|
"reference": "d4f29a1fe82f3d6361a516276849bd98dd014cc0",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-mbstring": "*",
|
||||||
|
"php": ">=5.3"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "^4.8 || ^5.0",
|
||||||
|
"satooshi/php-coveralls": "0.6.*"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-0": {
|
||||||
|
"AlgoliaSearch": "src/",
|
||||||
|
"AlgoliaSearch\\Tests": "tests/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Algolia Team",
|
||||||
|
"email": "contact@algolia.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Ryan T. Catlin",
|
||||||
|
"email": "ryan.catlin@gmail.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Jonathan H. Wage",
|
||||||
|
"email": "jonwage@gmail.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Algolia Search API Client for PHP",
|
||||||
|
"homepage": "https://github.com/algolia/algoliasearch-client-php",
|
||||||
|
"time": "2016-10-20T11:25:18+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "anahkiasen/underscore-php",
|
"name": "anahkiasen/underscore-php",
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
|
@ -1658,6 +1709,69 @@
|
||||||
],
|
],
|
||||||
"time": "2016-11-21T14:14:16+00:00"
|
"time": "2016-11-21T14:14:16+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "laravel/scout",
|
||||||
|
"version": "v1.1.11",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/laravel/scout.git",
|
||||||
|
"reference": "69b8835aad9ef907058775a058f19003ac569495"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/laravel/scout/zipball/69b8835aad9ef907058775a058f19003ac569495",
|
||||||
|
"reference": "69b8835aad9ef907058775a058f19003ac569495",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"illuminate/bus": "~5.3",
|
||||||
|
"illuminate/contracts": "~5.3",
|
||||||
|
"illuminate/database": "~5.3",
|
||||||
|
"illuminate/pagination": "~5.3",
|
||||||
|
"illuminate/queue": "~5.3",
|
||||||
|
"illuminate/support": "~5.3",
|
||||||
|
"php": ">=5.6.4"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"algolia/algoliasearch-client-php": "^1.10",
|
||||||
|
"elasticsearch/elasticsearch": "^2.2",
|
||||||
|
"mockery/mockery": "~0.9",
|
||||||
|
"phpunit/phpunit": "~5.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"algolia/algoliasearch-client-php": "Required to use the Algolia engine (^1.10).",
|
||||||
|
"elasticsearch/elasticsearch": "Required to use the Elasticsearch engine (^2.2)."
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.0-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Laravel\\Scout\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Taylor Otwell",
|
||||||
|
"email": "taylor@laravel.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Laravel Scout provides a driver based solution to searching your Eloquent models.",
|
||||||
|
"keywords": [
|
||||||
|
"algolia",
|
||||||
|
"elasticsearch",
|
||||||
|
"laravel",
|
||||||
|
"search"
|
||||||
|
],
|
||||||
|
"time": "2016-11-21T14:17:34+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "lcobucci/jwt",
|
"name": "lcobucci/jwt",
|
||||||
"version": "3.2.1",
|
"version": "3.2.1",
|
||||||
|
|
|
@ -203,6 +203,11 @@ return [
|
||||||
*/
|
*/
|
||||||
Phaza\LaravelPostgis\DatabaseServiceProvider::class,
|
Phaza\LaravelPostgis\DatabaseServiceProvider::class,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Laravel scout
|
||||||
|
*/
|
||||||
|
Laravel\Scout\ScoutServiceProvider::class,
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
83
config/scout.php
Normal file
83
config/scout.php
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Search Engine
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option controls the default search connection that gets used while
|
||||||
|
| using Laravel Scout. This connection is used when syncing all models
|
||||||
|
| to the search service. You should adjust this based on your needs.
|
||||||
|
|
|
||||||
|
| Supported: "algolia", "elasticsearch", "null"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'driver' => env('SCOUT_DRIVER', 'algolia'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Index Prefix
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may specify a prefix that will be applied to all search index
|
||||||
|
| names used by Scout. This prefix may be useful if you have multiple
|
||||||
|
| "tenants" or applications sharing the same search infrastructure.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'prefix' => env('SCOUT_PREFIX', ''),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Queue Data Syncing
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option allows you to control if the operations that sync your data
|
||||||
|
| with your search engines are queued. When this is set to "true" then
|
||||||
|
| all automatic data syncing will get queued for better performance.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'queue' => true,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Algolia Configuration
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may configure your Algolia settings. Algolia is a cloud hosted
|
||||||
|
| search engine which works great with Scout out of the box. Just plug
|
||||||
|
| in your application ID and admin API key to get started searching.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'algolia' => [
|
||||||
|
'id' => env('ALGOLIA_APP_ID', ''),
|
||||||
|
'secret' => env('ALGOLIA_SECRET', ''),
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Elasticsearch Configuration
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may configure your settings for Elasticsearch, which is a
|
||||||
|
| distributed, open source search and analytics engine. Feel free
|
||||||
|
| to add as many Elasticsearch servers as required by your app.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'elasticsearch' => [
|
||||||
|
'index' => env('ELASTICSEARCH_INDEX', 'laravel'),
|
||||||
|
|
||||||
|
'config' => [
|
||||||
|
'hosts' => [
|
||||||
|
env('ELASTICSEARCH_HOST', 'localhost'),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
2
public/assets/css/app.css
vendored
2
public/assets/css/app.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
21
public/assets/img/algolia.svg
Normal file
21
public/assets/img/algolia.svg
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg width="391px" height="124px" viewBox="0 0 391 124" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||||
|
<!-- Generator: Sketch 3.0.4 (8053) - http://www.bohemiancoding.com/sketch -->
|
||||||
|
<title>Algolia_logo_bg-white</title>
|
||||||
|
<desc>Created with Sketch.</desc>
|
||||||
|
<defs></defs>
|
||||||
|
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
|
||||||
|
<g id="Algolia_logo_bg-white" sketch:type="MSLayerGroup" transform="translate(1.000000, 0.000000)">
|
||||||
|
<path d="M234.602907,47.0181121 L228.907729,67.1993038 L247.249783,57.1465713 C244.58596,52.2621928 240.040498,48.5689338 234.602907,47.0181121 Z" id="Fill-1" fill="#46AEDA" sketch:type="MSShapeGroup"></path>
|
||||||
|
<path d="M202.455755,33.4002509 C200.002399,30.9359747 196.022371,30.9375523 193.569015,33.4002509 L192.458566,34.5156436 C190.00521,36.9783421 190.006781,40.976086 192.458566,43.4403623 L193.641265,44.6267488 C196.159018,40.5690545 199.364715,36.987808 203.090297,34.0391958 L202.455755,33.4002509 Z" id="Fill-2" fill="#46AEDA" sketch:type="MSShapeGroup"></path>
|
||||||
|
<path d="M240.840877,27.223784 C240.850301,27.0881068 240.880143,26.9587402 240.880143,26.8199077 L240.880143,23.6646244 C240.878572,20.1811917 238.067108,17.3556356 234.597542,17.3540579 L223.601419,17.3540579 C220.133424,17.3556356 217.320389,20.1796141 217.320389,23.6646244 L217.320389,26.7646902 C220.821368,25.7802419 224.504543,25.2422661 228.314941,25.2422661 C232.682919,25.2422661 236.890691,25.9427389 240.840877,27.223784" id="Fill-3" fill="#46AEDA" sketch:type="MSShapeGroup"></path>
|
||||||
|
<path d="M228.760635,41.5528326 C242.54501,41.5528326 253.760635,52.7684576 253.760635,66.5528326 C253.760635,80.3372076 242.54501,91.5528326 228.760635,91.5528326 C214.97626,91.5528326 203.760635,80.3372076 203.760635,66.5528326 C203.760635,52.7684576 214.97626,41.5528326 228.760635,41.5528326 M193.760635,66.5528326 C193.760635,85.8807871 209.427907,101.552833 228.760635,101.552833 C248.093362,101.552833 263.760635,85.8807871 263.760635,66.5528326 C263.760635,47.224878 248.093362,31.5528326 228.760635,31.5528326 C209.427907,31.5528326 193.760635,47.224878 193.760635,66.5528326 Z" id="Fill-4" fill="#46AEDA" sketch:type="MSShapeGroup"></path>
|
||||||
|
<path d="M68.5829487,99.6564664 C67.1395211,95.8212196 65.7840499,92.0522338 64.5118232,88.3463536 C63.2395965,84.6404734 61.9233915,80.8699099 60.5679203,77.0362407 L20.6200011,77.0362407 L12.6049727,99.6564664 L-0.244517215,99.6564664 C3.14651674,90.2852752 6.32708356,81.617712 9.29718324,73.6506218 C12.2657123,65.6851092 15.168274,58.1234729 18.0127216,50.9688681 C20.8524573,43.811108 23.6733452,36.9751869 26.472244,30.4579493 C29.2711428,23.9407117 32.1972643,17.4881575 35.2506085,11.0987089 L46.5734263,11.0987089 C49.6267705,17.4881575 52.5528919,23.9407117 55.3517907,30.4579493 C58.1506895,36.9751869 60.9700068,43.811108 63.8128838,50.9688681 C66.6526195,58.1234729 69.5567519,65.6851092 72.5268516,73.6506218 C75.4953806,81.617712 78.6759474,90.2852752 82.068552,99.6564664 L68.5829487,99.6564664 L68.5829487,99.6564664 Z M57.0056855,66.8147006 C54.2900312,59.4013626 51.5979366,52.2262485 48.9278311,45.28147 C46.2545843,38.3382692 43.476104,31.6727333 40.5939607,25.2817071 C37.623861,31.6727333 34.8045438,38.3382692 32.1344383,45.28147 C29.4627622,52.2262485 26.8099339,59.4013626 24.1822359,66.8147006 L57.0056855,66.8147006 L57.0056855,66.8147006 Z" id="Fill-5" fill="#0C1724" sketch:type="MSShapeGroup"></path>
|
||||||
|
<path d="M113.109313,100.932779 C105.815214,100.762393 100.643062,99.1879069 97.5897181,96.2045865 C94.5348033,93.2244215 93.0112725,88.5814222 93.0112725,82.2755886 L93.0112725,2.5352701 L104.83984,0.490646547 L104.83984,80.358754 C104.83984,82.3213402 105.011041,83.9384229 105.34873,85.2163126 C105.689562,86.4926247 106.24086,87.5165141 107.002625,88.2832479 C107.765961,89.0484041 108.785313,89.6242433 110.05754,90.0076102 C111.331337,90.3909771 112.898846,90.7112384 114.763208,90.9668163 L113.109313,100.932779" id="Fill-6" fill="#0C1724" sketch:type="MSShapeGroup"></path>
|
||||||
|
<path d="M169.468957,93.0098622 C168.452747,93.6945587 166.48001,94.5654169 163.553889,95.630325 C160.627767,96.6952331 157.213173,97.228476 153.311678,97.228476 C149.325368,97.228476 145.571513,96.5879535 142.053257,95.3116414 C138.53343,94.032174 135.458096,92.0522338 132.828828,89.3686654 C130.199559,86.6835193 128.121589,83.3420743 126.594917,79.3380199 C125.069815,75.3339654 124.304909,70.5631771 124.304909,65.025655 C124.304909,60.1696741 125.024267,55.7175694 126.467694,51.6709186 C127.909551,47.6258455 130.00794,44.1313693 132.766002,41.1922229 C135.520922,38.2530766 138.891538,35.9528751 142.879419,34.2916185 C146.865729,32.6303618 151.36093,31.7989447 156.365022,31.7989447 C161.878005,31.7989447 166.690477,32.2059762 170.805581,33.0137287 C174.919114,33.8246365 178.374545,34.5692834 181.173443,35.2492469 L181.173443,94.5449075 C181.173443,104.768025 178.545745,112.178208 173.287208,116.778611 C168.02553,121.379014 160.05448,123.677638 149.367775,123.677638 C145.211835,123.677638 141.289921,123.340023 137.600463,122.658481 C133.911006,121.973785 130.70845,121.16761 127.995937,120.230491 L130.158722,109.879584 C132.531975,110.813548 135.437678,111.646543 138.87269,112.37068 C142.307702,113.09324 145.890355,113.457675 149.622221,113.457675 C156.661875,113.457675 161.728793,112.051997 164.826115,109.239062 C167.921867,106.429282 169.468957,101.95509 169.468957,95.8212196 L169.468957,93.0098622 L169.468957,93.0098622 Z M164.57167,42.7256906 C162.576944,42.429094 159.884849,42.2776404 156.493816,42.2776404 C150.132682,42.2776404 145.233824,44.3680155 141.798812,48.5408776 C138.363799,52.7153174 136.647079,58.2512619 136.647079,65.1518664 C136.647079,68.9871132 137.13241,72.2670301 138.109354,74.9931948 C139.084728,77.7209372 140.399362,79.9753871 142.053257,81.7660104 C143.707152,83.5534783 145.615492,84.875542 147.778277,85.7258908 C149.941063,86.579395 152.168245,87.0037806 154.458253,87.0037806 C157.594841,87.0037806 160.478555,86.557308 163.107824,85.6627852 C165.735522,84.7666847 167.815063,83.7254413 169.341735,82.5327442 L169.341735,43.6848967 C168.152753,43.3441261 166.564825,43.0254425 164.57167,42.7256906 Z" id="Fill-7" fill="#0C1724" sketch:type="MSShapeGroup"></path>
|
||||||
|
<path d="M296.035098,100.934356 C288.739428,100.762393 283.567276,99.1894845 280.513932,96.2061642 C277.460588,93.2259991 275.933916,88.5814222 275.933916,82.2771662 L275.933916,2.53684774 L287.767195,0.492224188 L287.767195,80.358754 C287.767195,82.3213402 287.935255,83.9384229 288.274515,85.2163126 C288.613776,86.4942023 289.165074,87.5165141 289.929981,88.2832479 C290.691746,89.0499818 291.707957,89.6258209 292.981754,90.0091879 C294.253981,90.3925548 295.82149,90.7112384 297.688993,90.9668163 L296.035098,100.934356" id="Fill-8" fill="#0C1724" sketch:type="MSShapeGroup"></path>
|
||||||
|
<path d="M316.770823,21.1940376 C314.652016,21.1940376 312.847339,20.4904095 311.366216,19.0863084 C309.880381,17.6790521 309.139034,15.7858821 309.139034,13.3989104 C309.139034,11.0135162 309.880381,9.11719097 311.366216,7.71308992 C312.847339,6.30583359 314.652016,5.60378307 316.770823,5.60378307 C318.891201,5.60378307 320.694308,6.30583359 322.180143,7.71308992 C323.661266,9.11719097 324.405754,11.0135162 324.405754,13.3989104 C324.405754,15.7858821 323.661266,17.6790521 322.180143,19.0863084 C320.694308,20.4904095 318.891201,21.1940376 316.770823,21.1940376 L316.770823,21.1940376 Z M310.920151,33.206201 L322.75186,33.206201 L322.75186,99.6564664 L310.920151,99.6564664 L310.920151,33.206201 Z" id="Fill-9" fill="#0C1724" sketch:type="MSShapeGroup"></path>
|
||||||
|
<path d="M364.479326,31.5449444 C369.228972,31.5449444 373.235701,32.1649575 376.502653,33.3986733 C379.766465,34.6339667 382.395733,36.380416 384.388889,38.6364435 C386.382044,40.8956263 387.803482,43.5791947 388.651633,46.6887264 C389.498214,49.798258 389.92386,53.2264733 389.92386,56.9749498 L389.92386,98.5079433 C388.906079,98.6783286 387.48464,98.9118196 385.662686,99.2099938 C383.83759,99.5081681 381.781609,99.7842554 379.491601,100.039833 C377.201593,100.295411 374.719965,100.528902 372.04986,100.741884 C369.376613,100.953288 366.725355,101.062145 364.097658,101.062145 C360.364222,101.062145 356.93078,100.678778 353.792621,99.9120444 C350.654462,99.1453105 347.940378,97.9305265 345.65037,96.2708475 C343.360362,94.6095909 341.579245,92.416669 340.307018,89.6889266 C339.034791,86.9627619 338.398678,83.6828449 338.398678,79.8491758 C338.398678,76.1874696 339.140025,73.0337639 340.62586,70.3927918 C342.106983,67.7533974 344.122127,65.6235812 346.668151,64.0033433 C349.212605,62.3862606 352.181134,61.1919859 355.573739,60.425252 C358.964772,59.6585182 362.527007,59.2751513 366.260443,59.2751513 C367.446284,59.2751513 368.677674,59.338257 369.949901,59.4660459 C371.222127,59.5938349 372.431528,59.7673755 373.574961,59.9787795 C374.719965,60.1917611 375.717328,60.3826557 376.56705,60.553041 C377.413631,60.7250039 378.007336,60.8527929 378.346597,60.9364079 L378.346597,57.6138947 C378.346597,55.6544637 378.134559,53.7171198 377.710484,51.7987076 C377.284837,49.881873 376.521501,48.1795977 375.420475,46.6887264 C374.317879,45.197855 372.811625,44.005158 370.903285,43.1090575 C368.994945,42.2161124 366.513318,41.7680621 363.461544,41.7680621 C359.558478,41.7680621 356.147026,42.0457271 353.219334,42.5994793 C350.294783,43.1532315 348.110008,43.7290707 346.668151,44.3238416 L345.268702,34.4840907 C346.795374,33.8041272 349.341398,33.1430953 352.902062,32.5041505 C356.464297,31.863628 360.323385,31.5449444 364.479326,31.5449444 L364.479326,31.5449444 Z M365.497107,91.0946053 C368.296006,91.0946053 370.777633,91.029922 372.940419,90.902133 C375.103204,90.7743441 376.90474,90.5424307 378.346597,90.2000825 L378.346597,70.3927918 C377.496875,69.9684063 376.119415,69.6055487 374.212645,69.3073744 C372.302735,69.0092001 369.992308,68.8577465 367.278224,68.8577465 C365.497107,68.8577465 363.609185,68.9871132 361.617601,69.2426911 C359.624446,69.498269 357.79935,70.0315119 356.147026,70.8392644 C354.49156,71.6501722 353.11253,72.756099 352.011504,74.1633553 C350.908907,75.5674564 350.357609,77.4211853 350.357609,79.7213868 C350.357609,83.9810192 351.71308,86.9406749 354.428734,88.6019315 C357.142818,90.2647658 360.832276,91.0946053 365.497107,91.0946053 L365.497107,91.0946053 Z" id="Fill-10" fill="#0C1724" sketch:type="MSShapeGroup"></path>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 10 KiB |
9
resources/assets/sass/layout.scss
vendored
9
resources/assets/sass/layout.scss
vendored
|
@ -46,3 +46,12 @@ body > .h-card {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
border-top: 1px solid grey;
|
border-top: 1px solid grey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
footer button {
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.algolia-image {
|
||||||
|
display: inline;
|
||||||
|
height: 2em;
|
||||||
|
}
|
||||||
|
|
|
@ -38,6 +38,10 @@
|
||||||
@show
|
@show
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
|
<form action="search" method="get">
|
||||||
|
<input type="text" name="terms"><button type="submit">Search</button>
|
||||||
|
</form>
|
||||||
|
<p class="algolia-credit">Search powered by </p><img class="algolia-image" src="/assets/img/algolia.svg">
|
||||||
<p>The code for <code>{{ env('APP_LONGURL') }}</code> can be found on <a href="https://github.com/jonnybarnes/jonnybarnes.uk">GitHub</a>.</p>
|
<p>The code for <code>{{ env('APP_LONGURL') }}</code> can be found on <a href="https://github.com/jonnybarnes/jonnybarnes.uk">GitHub</a>.</p>
|
||||||
<p>Built with love: <a href="/colophon">Colophon</a></p>
|
<p>Built with love: <a href="/colophon">Colophon</a></p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
27
resources/views/search.blade.php
Normal file
27
resources/views/search.blade.php
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
@extends('master')
|
||||||
|
|
||||||
|
@section('title')
|
||||||
|
Search « Jonny Barnes
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<h2>Search Results</h2>
|
||||||
|
@foreach($notes as $note)
|
||||||
|
|
||||||
|
<div class="h-entry">
|
||||||
|
@include('templates.note', ['note' => $note])
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@endforeach
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('scripts')
|
||||||
|
@include('templates.mapbox-links')
|
||||||
|
|
||||||
|
<script src="/assets/frontend/Autolinker.min.js"></script>
|
||||||
|
<script src="/assets/js/links.js"></script>
|
||||||
|
<script src="/assets/js/maps.js"></script>
|
||||||
|
|
||||||
|
<script src="/assets/prism/prism.js"></script>
|
||||||
|
<link rel="stylesheet" href="/assets/prism/prism.css">
|
||||||
|
@stop
|
|
@ -129,6 +129,8 @@ Route::group(['domain' => config('url.longurl')], function () {
|
||||||
Route::post('places/new', 'MicropubClientController@postNewPlace');
|
Route::post('places/new', 'MicropubClientController@postNewPlace');
|
||||||
|
|
||||||
Route::get('feed', 'ArticlesController@makeRSS');
|
Route::get('feed', 'ArticlesController@makeRSS');
|
||||||
|
|
||||||
|
Route::get('search', 'SearchController@search');
|
||||||
});
|
});
|
||||||
|
|
||||||
//Short URL
|
//Short URL
|
||||||
|
|
Loading…
Add table
Reference in a new issue