Skip to content

Commit

Permalink
Hello, world.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmacarthur committed Dec 19, 2017
1 parent 74f0f01 commit e5593b1
Show file tree
Hide file tree
Showing 40 changed files with 6,189 additions and 81 deletions.
6 changes: 1 addition & 5 deletions .babelrc
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
{
"presets": [
["latest", {
"es2015": { "modules": false }
}]
]
"presets": ["env"]
}
Empty file modified .gitignore
100644 → 100755
Empty file.
46 changes: 46 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of physical, social, cultural, or professional composition. Examples of such composition include age, ethnicity, level of development experience, race, sex, religion, and many more beyond these.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at alex@macarthur.me. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
25 changes: 25 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Contributing

## Set Up Local Environment

1. Clone the repository & `cd` into it.
2. Make sure `yarn` is on your machine and run `yarn install`.
3. To spin up locally with hot reloading, execute `yarn run dev`.
4. When you're ready to compile for production, run `yarn run build`.

## Feature Requests / Bug Reports

If you have a feature request or bug you've noticed, please [make an issue](https://github.com/alexmacarthur/wp-vue/issues) on Github, and assign the appropriate label.

## Make Pull Request

To make a pull request, please follow these steps.

1. Make a descriptive issue.
2. Fork the repository.
3. Create a new branch with a brief, descriptive name.
4. Make a pull request to the master branch and note in the PR description that it closes the issue you previously created.

## THANK YOU!

... for contributing!
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 Alex MacArthur

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
41 changes: 29 additions & 12 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
# wp-vue
# WP Vue

> A simple WordPress theme that feeds
This is just a simple Vue blog that displays posts from a WordPress REST API endpoint. Clone or fork this sucka & rip it apart to suit your own needs. If you have ideas to make it better for everyone else, contribute!

## Build Setup
## Install

``` bash
# install dependencies
npm install
1. Make sure you have `yarn` installed on your machine, and run `yarn install`.
## Usage

# serve with hot reload at localhost:8080
npm run dev
### Set Your Constants
Set your specific constants in the `config.js` file.

# build for production with minification
npm run build
```
* `REST_ENDPOINT` - The WordPress REST API endpoint from which data will be pulled. Leave off the trailing slash. Example: `https://blah-blah-blah.com/wp-json/wp/v2`
* `POSTS_PER_PAGE` - The default number of posts per page that will be displayed.
* `GA_TRACKING_ID` - A Google Analytics tracking ID.

For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader).
### Spin Up Locally
Run `yarn run dev` to spin up a running version from localhost.

### Build for Production
Run `yarn run build`.

### Deploy to Netlify
Netlify is amazing, so if you're in need of somewhere to host your own version of this project, I highly recommend it.

[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/alexmacarthur/wp-vue)

## Contribute

Please do! See the [CONTRIBUTING.md](CONTRIBUTING.md) for details.

## License

MIT © [Alex MacArthur](https://macarthur.me)
1 change: 1 addition & 0 deletions _redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* /index.html 200
7 changes: 7 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//-- Do NOT include a trailing slash on the API endpoint.

module.exports = {
REST_ENDPOINT: JSON.stringify('https://wptavern.com/wp-json/wp/v2'),
POSTS_PER_PAGE: JSON.stringify(9),
GA_TRACKING_ID: JSON.stringify('UA-111438908-1')
};
17 changes: 16 additions & 1 deletion index.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,22 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>wp-vue</title>
<title>WP Vue</title>
<link rel="preload" href="https://fonts.googleapis.com/css?family=Open+Sans:100,300,400|Nunito:400,800" as="style" onload="this.rel='stylesheet'">
<script src="/src/vendor/loadCSS.js"></script>

<meta name="description" content="Just a simple Vue blog that displays posts via the WordPress REST API. Fork it and rip it up!">
<meta name="keywords" content="Vue,JavaScript,WordPress,REST API">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="og:site_name" content="WP Vue" />
<meta property="og:locale" content="en_us" />
<meta property="og:description" content="Just a simple Vue blog that displays posts via the WordPress REST API. Fork it and rip it up!" />
<meta property="og:title" content="WP Vue" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="About" />
<meta name="twitter:description" content="Just a simple Vue blog that displays posts via the WordPress REST API." />

</head>
<body>
<div id="app"></div>
Expand Down
38 changes: 29 additions & 9 deletions package.json
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,29 +1,49 @@
{
"name": "wp-vue",
"description": "A simple WordPress theme that feeds",
"version": "1.0.0",
"author": "Alex MacArthur",
"private": true,
"description": "Just a Vue template that displays posts via the WordPress REST API. Rip this sucka apart and make it your own!",
"version": "0.0.1",
"license": "MIT",
"author": "Alex MacArthur <alex@macarthur.me> (https://macarthur.me)",
"scripts": {
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
},
"bugs": {
"url": "https://github.com/alexmacarthur/wp-vue/issues"
},
"homepage": "https://wp.netlify.com",
"dependencies": {
"vue": "^2.2.1",
"vue-router": "^2.1.1"
"axios": "^0.17.1",
"vue": "^2.5.9",
"vue-analytics": "^5.7.1",
"vue-router": "^3.0.1"
},
"keywords": [
"vue",
"wordpress",
"blog",
"REST",
"API"
],
"devDependencies": {
"babel-core": "^6.0.0",
"babel-loader": "^6.0.0",
"babel-preset-latest": "^6.0.0",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.1",
"cross-env": "^3.0.0",
"css-loader": "^0.25.0",
"file-loader": "^0.9.0",
"node-sass": "^4.5.0",
"sass-loader": "^5.0.1",
"sass-resources-loader": "^1.3.1",
"vue-loader": "^11.1.4",
"vue-template-compiler": "^2.2.1",
"webpack": "^2.2.0",
"webpack-dev-server": "^2.2.0"
},
"main": "src/main.js",
"repository": {
"type": "git",
"url": "https://github.com/alexmacarthur/wp-vue"
}
}
104 changes: 92 additions & 12 deletions src/App.vue
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,28 +1,108 @@
<template>
<div id="app">
<router-view></router-view>

<TopBar
@showUpdater="showUpdater = true"
/>

<div id="wrapper">

<transition name="fade">
<Updater
v-if="showUpdater"
@close="showUpdater = false"
/>
</transition>

<transition name="fade">
<Loading
v-if="loadingOn"
:message="loadingMessage"
:showWheel="loadingWheel"
/>
</transition>

<router-view :key="this.viewKey"></router-view>

</div>

<Foot />
</div>
</template>

<script>
export default {
name: 'app',
data () {
return {
}
},
import bus from './bus';
import Foot from './components/Foot';
import Loading from './components/Loading';
import Updater from './components/Updater';
import TopBar from './components/TopBar';
export default {
name: 'App',
data () {
return {
loadingOn: true,
loadingMessage: 'Loading WP Vue',
loadingWheel: true,
showUpdater: false,
viewKey: 0
}
},
created: function () {
bus.$on('toggleLoading', (status = true) => {
if(typeof status === 'string') {
this.loadingOn = true;
this.showWheel = false;
this.loadingMessage = status;
return;
}
created: function () {
console.log(this.$route)
this.loadingMessage = 'Loading...';
this.loadingWheel = true;
this.loadingOn = status;
});
bus.$on('bumpViewKey', (loadingMessage) => {
bus.$emit('toggleLoading', loadingMessage);
this.viewKey = this.viewKey + 1;
});
},
components: {
Foot,
Loading,
Updater,
TopBar
}
}
}
</script>

<style lang="scss">
@import "assets/scss/_base.scss";
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
}
#wrapper {
max-width: 1200px;
margin: 0 auto;
padding: 1rem;
@include media($small) {
padding: 2rem;
}
}
.fade-enter-active, .fade-leave-active {
transition: opacity .25s
}
.fade-enter, .fade-leave-to {
opacity: 0
}
</style>
Loading

0 comments on commit e5593b1

Please sign in to comment.