Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added meta robots tags #735

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions resources/views/components/meta.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% macro robots(value) %}
<meta name="robots" content="{{ value }}" >
{% endmacro %}
6 changes: 6 additions & 0 deletions resources/views/forum/category.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@

{% import 'components.forms' as forms %}

{% import 'components.meta' as meta %}
{% block meta_robots %}
{{ meta.robots('index, follow') }}
{{ parent() }}
{% endblock %}

{% block content %}
<h1>{{ link_to_route('forum.category', forum.title|default(forum.name), [forum.slug]) }}</h1>

Expand Down
9 changes: 9 additions & 0 deletions resources/views/forum/topics.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
{% extends 'forum.home' %}

{% import 'components.meta' as meta %}
{% block meta_robots %}
{% set path = app.request.path %}
{% if path != 'Forum/Interesting' %}
{{ meta.robots('index, follow') }}
{% endif %}
{{ parent() }}
{% endblock %}

{% set current_tag = renderParams.tagName|default(null) %}

{% block title %}
Expand Down
6 changes: 6 additions & 0 deletions resources/views/home.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@

{% import 'components.modals' as modal %}

{% import 'components.meta' as meta %}
{% block meta_robots %}
{{ meta.robots('index, follow') }}
{{ parent() }}
{% endblock %}

{% block container %}
<div class="row mt-4">
<div class="col-12">
Expand Down
3 changes: 3 additions & 0 deletions resources/views/layout.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

{{ render_region('head') }}

{% block meta_robots %}
{% endblock %}

{% block head %}
<title>{%- block title -%} :: 4programmers.net{%- endblock -%}</title>

Expand Down
6 changes: 6 additions & 0 deletions resources/views/microblog/home.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

{% block title %}{% if current_tag %}{{ current_tag }} :: {% endif %}Mikroblogi{{ parent() }}{% endblock %}

{% import 'components.meta' as meta %}
{% block meta_robots %}
{{ meta.robots('index, follow') }}
{{ parent() }}
{% endblock %}

{% block description %}
{% if current_tag %}
{{ current_tag }} w mikroblogach. Sprawdź, co inni użytkownicy piszą o tym temacie. Chcesz podzielić się czymś ciekawym w temacie: {{ current_tag }}? Utwórz wpis w mikroblogu.
Expand Down
6 changes: 6 additions & 0 deletions resources/views/microblog/view.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
{% block description %}{{ excerpt }}{% endblock %}
{% block keywords %}{{ keywords(microblog.text)|join(',') }}{% endblock %}

{% import 'components.meta' as meta %}
{% block meta_robots %}
{{ meta.robots('index, follow') }}
{{ parent() }}
{% endblock %}

{% block container %}
<div id="js-microblog" class="row">
<div class="col-12">
Expand Down
6 changes: 6 additions & 0 deletions resources/views/profile/home.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{% extends 'layout' %}
{% block title %}{{ user.name }} - Profil {{ parent() }}{% endblock %}

{% import 'components.meta' as meta %}
{% block meta_robots %}
{{ meta.robots('index, follow') }}
{{ parent() }}
{% endblock %}

{% block container %}
<script>
var user = {{ user|json_encode|raw }};
Expand Down
6 changes: 6 additions & 0 deletions resources/views/wiki/category.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

{% import 'components.forms' as forms %}

{% import 'components.meta' as meta %}
{% block meta_robots %}
{{ meta.robots('index, follow') }}
{{ parent() }}
{% endblock %}

{% block container %}
<div class="box">
<div class="nav nav-panel">
Expand Down
6 changes: 6 additions & 0 deletions resources/views/wiki/home.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{% extends 'layout' %}
{% block title %}Kompendium wiedzy{{ parent() }}{% endblock %}

{% import 'components.meta' as meta %}
{% block meta_robots %}
{{ meta.robots('index, follow') }}
{{ parent() }}
{% endblock %}

{% block container %}
<div class="row">
<div class="col-sm-2">
Expand Down
6 changes: 6 additions & 0 deletions resources/views/wiki/show.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{% extends 'wiki.page' %}

{% import 'components.meta' as meta %}
{% block meta_robots %}
{{ meta.robots('index, follow') }}
{{ parent() }}
{% endblock %}

{% block container %}
<div class="row">
<div class="col-sm-9">
Expand Down
Loading