Pārlūkot izejas kodu

Update private profile view, add rel=me support, hide avatar/bio when not logged in and add robots meta tag to block search engine indexing on private profiles

Daniel Supernault 2 gadi atpakaļ
vecāks
revīzija
ab4bb9a020

+ 38 - 0
resources/views/layouts/app-guest.blade.php

@@ -0,0 +1,38 @@
+<html lang="en">
+<head>
+	<meta charset="utf-8">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge">
+	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+	<meta name="mobile-web-app-capable" content="yes">
+
+	<title>{{ $title ?? config('app.name', 'Pixelfed') }}</title>
+	<link rel="manifest" href="{{url('/manifest.json')}}">
+
+	<meta property="og:site_name" content="{{ config('app.name', 'pixelfed') }}">
+	<meta property="og:title" content="{{ $title ?? config('app.name', 'pixelfed') }}">
+	<meta property="og:type" content="article">
+	<meta property="og:url" content="{{url(request()->url())}}">
+	@stack('meta')
+
+	<meta name="medium" content="image">
+	<meta name="theme-color" content="#10c5f8">
+	<meta name="apple-mobile-web-app-capable" content="yes">
+	<link rel="shortcut icon" type="image/png" href="{{url('/img/favicon.png?v=2')}}">
+	<link rel="apple-touch-icon" type="image/png" href="{{url('/img/favicon.png?v=2')}}">
+	<link rel="canonical" href="{{url(request()->url())}}">
+	<link href="{{ mix('css/app.css') }}" rel="stylesheet" data-stylesheet="light">
+	@stack('styles')
+</head>
+<body>
+	@include('layouts.partial.nav')
+	<main id="content">
+		@yield('content')
+	</main>
+	@include('layouts.partial.footer')
+	<script type="text/javascript" src="{{ mix('js/manifest.js') }}"></script>
+	<script type="text/javascript" src="{{ mix('js/vendor.js') }}"></script>
+	<script type="text/javascript" src="{{ mix('js/app.js') }}"></script>
+	<script type="text/javascript" src="{{ mix('js/components.js') }}"></script>
+	@stack('scripts')
+</body>
+</html>

+ 4 - 28
resources/views/layouts/app.blade.php

@@ -10,7 +10,7 @@
 	<meta name="mobile-web-app-capable" content="yes">
 	<meta name="mobile-web-app-capable" content="yes">
 
 
 	<title>{{ $title ?? config_cache('app.name') }}</title>
 	<title>{{ $title ?? config_cache('app.name') }}</title>
-	<link rel="manifest" href="/manifest.json">
+	<link rel="manifest" href="{{url('/manifest.json')}}">
 
 
 	<meta property="og:site_name" content="{{ config_cache('app.name') }}">
 	<meta property="og:site_name" content="{{ config_cache('app.name') }}">
 	<meta property="og:title" content="{{ $title ?? config_cache('app.name') }}">
 	<meta property="og:title" content="{{ $title ?? config_cache('app.name') }}">
@@ -21,8 +21,8 @@
 	<meta name="medium" content="image">
 	<meta name="medium" content="image">
 	<meta name="theme-color" content="#10c5f8">
 	<meta name="theme-color" content="#10c5f8">
 	<meta name="apple-mobile-web-app-capable" content="yes">
 	<meta name="apple-mobile-web-app-capable" content="yes">
-	<link rel="shortcut icon" type="image/png" href="/img/favicon.png?v=2">
-	<link rel="apple-touch-icon" type="image/png" href="/img/favicon.png?v=2">
+	<link rel="shortcut icon" type="image/png" href="{{url('/img/favicon.png?v=2')}}">
+	<link rel="apple-touch-icon" type="image/png" href="{{url('/img/favicon.png?v=2')}}">
 	<link rel="canonical" href="{{url(request()->url())}}">
 	<link rel="canonical" href="{{url(request()->url())}}">
 	@if(request()->cookie('dark-mode'))
 	@if(request()->cookie('dark-mode'))
 
 
@@ -58,30 +58,6 @@
 	<script type="text/javascript" src="{{ mix('js/app.js') }}"></script>
 	<script type="text/javascript" src="{{ mix('js/app.js') }}"></script>
 	<script type="text/javascript" src="{{ mix('js/components.js') }}"></script>
 	<script type="text/javascript" src="{{ mix('js/components.js') }}"></script>
 	@stack('scripts')
 	@stack('scripts')
-	<div class="mobile-footer-spacer d-block d-sm-none mt-5"></div>
-	<div class="mobile-footer d-block d-sm-none fixed-bottom">
-		<div class="card card-body rounded-0 pt-2 pb-4 box-shadow" style="border-top:1px solid #F1F5F8">
-			<ul class="nav nav-pills nav-fill d-flex align-items-middle">
-			  <li class="nav-item">
-				<a class="nav-link text-dark" href="/"><i class="fal fa-home fa-2x"></i></a>
-			  </li>
-			  <li class="nav-item">
-				<a class="nav-link text-dark" href="/discover"><i class="fal fa-search fa-2x"></i></a>
-			  </li>
-			  <li class="nav-item">
-				<div class="nav-link cursor-pointer text-dark" onclick="App.util.compose.post()">
-					<i class="fal fa-plus-circle fa-2x"></i>
-				</div>
-			  </li>
-			  <li class="nav-item">
-				<a class="nav-link text-dark" href="/account/activity"><i class="fal fa-bell fa-2x"></i></a>
-			  </li>
-			  <li class="nav-item">
-				<a class="nav-link text-dark" href="/i/me"><i class="fal fa-user fa-2x"></i></a>
-			  </li>
-			</ul>
-		</div>
-	</div>
 </body>
 </body>
 </html>
 </html>
 @endauth
 @endauth
@@ -91,7 +67,7 @@
 <head>
 <head>
 	<meta charset="utf-8">
 	<meta charset="utf-8">
 	<meta http-equiv="X-UA-Compatible" content="IE=edge">
 	<meta http-equiv="X-UA-Compatible" content="IE=edge">
-	<meta name="viewport" content="width=device-width, initial-scale=1">
+	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
 	<meta name="mobile-web-app-capable" content="yes">
 	<meta name="mobile-web-app-capable" content="yes">
 
 
 	<title>{{ $title ?? config('app.name', 'Pixelfed') }}</title>
 	<title>{{ $title ?? config('app.name', 'Pixelfed') }}</title>

+ 4 - 3
resources/views/layouts/spa.blade.php

@@ -7,17 +7,18 @@
 	<meta name="csrf-token" content="{{ csrf_token() }}">
 	<meta name="csrf-token" content="{{ csrf_token() }}">
 	<meta name="mobile-web-app-capable" content="yes">
 	<meta name="mobile-web-app-capable" content="yes">
 	<title>{{ $title ?? config_cache('app.name') }}</title>
 	<title>{{ $title ?? config_cache('app.name') }}</title>
-	<link rel="manifest" href="/manifest.json">
+	<link rel="manifest" href="{{url('/manifest.json')}}">
 	<meta property="og:site_name" content="{{ config_cache('app.name') }}">
 	<meta property="og:site_name" content="{{ config_cache('app.name') }}">
 	<meta property="og:title" content="{{ $title ?? config_cache('app.name') }}">
 	<meta property="og:title" content="{{ $title ?? config_cache('app.name') }}">
 	<meta property="og:type" content="article">
 	<meta property="og:type" content="article">
 	<meta property="og:url" content="{{url(request()->url())}}">
 	<meta property="og:url" content="{{url(request()->url())}}">
 	@stack('meta')
 	@stack('meta')
+
 	<meta name="medium" content="image">
 	<meta name="medium" content="image">
 	<meta name="theme-color" content="#10c5f8">
 	<meta name="theme-color" content="#10c5f8">
 	<meta name="apple-mobile-web-app-capable" content="yes">
 	<meta name="apple-mobile-web-app-capable" content="yes">
-	<link rel="shortcut icon" type="image/png" href="/img/favicon.png?v=2">
-	<link rel="apple-touch-icon" type="image/png" href="/img/favicon.png?v=2">
+	<link rel="shortcut icon" type="image/png" href="{{url('/img/favicon.png?v=2')}}">
+	<link rel="apple-touch-icon" type="image/png" href="{{url('/img/favicon.png?v=2')}}">
 	<link rel="canonical" href="{{url(request()->url())}}">
 	<link rel="canonical" href="{{url(request()->url())}}">
 	<link href="{{ mix('css/app.css') }}" rel="stylesheet" data-stylesheet="light">
 	<link href="{{ mix('css/app.css') }}" rel="stylesheet" data-stylesheet="light">
 	<link href="{{ mix('css/spa.css') }}" rel="stylesheet" data-stylesheet="light">
 	<link href="{{ mix('css/spa.css') }}" rel="stylesheet" data-stylesheet="light">

+ 1 - 1
resources/views/profile/partial/private-info.blade.php

@@ -3,7 +3,7 @@
 		<div class="row">
 		<div class="row">
 			<div class="col-12 col-md-4 d-flex">
 			<div class="col-12 col-md-4 d-flex">
 				<div class="profile-avatar mx-auto">
 				<div class="profile-avatar mx-auto">
-					<img class="rounded-circle box-shadow" src="{{$user->avatarUrl()}}" width="172px" height="172px">
+					<img class="rounded-circle box-shadow" src="/storage/avatars/default.jpg?v=1" width="172px" height="172px">
 				</div>
 				</div>
 			</div>
 			</div>
 			<div class="col-12 col-md-8 d-flex align-items-center">
 			<div class="col-12 col-md-8 d-flex align-items-center">

+ 4 - 6
resources/views/profile/private.blade.php

@@ -1,4 +1,4 @@
-@extends('layouts.app',['title' => $user->username . " on " . config('app.name')])
+@extends('layouts.app-guest',['title' => $user->username . " on " . config('app.name')])
 
 
 @section('content')
 @section('content')
 @if (session('error'))
 @if (session('error'))
@@ -7,7 +7,9 @@
 		</div>
 		</div>
 @endif
 @endif
 @include('profile.partial.private-info')
 @include('profile.partial.private-info')
-
+@if($user->website)
+<a class="d-none" href="{{$user->website}}" rel="me external nofollow noopener">{{$user->website}}</a>
+@endif
 <div class="container">
 <div class="container">
 	<div class="profile-timeline mt-2 mt-md-4">
 	<div class="profile-timeline mt-2 mt-md-4">
 		<div class="">
 		<div class="">
@@ -29,9 +31,5 @@
 @endsection
 @endsection
 
 
 @push('meta')
 @push('meta')
-<meta property="og:description" content="{{$user->bio}}">
-<meta property="og:image" content="{{$user->avatarUrl()}}">
-@if($user->remote_url)
 <meta name="robots" content="noindex, nofollow">
 <meta name="robots" content="noindex, nofollow">
-@endif
 @endpush
 @endpush