-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
74f0f01
commit e5593b1
Showing
40 changed files
with
6,189 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
{ | ||
"presets": [ | ||
["latest", { | ||
"es2015": { "modules": false } | ||
}] | ||
] | ||
"presets": ["env"] | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* /index.html 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.