Merge pull request #650 from openclassify/dia

#1995 SEO fixes for w3 validator
This commit is contained in:
Ozcan Durak 2020-08-26 15:35:48 +03:00 committed by GitHub
commit d6191b04fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 92 additions and 55 deletions

View File

@ -26,6 +26,7 @@ return [
'estimated_pending_time',
'default_published_time',
'default_GET',
'add_canvas',
'thumbnail_width',
'thumbnail_height',
'picture_width',

View File

@ -108,6 +108,13 @@ return [
'default_value' => 270,
],
],
'add_canvas' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => true,
'mode' => 'checkbox',
],
],
'thumbnail_height' => [
'type' => 'anomaly.field_type.integer',
'config' => [

View File

@ -79,6 +79,9 @@ return [
'default_GET' => [
'name' => 'Default Ad GET',
],
'add_canvas' => [
'name' => 'Add Canvas',
],
'thumbnail_width' => [
'name' => 'Thumbnail Width',
],

View File

@ -317,9 +317,18 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
// Create thumbnail image
$image = Image::make(file_get_contents($adv->files[0]->url()));
$image->resize(
setting_value('visiosoft.module.advs::thumbnail_width'),
setting_value('visiosoft.module.advs::thumbnail_height')
);
null,
setting_value('visiosoft.module.advs::thumbnail_height'),
function ($constraint) {
$constraint->aspectRatio();
});
if (setting_value('visiosoft.module.advs::add_canvas')) {
$image->resizeCanvas(
setting_value('visiosoft.module.advs::thumbnail_width'),
setting_value('visiosoft.module.advs::thumbnail_height'),
'center', false, 'fff'
);
}
$fileName = 'tn-' . $adv->files[0]->name;
$image->save(app_storage_path() . '/files-module/local/images/' . $fileName);

View File

@ -278,10 +278,6 @@ class AdvsController extends PublicController
$radio = $returnvalues['radio'];
}
if (!empty($param['user'])) {
$user = $this->userRepository->find($param['user']);
}
Cookie::queue(Cookie::make('last_search', $this->requestHttp->getRequestUri(), 84000));
$viewType = $this->requestHttp->cookie('viewType');
@ -302,6 +298,12 @@ class AdvsController extends PublicController
$this->template->set('meta_title', $catText);
}
if (!empty($param['user'])) {
$user = $this->userRepository->find($param['user']);
$this->template->set('showTitle', false);
$this->template->set('meta_title', $user->name() . ' ' . trans('visiosoft.module.advs::field.ads'));
}
$compact = compact('advs', 'countries', 'mainCats', 'subCats', 'checkboxes', 'request', 'param',
'user', 'featured_advs', 'viewType', 'topfields', 'selectDropdown', 'selectRange', 'selectImage', 'ranges',
'seenList', 'searchedCountry', 'radio', 'categoryId', 'cityId', 'allCats', 'catText');
@ -400,7 +402,11 @@ class AdvsController extends PublicController
$this->template->set('meta_keywords', implode(',', explode(' ', $adv->name)));
$this->template->set('meta_description', strip_tags($adv->advs_desc, ''));
$this->template->set('meta_title', $adv->name . "|" . end($categories)['name']);
$this->template->set('showTitle', false);
$this->template->set(
'meta_title',
$adv->name . " " . end($categories)['name'] . ' ' . setting_value('streams::domain')
);
if (substr($adv->cover_photo, 0, 4) === "http") {
$coverPhoto = $adv->cover_photo;
} else {

View File

@ -1,15 +1,15 @@
<!doctype html>
<!--[if lt IE 7]>
<html class="nojs ms lt_ie7" lang="en"><![endif]-->
<html class="nojs ms lt_ie7" lang="{{ config('app.locale') }}"><![endif]-->
<!--[if IE 7]>
<html class="nojs ms ie7" lang="en"><![endif]-->
<html class="nojs ms ie7" lang="{{ config('app.locale') }}"><![endif]-->
<!--[if IE 8]>
<html class="nojs ms ie8" lang="en"><![endif]-->
<html class="nojs ms ie8" lang="{{ config('app.locale') }}"><![endif]-->
<!--[if gt IE 8]>
<html class="nojs ms" lang="en"><![endif]-->
<html class="nojs ms" lang="{{ config('app.locale') }}"><![endif]-->
<html>
<html lang="{{ config('app.locale') }}">
<head>
{% include "visiosoft.theme.base::partials/metadata" %}

View File

@ -1,15 +1,15 @@
<!doctype html>
<!--[if lt IE 7]>
<html class="nojs ms lt_ie7" lang="en"><![endif]-->
<html class="nojs ms lt_ie7" lang="{{ config('app.locale') }}"><![endif]-->
<!--[if IE 7]>
<html class="nojs ms ie7" lang="en"><![endif]-->
<html class="nojs ms ie7" lang="{{ config('app.locale') }}"><![endif]-->
<!--[if IE 8]>
<html class="nojs ms ie8" lang="en"><![endif]-->
<html class="nojs ms ie8" lang="{{ config('app.locale') }}"><![endif]-->
<!--[if gt IE 8]>
<html class="nojs ms" lang="en"><![endif]-->
<html class="nojs ms" lang="{{ config('app.locale') }}"><![endif]-->
<html>
<html lang="{{ config('app.locale') }}">
<head>
{% include "visiosoft.theme.base::partials/metadata" %}

View File

@ -9,7 +9,7 @@
{{ title ?: setting_value('streams::name','Visiosoft LTD.') }}
</title>
<style type="text/css" rel="stylesheet" media="all">
<style rel="stylesheet" media="all">
/* Media Queries */
@media only screen and (max-width: 500px) {
.button {

View File

@ -2,9 +2,6 @@
Main CSS can be found in metadata.twig
#}
<!-- VueJS Requirements -->
<script type="text/javascript" src="{{ asset('js/app.js') }}"></script>
{# Core Theme Components #}
{{ asset_add("theme.js", "visiosoft.theme.base::js/popper.min.js") }}
{{ asset_add("theme.js", "visiosoft.theme.base::js/bootstrap.min.js") }}
@ -24,20 +21,20 @@
{{ asset_script("theme.js") }}
{# Include Styles Loaded From Outside #}
<style type="text/css">
<style>
{% for style in asset_inlines("styles.css", ["min"]) %}
{{ style|raw }}
{% endfor %}
</style>
{# Include Scripts Loaded From Outside #}
<script type="text/javascript">
<script>
{% for script in asset_inlines("scripts.js", ["min"]) %}
{{ script|raw }}
{% endfor %}
</script>
<script type="text/javascript">
<script>
{% for script in asset_inlines("customjs.js") %}
{{ script|raw }}
{% endfor %}

View File

@ -11,7 +11,7 @@
<img src="{{ img('visiosoft.theme.base::images/default-categories-icon.png').url }}" alt="{{ main_category.name }}"
class="img-responsive">
{% endif %}
<font>{{ main_category.name }}</font>
<span>{{ main_category.name }}</span>
<p class="p-0 sub-categories">
{% set sub_categories = entries('cats','category').where('parent_category_id', main_category.id).where('deleted_at', null).orderBy('sort_order').get() %}
{% for sub_category in sub_categories|slice(0,sub_categories_limit) %}

View File

@ -1,4 +1,4 @@
<section id="messages">
<div id="messages">
<!-- Success Messages -->
{% if message_exists('success') %}
@ -54,4 +54,4 @@
</div>
{% endif %}
</section>
</div>

View File

@ -1,6 +1,3 @@
<!-- Locale -->
<meta http-equiv="Content-Language" content="{{ config('app.locale') }}">
<!-- VueJS Requirements -->
<meta name="csrf-token" content="{{ csrf_token() }}" />
@ -27,7 +24,7 @@
{% include "visiosoft.theme.base::partials/styles" %}
{# Custom Theme Components #}
<style type="text/css">
<style>
{% for style in asset_inlines("custom-theme.css", ["min"]) %}
{{ style|raw }}
{% endfor %}

View File

@ -1,12 +1,12 @@
<!-- Meta Tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="{{ config_get('streams::distribution.name') }}"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="description"
content="{{ (template.get('meta_description') ?: setting_value('streams::description'))|slice(0,160) }}"/>
<meta name="keywords" content="{{ template.get('meta_keywords') }}" />
{{ setting_value('visiosoft.module.advs::google_statistic_code')|raw }}
<!-- Meta Tags -->
<title>

View File

@ -28,16 +28,24 @@
<ul class="nav navbar-nav navbar-right d-block d-sm-none">
<li class="nav-item">
{% if auth_check() %}
<a class="nav-link" href="{{ url_route('anomaly.module.users::logout') }}">{{ trans('visiosoft.theme.base::field.logout.name') }}</a>
<a class="nav-link" href="{{ url_route('anomaly.module.users::logout') }}">
{{ trans('visiosoft.theme.base::field.logout.name') }}
</a>
{% else %}
<a class="nav-link" href="{{ url_route('anomaly.module.users::login') }}">{{ trans('visiosoft.theme.base::field.login.name') }}</a>
<a class="nav-link" href="{{ url_route('anomaly.module.users::login') }}" rel="nofollow">
{{ trans('visiosoft.theme.base::field.login.name') }}
</a>
{% endif %}
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_route('profile::profile') }}">{{ trans('visiosoft.theme.base::field.profile') }}</a>
<a class="nav-link" href="{{ url_route('profile::profile') }}" rel="nofollow">
{{ trans('visiosoft.theme.base::field.profile') }}
</a>
</li>
<li class="nav-item">
<a href="/advs/create_adv" class="btn btn-primary">{{ trans("visiosoft.theme.base::button.post_ad.name") }}</a>
<a href="/advs/create_adv" class="btn btn-primary" rel="nofollow">
{{ trans("visiosoft.theme.base::button.post_ad.name") }}
</a>
</li>
</ul>
{% endif %}
@ -47,16 +55,24 @@
<ul class="nav navbar-nav navbar-right">
<li class="nav-item">
{% if auth_check() %}
<a class="nav-link" href="{{ url_route('anomaly.module.users::logout') }}">{{ trans('visiosoft.theme.base::field.logout.name') }}</a>
<a class="nav-link" href="{{ url_route('anomaly.module.users::logout') }}">
{{ trans('visiosoft.theme.base::field.logout.name') }}
</a>
{% else %}
<a class="nav-link" href="{{ url_route('anomaly.module.users::login') }}">{{ trans('visiosoft.theme.base::field.login.name') }}</a>
<a class="nav-link" href="{{ url_route('anomaly.module.users::login') }}" rel="nofollow">
{{ trans('visiosoft.theme.base::field.login.name') }}
</a>
{% endif %}
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_route('profile::profile') }}">{{ trans('visiosoft.theme.base::field.profile') }}</a>
<a class="nav-link" href="{{ url_route('profile::profile') }}" rel="nofollow">
{{ trans('visiosoft.theme.base::field.profile') }}
</a>
</li>
<li class="nav-item">
<a href="/advs/create_adv" class="btn btn-primary">{{ trans("visiosoft.theme.base::button.post_ad.name") }}</a>
<a href="/advs/create_adv" class="btn btn-primary" rel="nofollow">
{{ trans("visiosoft.theme.base::button.post_ad.name") }}
</a>
</li>
</ul>
{% endif %}

View File

@ -1 +0,0 @@
{{ setting_value('visiosoft.module.advs::google_statistic_code')|raw }}

View File

@ -1,3 +1,3 @@
<style type="text/css">
<style>
{{ setting_value("visiosoft.theme.base::style")|raw }}
</style>

View File

@ -62,21 +62,23 @@ class UploadController extends AdminController
$fullImg = WaterMark::make($this->request->file('upload')->getRealPath())
->resize(null, setting_value('visiosoft.field_type.media::imageResizeH', 600),function ($constraint) {
$constraint->aspectRatio();
})
->resizeCanvas(
setting_value('visiosoft.field_type.media::imageCanvasW', 800),
setting_value('visiosoft.field_type.media::imageCanvasH', 600),
'center', false, 'fff'
);
});
$mdImg = WaterMark::make($this->request->file('upload')->getRealPath())
->resize(null, setting_value('visiosoft.module.advs::picture_height'),function ($constraint) {
$constraint->aspectRatio();
})
->resizeCanvas(
setting_value('visiosoft.module.advs::picture_width', 400),
setting_value('visiosoft.module.advs::picture_height', 300),
'center', false, 'fff'
);
});
if (setting_value('visiosoft.module.advs::add_canvas')) {
$fullImg->resizeCanvas(
setting_value('visiosoft.field_type.media::imageCanvasW', 800),
setting_value('visiosoft.field_type.media::imageCanvasH', 600),
'center', false, 'fff'
);
$mdImg->resizeCanvas(
setting_value('visiosoft.module.advs::picture_width', 400),
setting_value('visiosoft.module.advs::picture_height', 300),
'center', false, 'fff'
);
}
foreach ([$fullImg, $mdImg] as $index => $image) {
if ($watermarktype == 'image') {
$watermarkimage_id = $settings->value('visiosoft.module.advs::watermark_image');