1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-11 18:32:50 +00:00
This commit is contained in:
2016-08-27 06:39:10 +00:00
parent be6cb39489
commit 4bcb240e97
8 changed files with 32 additions and 23 deletions

View File

@@ -1,5 +1,6 @@
.Content { .Content {
flex: 1; flex: 1;
flex-wrap: wrap;
.post + .post { .post + .post {
margin-top: 2em; margin-top: 2em;
} }
@@ -23,4 +24,8 @@
height: auto; height: auto;
margin: auto; margin: auto;
} }
code,
pre {
white-space: pre-wrap;
}
} }

View File

@@ -1,6 +1,6 @@
.Footer { .Footer {
height: 5em; height: 5em;
line-height: 5em; align-items: center;
background-color: #F1F1F1; background-color: #F1F1F1;
border-top: solid; border-top: solid;
border-width: 1px; border-width: 1px;

View File

@@ -3,6 +3,7 @@ html {
font-family: 'Roboto Slab', serif; font-family: 'Roboto Slab', serif;
max-width: 100%; max-width: 100%;
overflow-x: hidden; overflow-x: hidden;
overflow-y: scroll;
} }
body { body {
max-width: 100%; max-width: 100%;
@@ -39,29 +40,20 @@ a {
color: #3598db; color: #3598db;
} }
} }
code,
pre {
white-space: pre-wrap;
}
hr { hr {
margin: 1em; margin: 1em;
border: 0; border: 0;
border-top: 1px solid #eee; border-top: 1px solid #eee;
} }
.Layout { .Footer,
height: 100%; .Main {
display: flex; display: flex;
flex-direction: column; padding-right: calc(50% - 997px / 2);
.Footer, padding-left: calc(50% - 997px / 2);
.Main { &:after,
display: flex; &:before {
padding-right: calc(50% - 997px / 2); content: " ";
padding-left: calc(50% - 997px / 2); width: 1em;
&:after,
&:before {
content: " ";
width: 1em;
}
} }
} }
.Main { .Main {

View File

@@ -34,7 +34,7 @@ export default class Index extends React.Component {
render() { render() {
return ( return (
<div class="Layout" > <div>
<Header /> <Header />
<div class="Main"> <div class="Main">
{typeof this.page === 'undefined' ? <Preview posts={this.props.redux.preview.posts} /> : ""} {typeof this.page === 'undefined' ? <Preview posts={this.props.redux.preview.posts} /> : ""}

View File

@@ -1,7 +1,9 @@
{ {
"database": { "database": {
"url": "", "url": "",
"database": "" "database": "",
"username": "",
"password": ""
}, },
"api": { "api": {
"key": "" "key": ""

View File

@@ -5,7 +5,7 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"build": "webpack && babel-node metadata.js", "build": "webpack && babel-node metadata.js",
"c9": "webpack-dev-server --port $PORT --host $IP --hot --content-base public --history-api-fallback", "c9": "webpack-dev-server --port $PORT --host $IP --hot --content-base dist --history-api-fallback",
"dev": "webpack-dev-server --content-base public --inline --hot --history-api-fallback", "dev": "webpack-dev-server --content-base public --inline --hot --history-api-fallback",
"prod": "export NODE_ENV=production && webpack -p && babel-node metadata.js", "prod": "export NODE_ENV=production && webpack -p && babel-node metadata.js",
"prod-win": "set NODE_ENV=production && webpack -p && babel-node metadata.js", "prod-win": "set NODE_ENV=production && webpack -p && babel-node metadata.js",
@@ -31,6 +31,7 @@
"babel-plugin-react-html-attrs": "^2.0.0", "babel-plugin-react-html-attrs": "^2.0.0",
"babel-plugin-transform-class-properties": "^6.11.5", "babel-plugin-transform-class-properties": "^6.11.5",
"babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-polyfill": "^6.13.0",
"babel-preset-es2015": "^6.13.2", "babel-preset-es2015": "^6.13.2",
"babel-preset-react": "^6.11.1", "babel-preset-react": "^6.11.1",
"babel-preset-stage-0": "^6.5.0", "babel-preset-stage-0": "^6.5.0",
@@ -55,6 +56,7 @@
"url-loader": "^0.5.7", "url-loader": "^0.5.7",
"webpack": "^1.13.1", "webpack": "^1.13.1",
"webpack-dev-server": "^1.14.1", "webpack-dev-server": "^1.14.1",
"whatwg-fetch": "^1.0.0",
"wowjs": "^1.1.3" "wowjs": "^1.1.3"
} }
} }

View File

@@ -27,7 +27,15 @@ func Configure(d DatabaseInfo) {
func (d *Driver) Connect() { func (d *Driver) Connect() {
if (d.Info.URL != ""){ if (d.Info.URL != ""){
// Connect to MongoDB // Connect to MongoDB
s, err := mgo.DialWithTimeout(d.Info.URL, 5*time.Second) database_info := &mgo.DialInfo{
Addrs: []string{d.Info.URL},
Database: d.Info.Database,
Timeout: 5*time.Second,
Username: d.Info.Username,
Password: d.Info.Password,
}
s, err := mgo.DialWithInfo(database_info)
if err != nil { if err != nil {
log.Println("MongoDB Driver Error", err) log.Println("MongoDB Driver Error", err)

View File

@@ -5,7 +5,7 @@ var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = { module.exports = {
devtool: debug ? "inline-sourcemap" : null, devtool: debug ? "inline-sourcemap" : null,
entry: "./client/js/app.js", entry: ["babel-polyfill", , "whatwg-fetch", "./client/js/app.js"],
module: { module: {
loaders: [ loaders: [
{ {