felix 2 years ago
parent
commit
92fdd74db9
4 changed files with 2 additions and 28 deletions
  1. 2 6
      frog.py
  2. 0 3
      templates/footer.html
  3. 0 16
      templates/header.html
  4. 0 3
      templates/index2.html

+ 2 - 6
frog.py

@@ -14,14 +14,10 @@ def internal_server_error(e):
 def index():
     return render_template('index.html')
 
-@app.route('/index2')
-def index2():
-    return render_template('index2.html',title='Index - Frog')
-
 @app.route('/post/')
 def posts():
-    allposts=[{'id':1,'title':'title1'},{'id':2,'title':'title2'}]
-    return render_template('posts.html',posts=allposts)
+    page=request.args.get('page')
+    return '<h1>%s</h1>' % page
 
 @app.route('/post/<int:id>')
 def post(id):

+ 0 - 3
templates/footer.html

@@ -1,3 +0,0 @@
-        </div>
-    </body>
-</html>

+ 0 - 16
templates/header.html

@@ -1,16 +0,0 @@
-<html>
-    <head>
-        <title>{{ title }}</title>
-        <link rel="stylesheet" href="//cdnjs.loli.net/ajax/libs/mdui/0.4.3/css/mdui.min.css">
-        <script src="//cdnjs.loli.net/ajax/libs/mdui/0.4.3/js/mdui.min.js"> var SS=mdui.JQ;</script>
-        <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
-        <link rel='stylesheet' href="{{ url_for('static',filename='style.css') }}">
-        <script src="{{ url_for('static',filename='myfunction.js') }}"></script>
-    </head>
-    <body class='mdui-theme-primary-light-green'>
-        <div class="mdui-toolbar mdui-color-theme">
-            <a href='/' class='mdui-typo-headline mdui-text-color-white' style='font-weight:bold'>Frog</a>
-            <a href='/' class='mdui-text-color-white'>首页</a>
-            <a href="{{ url_for('posts') }}" class='mdui-text-color-white'>文章</a>
-        </div>
-        <div class='mdui-container'>

+ 0 - 3
templates/index2.html

@@ -1,3 +0,0 @@
-{% include 'header.html' %}
-<h1>hello world!</h1>
-{% include 'footer.html' %}