Coder Social home page Coder Social logo

actarus-0 / vuejs-wordpress-theme-starter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from evanagee/vuejs-wordpress-theme-starter

0.0 1.0 0.0 2.41 MB

A WordPress theme with the guts ripped out and replaced with Vue.

Home Page: http://vuewordpress.com/

PHP 6.58% Vue 34.05% JavaScript 54.94% CSS 4.44%

vuejs-wordpress-theme-starter's Introduction

image

vuejs-wordpress-theme-starter

A true WordPress theme with the guts ripped out and replaced with Vue. Based on the BlankSlate WP starter theme.

Who's this for? When I started diving into using Vue in WordPress I found plenty of great starters for headless WordPress, but I had the added constraint of needing to run the front and backend on the same host, thus this project was created.

Features

  • VueRouter integrated
  • Vuex integrated (with sample WordPress-centric modules)
  • jQuery integrated, if that's your thing
  • Firebase support and sample config
  • Axios for API requests
  • Follows the development guidelines/structure set forth by Vuejs
  • Bare essentials needed for a functional WordPress theme
  • All requests are redirected back to the index.php so your Vue routing is respected.
  • SCSS support
  • Bootstrap-Vue integrated

Getting started

Watch the getting started video

  • Clone the repo inside of your wp-content/themes/ directory
  • Navigate to the theme directory and run npm install npm run watch for development npm run production when you're ready to deploy the theme.

New to Vue?

Not sure where to begin? The Vuejs documentation is actually amazing, but if you're looking for video training I highly recommend the free Learn Vue 2: Step By Step course over at Laracasts. There's also a great playlist by Academind available on YouTube that covers pretty much everything you'd want to know about building a fully-featured Vue app.

I've created a couple of example components in src/components/widgets to give you an idea of how to work with the Vuex store data.

If you're new to Vue/Vuex I would do the following:

  • Open up src/app.js this is the main JS file for the app and will give you a glimpse into what's going on behind the scenes.
  • Next open up src/App.vue this is the primary app component, a page wrapper of sorts. It contains the header/footer and the <router-view> component which is what loads in all of the other screens as you navigate around the app. Note that by default src/components/Home.vue is loaded into the router-view initially.
  • Next open up src/routes/index.js and notice how the routes are setup by default. Out of the box there is only one route, the / or home view. For more information on setting up routing within your app checkout Vue-Router.
  • Next is the Vuex store. I won't cover how that works here as it's a tiny bit more advanced. Check out all files in src/store and start to familiarize yourself with what's going on. It's based on the official Vuex example project setup and uses Vuex modules. By default I've included a couple of modules I thought you might need.

The first thing you're probably going to want to do is start editing and components in src/components/.

Code Organization

All of the code you're going to edit is located in /src/. From there it's broken into a few logical directories.

  • /src
    • /api for API requests
    • /assets for images mostly
    • /components Vue components
    • /router vue-router directives
    • /store vuex store and modules
    • /styles SCSS styles
    • /vendor 3rd party scripts and libraries

All scripts and styles in /src are compiled down to the /dist directory, which is what you will deploy. When you're ready to deploy don't deploy the src/ directory.

External References

Features coming soon:

  • Example components for loading recent posts.
  • WordPress menu integration
  • A few more starter routes
  • More documentation

vuejs-wordpress-theme-starter's People

Contributors

evanagee avatar wester97 avatar nattatorn-dev avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.