From ae718f8f7003415189d5d5af60a6dabc7363090e Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 6 Jan 2016 15:38:36 +0800 Subject: [PATCH] new home page container --- scripts/home.js | 8 ++++++++ site/static/script.js | 2 +- site/templates/home.html | 36 ++++++------------------------------ webpack.config.js | 1 + 4 files changed, 16 insertions(+), 31 deletions(-) create mode 100644 scripts/home.js diff --git a/scripts/home.js b/scripts/home.js new file mode 100644 index 0000000000..29e83b3651 --- /dev/null +++ b/scripts/home.js @@ -0,0 +1,8 @@ +const React = require('react'); +const ReactDOM = require('react-dom'); + +ReactDOM.render(( +
+ 首页坑位 +
+), document.getElementById('home-container')); diff --git a/site/static/script.js b/site/static/script.js index 4e24a7d440..7d8b972dc6 100644 --- a/site/static/script.js +++ b/site/static/script.js @@ -68,7 +68,7 @@ InstantClickChangeFns.push(function() { } i--; i = (i < 0) ? 0 : i; - i = (i > titles.length - 1) ? (title.length - 1) : i; + i = (i > titles.length - 1) ? (titles.length - 1) : i; } $('.anchor a').removeClass('current'); $('.anchor a').eq(i).addClass('current'); diff --git a/site/templates/home.html b/site/templates/home.html index aed819ef97..56e14029fc 100644 --- a/site/templates/home.html +++ b/site/templates/home.html @@ -1,39 +1,15 @@ {% extends "layout.html" %} -{% block styles %} - -{% endblock %} - {% block bodyAttribute %}class="index-page"{% endblock %} {% block content %} -
- -
- +
+ {% endblock %} diff --git a/webpack.config.js b/webpack.config.js index 4a3a9d5cf1..1e1d2fe777 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,6 +6,7 @@ var pkg = require('./package'); var entry = {}; entry['index'] = './scripts/importCss.js'; entry['demo'] = './scripts/demo.js'; +entry['home'] = './scripts/home.js'; module.exports = { entry: entry,