mirror of
https://github.com/flarum/core.git
synced 2025-07-30 21:20:24 +02:00
Initial refactor of client actions, data preloading, SEO
An initial stab at flarum/core#126. Still WIP. Preliminary implementation of flarum/core#128 and flarum/core#13.
This commit is contained in:
41
framework/core/views/app.blade.php
Normal file
41
framework/core/views/app.blade.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>{{ $title }}</title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
|
||||
<meta name="theme-color" content="{{ $forum->attributes->themePrimaryColor }}">
|
||||
|
||||
@foreach ($styles as $file)
|
||||
<link rel="stylesheet" href="{{ str_replace(public_path(), '', $file) }}">
|
||||
@endforeach
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@include($layout)
|
||||
|
||||
<div id="modal"></div>
|
||||
<div id="alerts"></div>
|
||||
|
||||
@foreach ($scripts as $file)
|
||||
<script src="{{ str_replace(public_path(), '', $file) }}"></script>
|
||||
@endforeach
|
||||
<script>
|
||||
var app = require('flarum/app')['default'];
|
||||
app.preload = {
|
||||
data: {!! json_encode($data) !!},
|
||||
document: {!! json_encode($document) !!},
|
||||
session: {!! json_encode($session) !!}
|
||||
};
|
||||
app.boot();
|
||||
</script>
|
||||
|
||||
@if ($content)
|
||||
<noscript>
|
||||
{!! $content !!}
|
||||
</noscript>
|
||||
@endif
|
||||
</body>
|
||||
</html>
|
1
framework/core/views/discussion.blade.php
Normal file
1
framework/core/views/discussion.blade.php
Normal file
@@ -0,0 +1 @@
|
||||
discussion SEO content
|
@@ -4,7 +4,7 @@
|
||||
<header class="global-header" id="header">
|
||||
<div id="back-button"></div>
|
||||
<div class="container">
|
||||
<h1 class="header-title"><a href="{{ $config['base_url'] }}" id="home-link">{{ $config['forum_title'] }}</a></h1>
|
||||
<h1 class="header-title"><a href="{{ $forum->attributes->baseUrl }}" id="home-link">{{ $forum->attributes->title }}</a></h1>
|
||||
<div id="header-primary" class="header-primary"></div>
|
||||
<div id="header-secondary" class="header-secondary"></div>
|
||||
</div>
|
||||
|
@@ -1,38 +1 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>{{ $title }}</title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
|
||||
|
||||
<!-- Theme color for Android phones -->
|
||||
<meta name="theme-color" content="{{ $config['theme_primary_color'] }}">
|
||||
|
||||
@foreach ($styles as $file)
|
||||
<link rel="stylesheet" href="{{ str_replace(public_path(), '', $file) }}">
|
||||
@endforeach
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@include($layout)
|
||||
|
||||
<div id="modal"></div>
|
||||
<div id="alerts"></div>
|
||||
|
||||
@foreach ($scripts as $file)
|
||||
<script src="{{ str_replace(public_path(), '', $file) }}"></script>
|
||||
@endforeach
|
||||
<script>
|
||||
var app = require('flarum/app')['default'];
|
||||
app.config = {!! json_encode($config) !!};
|
||||
app.preload = {
|
||||
data: {!! json_encode($data) !!},
|
||||
response: {!! json_encode($response) !!},
|
||||
session: {!! json_encode($session) !!}
|
||||
};
|
||||
app.boot();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
index SEO content
|
||||
|
Reference in New Issue
Block a user