Merge pull request #1206 from jonnybarnes/develop

MTM Simplify build steps
This commit is contained in:
Jonny Barnes 2023-12-22 08:03:01 +00:00 committed by GitHub
commit c0c8e5262b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 452 additions and 11425 deletions

View file

@ -73,10 +73,16 @@ class FeedsController extends Controller
{
$articles = Article::where('published', '1')->latest('updated_at')->take(20)->get();
$data = [
'version' => 'https://jsonfeed.org/version/1',
'version' => 'https://jsonfeed.org/version/1.1',
'title' => 'The JSON Feed for ' . config('user.display_name') . 's blog',
'home_page_url' => config('app.url') . '/blog',
'feed_url' => config('app.url') . '/blog/feed.json',
'authors' => [
[
'name' => config('user.display_name'),
'url' => config('app.url'),
],
],
'items' => [],
];
@ -88,9 +94,6 @@ class FeedsController extends Controller
'content_html' => $article->main,
'date_published' => $article->created_at->tz('UTC')->toRfc3339String(),
'date_modified' => $article->updated_at->tz('UTC')->toRfc3339String(),
'author' => [
'name' => config('user.display_name'),
],
];
}
@ -102,12 +105,18 @@ class FeedsController extends Controller
*/
public function notesJson(): array
{
$notes = Note::latest()->with('media')->take(20)->get();
$notes = Note::latest()->with('media', 'place', 'tags')->take(20)->get();
$data = [
'version' => 'https://jsonfeed.org/version/1',
'version' => 'https://jsonfeed.org/version/1.1',
'title' => 'The JSON Feed for ' . config('user.display_name') . 's notes',
'home_page_url' => config('app.url') . '/notes',
'feed_url' => config('app.url') . '/notes/feed.json',
'authors' => [
[
'name' => config('user.display_name'),
'url' => config('app.url'),
],
],
'items' => [],
];
@ -115,13 +124,13 @@ class FeedsController extends Controller
$data['items'][$key] = [
'id' => $note->longurl,
'url' => $note->longurl,
'content_html' => $note->content,
'content_text' => $note->content,
'date_published' => $note->created_at->tz('UTC')->toRfc3339String(),
'date_modified' => $note->updated_at->tz('UTC')->toRfc3339String(),
'author' => [
'name' => config('user.display_name'),
],
];
if ($note->tags->count() > 0) {
$data['items'][$key]['tags'] = implode(',', $note->tags->pluck('tag')->toArray());
}
}
return $data;

View file

@ -144,17 +144,17 @@ class Note extends Model
*/
public function getContentAttribute(): string
{
$note = $this->note;
$note = $this->getRawOriginal('note');
foreach ($this->media as $media) {
if ($media->type === 'image') {
$note .= '<img src="' . $media->url . '" alt="">';
$note .= PHP_EOL . '<img src="' . $media->url . '" alt="">';
}
if ($media->type === 'audio') {
$note .= '<audio src="' . $media->url . '">';
$note .= PHP_EOL . '<audio src="' . $media->url . '">';
}
if ($media->type === 'video') {
$note .= '<video src="' . $media->url . '">';
$note .= PHP_EOL . '<video src="' . $media->url . '">';
}
}

63
composer.lock generated
View file

@ -1928,16 +1928,16 @@
},
{
"name": "laravel/framework",
"version": "v10.37.3",
"version": "v10.38.1",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "996375dd61f8c6e4ac262b57ed485655d71fcbdc"
"reference": "ced4689f495213e9d23995b36098f12a802cc15b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/996375dd61f8c6e4ac262b57ed485655d71fcbdc",
"reference": "996375dd61f8c6e4ac262b57ed485655d71fcbdc",
"url": "https://api.github.com/repos/laravel/framework/zipball/ced4689f495213e9d23995b36098f12a802cc15b",
"reference": "ced4689f495213e9d23995b36098f12a802cc15b",
"shasum": ""
},
"require": {
@ -1983,6 +1983,8 @@
"voku/portable-ascii": "^2.0"
},
"conflict": {
"carbonphp/carbon-doctrine-types": ">=3.0",
"doctrine/dbal": ">=4.0",
"tightenco/collect": "<5.5.33"
},
"provide": {
@ -2094,6 +2096,7 @@
"files": [
"src/Illuminate/Collections/helpers.php",
"src/Illuminate/Events/functions.php",
"src/Illuminate/Filesystem/functions.php",
"src/Illuminate/Foundation/helpers.php",
"src/Illuminate/Support/helpers.php"
],
@ -2126,7 +2129,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2023-12-13T20:10:58+00:00"
"time": "2023-12-20T14:52:12+00:00"
},
{
"name": "laravel/horizon",
@ -5247,16 +5250,16 @@
},
{
"name": "spatie/laravel-ignition",
"version": "2.3.1",
"version": "2.3.3",
"source": {
"type": "git",
"url": "https://github.com/spatie/laravel-ignition.git",
"reference": "bf21cd15aa47fa4ec5d73bbc932005c70261efc8"
"reference": "66499cd3c858642ded56dafb8fa0352057ca20dd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/bf21cd15aa47fa4ec5d73bbc932005c70261efc8",
"reference": "bf21cd15aa47fa4ec5d73bbc932005c70261efc8",
"url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/66499cd3c858642ded56dafb8fa0352057ca20dd",
"reference": "66499cd3c858642ded56dafb8fa0352057ca20dd",
"shasum": ""
},
"require": {
@ -5335,7 +5338,7 @@
"type": "github"
}
],
"time": "2023-10-09T12:55:26+00:00"
"time": "2023-12-21T09:43:05+00:00"
},
{
"name": "spomky-labs/cbor-php",
@ -9680,16 +9683,16 @@
},
{
"name": "fidry/cpu-core-counter",
"version": "0.5.1",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/theofidry/cpu-core-counter.git",
"reference": "b58e5a3933e541dc286cc91fc4f3898bbc6f1623"
"reference": "85193c0b0cb5c47894b5eaec906e946f054e7077"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/b58e5a3933e541dc286cc91fc4f3898bbc6f1623",
"reference": "b58e5a3933e541dc286cc91fc4f3898bbc6f1623",
"url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/85193c0b0cb5c47894b5eaec906e946f054e7077",
"reference": "85193c0b0cb5c47894b5eaec906e946f054e7077",
"shasum": ""
},
"require": {
@ -9697,13 +9700,13 @@
},
"require-dev": {
"fidry/makefile": "^0.2.0",
"fidry/php-cs-fixer-config": "^1.1.2",
"phpstan/extension-installer": "^1.2.0",
"phpstan/phpstan": "^1.9.2",
"phpstan/phpstan-deprecation-rules": "^1.0.0",
"phpstan/phpstan-phpunit": "^1.2.2",
"phpstan/phpstan-strict-rules": "^1.4.4",
"phpunit/phpunit": "^9.5.26 || ^8.5.31",
"theofidry/php-cs-fixer-config": "^1.0",
"phpunit/phpunit": "^8.5.31 || ^9.5.26",
"webmozarts/strict-phpunit": "^7.5"
},
"type": "library",
@ -9729,7 +9732,7 @@
],
"support": {
"issues": "https://github.com/theofidry/cpu-core-counter/issues",
"source": "https://github.com/theofidry/cpu-core-counter/tree/0.5.1"
"source": "https://github.com/theofidry/cpu-core-counter/tree/1.0.0"
},
"funding": [
{
@ -9737,7 +9740,7 @@
"type": "github"
}
],
"time": "2022-12-24T12:35:10+00:00"
"time": "2023-09-17T21:38:23+00:00"
},
{
"name": "filp/whoops",
@ -11353,16 +11356,16 @@
},
{
"name": "phpstan/phpdoc-parser",
"version": "1.24.4",
"version": "1.24.5",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpdoc-parser.git",
"reference": "6bd0c26f3786cd9b7c359675cb789e35a8e07496"
"reference": "fedf211ff14ec8381c9bf5714e33a7a552dd1acc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/6bd0c26f3786cd9b7c359675cb789e35a8e07496",
"reference": "6bd0c26f3786cd9b7c359675cb789e35a8e07496",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/fedf211ff14ec8381c9bf5714e33a7a552dd1acc",
"reference": "fedf211ff14ec8381c9bf5714e33a7a552dd1acc",
"shasum": ""
},
"require": {
@ -11394,9 +11397,9 @@
"description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": {
"issues": "https://github.com/phpstan/phpdoc-parser/issues",
"source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.4"
"source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.5"
},
"time": "2023-11-26T18:29:22+00:00"
"time": "2023-12-16T09:33:33+00:00"
},
{
"name": "phpunit/php-code-coverage",
@ -13516,16 +13519,16 @@
},
{
"name": "vimeo/psalm",
"version": "5.17.0",
"version": "5.18.0",
"source": {
"type": "git",
"url": "https://github.com/vimeo/psalm.git",
"reference": "c620f6e80d0abfca532b00bda366062aaedf6e5d"
"reference": "b113f3ed0259fd6e212d87c3df80eec95a6abf19"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vimeo/psalm/zipball/c620f6e80d0abfca532b00bda366062aaedf6e5d",
"reference": "c620f6e80d0abfca532b00bda366062aaedf6e5d",
"url": "https://api.github.com/repos/vimeo/psalm/zipball/b113f3ed0259fd6e212d87c3df80eec95a6abf19",
"reference": "b113f3ed0259fd6e212d87c3df80eec95a6abf19",
"shasum": ""
},
"require": {
@ -13544,7 +13547,7 @@
"ext-tokenizer": "*",
"felixfbecker/advanced-json-rpc": "^3.1",
"felixfbecker/language-server-protocol": "^1.5.2",
"fidry/cpu-core-counter": "^0.4.1 || ^0.5.1",
"fidry/cpu-core-counter": "^0.4.1 || ^0.5.1 || ^1.0.0",
"netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0",
"nikic/php-parser": "^4.16",
"php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
@ -13622,7 +13625,7 @@
"issues": "https://github.com/vimeo/psalm/issues",
"source": "https://github.com/vimeo/psalm"
},
"time": "2023-12-03T20:21:41+00:00"
"time": "2023-12-16T09:37:35+00:00"
},
{
"name": "zbateson/mail-mime-parser",

View file

@ -193,6 +193,7 @@ A note with some code:
<?php
echo 'Hello World';
```
EOF;
$noteWithCode = Note::create([
'note' => $noteWithCodeContent,

11243
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -5,41 +5,17 @@
"repository": "https://github.com/jonnybarnes/jonnybarnes.uk",
"license": "CC0-1.0",
"devDependencies": {
"@babel/core": "^7.23.6",
"@babel/preset-env": "^7.23.6",
"@csstools/postcss-oklab-function": "^3.0.7",
"autoprefixer": "^10.4.16",
"babel-loader": "^9.1.3",
"browserlist": "^1.0.1",
"compression-webpack-plugin": "^10.0.0",
"css-loader": "^6.8.1",
"cssnano": "^6.0.2",
"eslint": "^8.55.0",
"eslint-webpack-plugin": "^4.0.1",
"mini-css-extract-plugin": "^2.7.6",
"postcss": "^8.4.32",
"postcss-combine-duplicated-selectors": "^10.0.2",
"postcss-combine-media-query": "^1.0.1",
"postcss-import": "^15.1.0",
"postcss-loader": "^7.3.3",
"postcss-nesting": "^12.0.1",
"style-loader": "^3.3.3",
"stylelint": "^15.11.0",
"stylelint-config-standard": "^34.0.0",
"stylelint-webpack-plugin": "^4.1.1",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4"
"eslint": "^8.56.0",
"stylelint": "^16.0.2",
"stylelint-config-standard": "^35.0.0"
},
"scripts": {
"dev": "webpack --mode=development",
"prod": "webpack --mode=production"
"eslint": "eslint public/assets/js/*.js",
"stylelint": "stylelint public/assets/css/*.css",
"lint": "npm run eslint && npm run stylelint",
"compress": "./scripts/compress.sh",
"build": "npm run lint && npm run compress"
},
"browserslist": [
"last 2 versions",
"> 1%",
"not IE 11",
"not IE_Mob 11"
],
"dependencies": {
"@11ty/is-land": "^4.0.0",
"@zachleat/snow-fall": "^1.0.2"

File diff suppressed because one or more lines are too long

Binary file not shown.

View file

@ -1 +0,0 @@
!function(){"use strict";let e=new class{constructor(){}async register(){const e=await this.getCreateOptions(),t={challenge:this.base64URLStringToBuffer(e.challenge),rp:{id:e.rp.id,name:e.rp.name},user:{id:(new TextEncoder).encode(window.atob(e.user.id)),name:e.user.name,displayName:e.user.displayName},pubKeyCredParams:e.pubKeyCredParams,excludeCredentials:[],authenticatorSelection:e.authenticatorSelection,timeout:6e4},a=await navigator.credentials.create({publicKey:t});if(!a)throw new Error("Error generating a passkey");const n={id:a.id?a.id:null,type:a.type?a.type:null,rawId:a.rawId?this.bufferToBase64URLString(a.rawId):null,response:{attestationObject:a.response.attestationObject?this.bufferToBase64URLString(a.response.attestationObject):null,clientDataJSON:a.response.clientDataJSON?this.bufferToBase64URLString(a.response.clientDataJSON):null}};if(!(await window.fetch("/admin/passkeys/register",{method:"POST",body:JSON.stringify(n),cache:"no-cache",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]').getAttribute("content")}})).ok)throw new Error("Error saving the passkey");window.location.reload()}async getCreateOptions(){const e=await fetch("/admin/passkeys/register",{method:"GET"});return await e.json()}async login(){const e=await this.getLoginData(),t=await navigator.credentials.get({publicKey:{challenge:this.base64URLStringToBuffer(e.challenge),userVerification:e.userVerification,timeout:6e4}});if(!t)throw new Error("Authentication failed");const a={id:t.id?t.id:"",type:t.type?t.type:"",rawId:t.rawId?this.bufferToBase64URLString(t.rawId):"",response:{authenticatorData:t.response.authenticatorData?this.bufferToBase64URLString(t.response.authenticatorData):"",clientDataJSON:t.response.clientDataJSON?this.bufferToBase64URLString(t.response.clientDataJSON):"",signature:t.response.signature?this.bufferToBase64URLString(t.response.signature):"",userHandle:t.response.userHandle?this.bufferToBase64URLString(t.response.userHandle):""}};if(!(await window.fetch("/login/passkey",{method:"POST",body:JSON.stringify(a),headers:{"Content-Type":"application/json","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]').getAttribute("content")}})).ok)throw new Error("Login failed");window.location.assign("/admin")}async getLoginData(){const e=await fetch("/login/passkey",{method:"GET"});return await e.json()}base64URLStringToBuffer(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),a=(4-t.length%4)%4,n=t.padEnd(t.length+a,"="),r=window.atob(n),i=new ArrayBuffer(r.length),s=new Uint8Array(i);for(let e=0;e<r.length;e++)s[e]=r.charCodeAt(e);return i}bufferToBase64URLString(e){const t=new Uint8Array(e);let a="";for(const e of t)a+=String.fromCharCode(e);return btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}};document.querySelectorAll(".add-passkey").forEach((t=>{t.addEventListener("click",(()=>{e.register()}))})),document.querySelectorAll(".login-passkey").forEach((t=>{t.addEventListener("click",(()=>{e.login()}))}))}();

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -19,4 +19,10 @@ a {
& a:visited {
color: var(--color-link);
}
& .rss-icon {
& svg {
color: var(--rss-color-link);
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -8,6 +8,13 @@
#site-header {
grid-column: 2 / 3;
grid-row: 1 / 2;
& .rss-icon {
& svg {
width: auto;
height: 1rem;
}
}
}
main {

Binary file not shown.

Binary file not shown.

View file

@ -19,4 +19,5 @@
--color-link: oklch(48.09% 0.146 241.41deg);
--color-link-visited: oklch(70.44% 0.21 304.41deg);
--color-primary-shadow: oklch(19.56% 0.054 125.505deg / 40%);
--rss-color-link: oklch(67.59% 0.189 42.04deg);
}

Binary file not shown.

View file

@ -1,349 +0,0 @@
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in iOS.
*/
html {
line-height: 1.15; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers.
*/
body {
margin: 0;
}
/**
* Render the `main` element consistently in IE.
*/
main {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box; /* 1 */
height: 0; /* 1 */
overflow: visible; /* 2 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* Remove the gray background on active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* 1. Remove the bottom border in Chrome 57-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none; /* 1 */
text-decoration: underline; /* 2 */
text-decoration: underline dotted; /* 2 */
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Remove the border on images inside links in IE 10.
*/
img {
border-style: none;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 100%; /* 1 */
line-height: 1.15; /* 1 */
margin: 0; /* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input { /* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select { /* 1 */
text-transform: none;
}
/**
* Correct the inability to style clickable types in iOS and Safari.
*/
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Correct the padding in Firefox.
*/
fieldset {
padding: 0.35em 0.75em 0.625em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box; /* 1 */
color: inherit; /* 2 */
display: table; /* 1 */
max-width: 100%; /* 1 */
padding: 0; /* 3 */
white-space: normal; /* 1 */
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Remove the default vertical scrollbar in IE 10+.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10.
* 2. Remove the padding in IE 10.
*/
[type="checkbox"],
[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
/**
* Remove the inner padding in Chrome and Safari on macOS.
*/
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */
font: inherit; /* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in Edge, IE 10+, and Firefox.
*/
details {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Misc
========================================================================== */
/**
* Add the correct display in IE 10+.
*/
template {
display: none;
}
/**
* Add the correct display in IE 10.
*/
[hidden] {
display: none;
}

View file

@ -1,5 +1,3 @@
import '../css/app.css';
import { Auth } from './auth.js';
let auth = new Auth();

BIN
public/assets/js/app.js.br Normal file

Binary file not shown.

BIN
public/assets/js/auth.js.br Normal file

Binary file not shown.

View file

@ -0,0 +1,13 @@
@php
if (isset($title)) {
$uniqueId = bin2hex(random_bytes(6));
}
@endphp
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rss"
@if($title)aria-labelledby="{{ $uniqueId }}"@endif
>
@if($title)<title id="{{ $uniqueId }}">{{ $title }}</title>@endif
<path d="M4 11a9 9 0 0 1 9 9"></path>
<path d="M4 4a16 16 0 0 1 16 16"></path>
<circle cx="5" cy="19" r="1"></circle>
</svg>

View file

@ -4,14 +4,11 @@
<meta charset="UTF-8">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>@yield('title'){{ config('app.name') }}</title>
<meta name="viewport" content="width=device-width">
@if (!empty(config('app.font_link')))
<link rel="stylesheet" href="{{ config('app.font_link') }}">
@endif
<link rel="stylesheet" href="/assets/highlight/zenburn.css">
@production
<link rel="stylesheet" href="/assets/app.css">
@endproduction
<link rel="stylesheet" href="/assets/css/app.css">
<link rel="alternate" type="application/rss+xml" title="Blog RSS Feed" href="/blog/feed.rss">
<link rel="alternate" type="application/atom+xml" title="Blog Atom Feed" href="/blog/feed.atom">
<link rel="alternate" type="application/json" title="Blog JSON Feed" href="/blog/feed.json">
@ -47,6 +44,7 @@
<a href="/likes">Likes</a>
<a href="/contacts">Contacts</a>
<a href="/projects">Projects</a>
<a href="/notes/feed.json" class="rss-icon">@include('icons.rss', ['title' => 'RSS Feed'])</a>
</nav>
</header>
@ -80,7 +78,7 @@
@section('scripts')
<script type="module" src="/assets/frontend/is-land.js"></script>
<script type="module" src="/assets/frontend/snow-fall.js"></script>
<script src="/assets/app.js"></script>
<script type="module" src="/assets/js/app.js"></script>
@show
</body>
</html>

3
scripts/build.sh Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env zsh
echo "Build script"

View file

@ -1,37 +0,0 @@
#!/usr/bin/env zsh
echo "compressing app.css"
zopfli --i100 ./public/assets/css/app.css
brotli --force --quality=11 --output=./public/assets/css/app.css.br -- ./public/assets/css/app.css
echo "compressing js assets"
for file in ./public/assets/js/*.js
do
zopfli --i100 $file
brotli --force --quality=11 --output=$file.br -- $file
done
echo "compressing frontend assets"
for file in ./public/assets/frontend/*.css
do
if [[ -f $file ]]; then
zopfli --i100 $file
brotli --force --quality=11 --output=$file.br -- $file
fi
done
for file in ./public/assets/frontend/a11y.css/*.css
do
if [[ -f $file ]]; then
zopfli --i100 $file
brotli --force --quality=11 --output=$file.br -- $file
fi
done
echo "compressing highlight styles"
for file in ./public/assets/highlight/*.css
do
if [[ -f $file ]]; then
zopfli --i100 $file
brotli --force --quality=11 --output=$file.br -- $file
fi
done

16
scripts/compress.sh Executable file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env zsh
if ! type brotli &> /dev/null; then
echo "brotli not installed"
exit 1
fi
for file in ./public/assets/css/*.css
do
brotli --force --quality=11 --output=$file.br -- $file
done
for file in ./public/assets/js/*.js
do
brotli --force --quality=11 --output=$file.br -- $file
done

View file

@ -1,25 +0,0 @@
#!/bin/bash
echo "Putting the Laravel app in maintenance mode"
php artisan down
php artisan horizon:terminate
echo "Pulling the latest changes"
git pull
echo "Updating composer and dependencies"
sudo composer self-update
composer install --no-dev --optimize-autoloader
echo "running any migrations"
php artisan migrate
echo "Caching Laravel route and config files"
php artisan route:cache
php artisan config:cache
echo "Restarting the supervisord instances"
sudo supervisorctl restart all
echo "Bringing the Laravel app back online"
php artisan up

View file

@ -1,7 +0,0 @@
#!/usr/bin/env zsh
for file in ./public/assets/js/*.js
do
echo "uglifying `basename $file`"
uglifyjs --verbose --compress --source-map content=${file:2}.map,url=`basename $file`.map,filename=${file:2}.map,includeSources=true --output $file $file
done

View file

@ -6,6 +6,7 @@ namespace Tests\Feature;
use App\Models\Article;
use App\Models\Note;
use App\Models\Place;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
@ -159,4 +160,14 @@ class FeedsTest extends TestCase
}
}
}
/** @test */
public function jsonNoteFeedLoadsPlaceDataWithoutLazyLoading(): void
{
$place = Place::factory()->create();
Note::factory()->create(['note' => null, 'place_id' => $place->id]);
$response = $this->get('/notes/feed.json');
$response->assertOk();
}
}

View file

@ -322,7 +322,7 @@ class NotesTest extends TestCase
]);
$note->media()->save($media);
$expected = '<p>A nice image</p>
$expected = 'A nice image
<img src="' . config('filesystems.disks.s3.url') . '/test.png" alt="">';
$this->assertEquals($expected, $note->content);
}
@ -339,7 +339,7 @@ class NotesTest extends TestCase
]);
$note->media()->save($media);
$expected = '<p>A nice video</p>
$expected = 'A nice video
<video src="' . config('filesystems.disks.s3.url') . '/test.mkv">';
$this->assertEquals($expected, $note->content);
}
@ -356,7 +356,7 @@ class NotesTest extends TestCase
]);
$note->media()->save($media);
$expected = '<p>Some nice audio</p>
$expected = 'Some nice audio
<audio src="' . config('filesystems.disks.s3.url') . '/test.flac">';
$this->assertEquals($expected, $note->content);
}