diff --git a/app/Http/Web/Views/index.volt b/app/Http/Web/Views/index.volt
deleted file mode 100644
index f240b92b..00000000
--- a/app/Http/Web/Views/index.volt
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
{{ site_settings.title }}
- {{ icon_link("favicon.ico") }}
- {{ css_link("lib/layui/css/layui.css") }}
- {{ js_include("lib/layui/layui.js") }}
-
-
-{{ content() }}
-
-
\ No newline at end of file
diff --git a/app/Http/Web/Views/index/error404.volt b/app/Http/Web/Views/index/error404.volt
deleted file mode 100644
index db06848d..00000000
--- a/app/Http/Web/Views/index/error404.volt
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
I am home error404 page
diff --git a/app/Http/Web/Views/index/index.volt b/app/Http/Web/Views/index/index.volt
index f9343108..3cf49c6a 100644
--- a/app/Http/Web/Views/index/index.volt
+++ b/app/Http/Web/Views/index/index.volt
@@ -1 +1,21 @@
-

\ No newline at end of file
+{% extends "templates/base.volt" %}
+
+{% block content %}
+

+{% endblock %}
+
+{% block inline_css %}
+
+{% endblock %}
+
+{% block inline_js %}
+
+{% endblock %}
\ No newline at end of file
diff --git a/app/Http/Web/Views/layouts/error.volt b/app/Http/Web/Views/layouts/error.volt
index 368d9e33..5868a3ab 100644
--- a/app/Http/Web/Views/layouts/error.volt
+++ b/app/Http/Web/Views/layouts/error.volt
@@ -6,10 +6,9 @@
出错啦
{{ icon_link("favicon.ico") }}
{{ css_link("lib/layui/css/layui.css") }}
- {{ css_link("web/css/style.css") }}
- {{ js_include("lib/layui/layui.js") }}
+ {{ css_link("web/css/error.css") }}
-
+
{{ content() }}
\ No newline at end of file
diff --git a/app/Http/Web/Views/templates/base.volt b/app/Http/Web/Views/templates/base.volt
new file mode 100644
index 00000000..2ae9fc46
--- /dev/null
+++ b/app/Http/Web/Views/templates/base.volt
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
{{ seo.getTitle() }}
+ {{ icon_link("favicon.ico") }}
+ {{ css_link("lib/layui/css/layui.css") }}
+ {{ css_link("web/css/style.css") }}
+ {% block header_css %}{% endblock %}
+ {% block inline_css %}{% endblock %}
+
+
+{% block content %}{% endblock %}
+{{ js_include("lib/layui/layui.js") }}
+{% block footer_js %}{% endblock %}
+{% block inline_js %}{% endblock %}
+
+
\ No newline at end of file
diff --git a/app/Library/Seo.php b/app/Library/Seo.php
new file mode 100644
index 00000000..f7092c89
--- /dev/null
+++ b/app/Library/Seo.php
@@ -0,0 +1,78 @@
+title = $title;
+ }
+
+ public function setKeywords($keywords)
+ {
+ $this->keywords = $keywords;
+ }
+
+ public function setDescription($description)
+ {
+ $this->description = $description;
+ }
+
+ public function setTitleSeparator($titleSeparator)
+ {
+ $this->titleSeparator = $titleSeparator;
+ }
+
+ public function appendTitle($text)
+ {
+ $this->title = $this->title . $this->titleSeparator . $text;
+ }
+
+ public function prependTitle($text)
+ {
+ $this->title = $text . $this->titleSeparator . $this->title;
+ }
+
+ public function getTitle()
+ {
+ return $this->title;
+ }
+
+ public function getKeywords()
+ {
+ return $this->keywords;
+ }
+
+ public function getDescription()
+ {
+ return $this->description;
+ }
+
+ public function getTitleSeparator()
+ {
+ return $this->titleSeparator;
+ }
+
+}
diff --git a/app/Providers/Seo.php b/app/Providers/Seo.php
new file mode 100644
index 00000000..624573d5
--- /dev/null
+++ b/app/Providers/Seo.php
@@ -0,0 +1,19 @@
+di->setShared($this->serviceName, function () {
+ return new AppSeo();
+ });
+ }
+
+}
\ No newline at end of file
diff --git a/app/Providers/Volt.php b/app/Providers/Volt.php
index 6a1c5177..b56127a4 100644
--- a/app/Providers/Volt.php
+++ b/app/Providers/Volt.php
@@ -22,6 +22,10 @@ class Volt extends Provider
$compiler = $volt->getCompiler();
+ $compiler->addFunction('static_url', function ($resolvedArgs) {
+ return 'kg_static_url(' . $resolvedArgs . ')';
+ });
+
$compiler->addFunction('icon_link', function ($resolvedArgs) {
return 'kg_icon_link(' . $resolvedArgs . ')';
});
diff --git a/public/static/admin/css/style.css b/public/static/admin/css/style.css
index 6b211633..07511011 100644
--- a/public/static/admin/css/style.css
+++ b/public/static/admin/css/style.css
@@ -38,34 +38,6 @@
color: green;
}
-.kg-tips {
- margin-top: 30px;
- text-align: center;
-}
-
-.kg-tips .layui-icon-face-surprised {
- display: inline-block;
- font-size: 200px;
- color: #393D49;
-}
-
-.kg-tips .layui-text {
- width: 500px;
- margin: 30px auto;
- padding-top: 20px;
- border-top: 5px solid #009688;
-}
-
-.kg-tips h1 {
- font-size: 100px;
- line-height: 100px;
- color: #009688;
-}
-
-.kg-tips .layui-text span {
- display: inline-block;
-}
-
.kg-side-menu-bar {
position: absolute;
top: 0;
diff --git a/public/static/web/css/error.css b/public/static/web/css/error.css
new file mode 100644
index 00000000..a696277c
--- /dev/null
+++ b/public/static/web/css/error.css
@@ -0,0 +1,27 @@
+.kg-tips {
+ margin-top: 30px;
+ text-align: center;
+}
+
+.kg-tips .layui-icon-face-surprised {
+ display: inline-block;
+ font-size: 200px;
+ color: #393D49;
+}
+
+.kg-tips .layui-text {
+ width: 500px;
+ margin: 30px auto;
+ padding-top: 20px;
+ border-top: 5px solid #009688;
+}
+
+.kg-tips h1 {
+ font-size: 100px;
+ line-height: 100px;
+ color: #009688;
+}
+
+.kg-tips .layui-text span {
+ display: inline-block;
+}
\ No newline at end of file
diff --git a/public/static/web/css/style.css b/public/static/web/css/style.css
index a696277c..e69de29b 100644
--- a/public/static/web/css/style.css
+++ b/public/static/web/css/style.css
@@ -1,27 +0,0 @@
-.kg-tips {
- margin-top: 30px;
- text-align: center;
-}
-
-.kg-tips .layui-icon-face-surprised {
- display: inline-block;
- font-size: 200px;
- color: #393D49;
-}
-
-.kg-tips .layui-text {
- width: 500px;
- margin: 30px auto;
- padding-top: 20px;
- border-top: 5px solid #009688;
-}
-
-.kg-tips h1 {
- font-size: 100px;
- line-height: 100px;
- color: #009688;
-}
-
-.kg-tips .layui-text span {
- display: inline-block;
-}
\ No newline at end of file