Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
quorauk committed Dec 21, 2018
0 parents commit e2948b4
Show file tree
Hide file tree
Showing 33 changed files with 7,128 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> 1%
last 2 versions
not ie <= 8
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.DS_Store
node_modules
/dist

# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# personalsite

## Project setup
```
yarn install
```

### Compiles and hot-reloads for development
```
yarn run serve
```

### Compiles and minifies for production
```
yarn run build
```

### Run your tests
```
yarn run test
```

### Lints and fixes files
```
yarn run lint
```
5 changes: 5 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/app'
]
}
26 changes: 26 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "personalsite",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@types/vue-material": "calebsander/vue-material-types",
"buttercms": "^1.1.1",
"vue": "^2.5.17",
"vue-class-component": "^6.0.0",
"vue-material": "^1.0.0-beta-10.2",
"vue-property-decorator": "^7.0.0",
"vue-router": "^3.0.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.0.5",
"@vue/cli-plugin-typescript": "^3.0.5",
"@vue/cli-service": "^3.0.5",
"typescript": "^3.0.0",
"vue-template-compiler": "^2.5.17"
}
}
5 changes: 5 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
plugins: {
autoprefixer: {}
}
}
Binary file added public/favicon.ico
Binary file not shown.
27 changes: 27 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link rel="stylesheet" type="text/css" href="/static/butter.css">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-63824506-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-63824506-1');
</script>
<title>Max Prettyjohns</title>
</head>
<body>
<noscript>
<strong>We're sorry but my site doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
Binary file added public/mountain.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
User-agent: *
52 changes: 52 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<template>
<div id="app">
<Header></Header>
<router-view class="content"/>
<Footer class="footer"/>
</div>
</template>
<script>
import { Component, Prop, Vue } from 'vue-property-decorator';
import Header from '@/components/header';
import Footer from '@/components/footer';
@Component({components: {Header, Footer}})
export default class App extends Vue {}
</script>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
display: flex;
min-height: 100vh;
flex-direction: column;
}
#buttercms {
height: 40px;
}
p {
font-size: 1.5em;
line-height: 1.6;
}
#nav {
padding: 30px;
}
#nav a {
font-weight: bold;
color: #2c3e50;
}
#nav a.router-link-exact-active {
color: #42b983;
}
.content {
flex: 1;
}
</style>
72 changes: 72 additions & 0 deletions src/assets/butter.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
.post-container {
h1, h2, h3, h4, h5 {
font-weight: 600;
margin-bottom: 1em;
margin-top: 1.5em;
}

ul, ol {
margin-bottom: 1.25em;

li {
margin-bottom: 0.25em;
}
}

p {
font-family: Georgia, Cambria, "Times New Roman", Times, serif;
font-size: 1.25em;
line-height: 1.58;
margin-bottom: 1.25em;
font-weight: 400;
letter-spacing: -.003em;
}

/* Responsive default image width */
img {
max-width: 100%;
height: auto;
}

/* Responsive floating */
@media only screen and (min-width: 720px) {
.butter-float-left {
float: left;
margin: 0px 10px 10px 0px;
}

.butter-float-right {
float: right;
margin: 0px 0px 10px 10px;
}
}

/* Image caption */
figcaption {
font-style: italic;
text-align: center;
color: #ccc;
}

p code {
padding: 2px 4px;
font-size: 90%;
color: #c7254e;
background-color: #f9f2f4;
border-radius: 4px;
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}

pre {
display: block;
padding: 1em;
margin: 0 0 2em;
font-size: 1em;
line-height: 1.4;
word-break: break-all;
word-wrap: break-word;
color: #333333;
background-color: #f5f5f5;
font-family: Menlo, Monaco,Consolas, "Courier New", monospace;
}
}
Binary file added src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/butter.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module 'buttercms';
11 changes: 11 additions & 0 deletions src/buttercms.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Butter from 'buttercms';
export const butter = Butter('572d9d9c6fa11b51079f7980e26f123c971a2f2a');

export interface ButterInternal {
data: object;
}

export interface ButterData {
data: ButterInternal;
}

82 changes: 82 additions & 0 deletions src/components/Blog.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<template>
<div id="blog-home">
<h1>{{ page_title }}</h1>
<!-- Create v-for and apply a key for Vue. Example is using a combination of the slug and index -->
<div v-for="(post,index) in posts" :key="post.slug + '_' + index">
<router-link :to="'/blog/' + post.slug">
<md-card class="blogpost">
<article class="media">
<figure>
<!-- Bind results using a ':' -->
<!-- Use a v-if/else if their is a featured_image -->
<img v-if="post.featured_image" :src="post.featured_image" alt="">
<img v-else src="http://via.placeholder.com/250x250" alt="">
</figure>
<h2>{{ post.title }}</h2>
<p>{{ post.summary }}</p>
</article>
</md-card>
</router-link>
</div>
</div>
</template>
<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';
import { butter, ButterData} from '@/buttercms';
@Component
export default class HelloWorld extends Vue {
@Prop() private slug!: string;
private posts: object = [];
private mounted() {
this.getPosts();
}
private getPosts() {
const vueM = this;
butter.post.list({page: 1, page_size: 10}).then((resp: ButterData) => {
vueM.posts = resp.data.data;
});
}
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
.about {
padding: 2em;
margin: 2em auto;
max-width: 80em;
}
.cards {
width: 40em;
margin: 1em;
display: inline-block;
}

.blogpost {
padding: 0.5em;
max-width: 60em;
margin: 2em auto;
}

#blog-home {
max-width: 80em;
margin: auto auto;
}
</style>
Loading

0 comments on commit e2948b4

Please sign in to comment.