瀏覽代碼

:sparkles: update to vue 3 | still lots of issues here

tags/0.9.0
J 5 年之前
父節點
當前提交
7d4f7fe681

+ 2
- 1
configs/wp-config.php 查看文件

@@ -91,8 +91,9 @@ if ( !defined('ABSPATH') )
91 91
 /** Sets up WordPress vars and included files. */
92 92
 require_once(ABSPATH . 'wp-settings.php');
93 93
 
94
-/** DEV */
95 94
 define('IS_DEV', getenv('IS_DEV'));
95
+
96
+/** DEV */
96 97
 if(defined('IS_DEV') && IS_DEV ) {
97 98
         $_SERVER['HTTPS'] = 'off';
98 99
 } else {

+ 17
- 17
docker-compose.yml 查看文件

@@ -1,11 +1,11 @@
1 1
 version: '3' 
2 2
 
3 3
 services:
4
-    vue-wp:
4
+    craft-wp:
5 5
         depends_on:
6
-            - vue-db
6
+            - craft-db
7 7
         image: wordpress
8
-        container_name: "vue-wp"
8
+        container_name: "craft-wp"
9 9
         volumes:
10 10
             - ./configs/wp-config.php:/usr/src/wordpress/wp-config-sample.php
11 11
             - ./uploads:/var/www/html/wp-content/uploads
@@ -15,31 +15,31 @@ services:
15 15
         ports:
16 16
             - "8080:80"
17 17
         links:
18
-            - vue-db:mysql
18
+            - craft-db:mysql
19 19
         environment:
20 20
             WORDPRESS_DB_PASSWORD: "${DB_PASSWORD}"
21 21
             IS_DEV: "${IS_DEV}"
22 22
             WORDPRESS_DB_NAME: current_db
23 23
 
24
-    vue-db:
24
+    craft-db:
25 25
         image: mariadb
26
-        container_name: "vue-db"
26
+        container_name: "craft-db"
27 27
         environment:
28 28
             MYSQL_ROOT_PASSWORD: "${DB_PASSWORD}"
29 29
             INNODB_FLUSH_METHOD: O_DSYNC
30 30
         volumes:
31 31
             - db:/var/lib/mysql
32 32
 
33
-    vue-phpmyadmin:
34
-        image: phpmyadmin/phpmyadmin
35
-        container_name: "vue-phpmyadmin"
36
-        depends_on:
37
-            - vue-db
38
-        ports:
39
-            - 8181:80
40
-        environment:
41
-            PMA_HOST: vue-db
42
-            MYSQL_ROOT_PASSWORD: "${DB_PASSWORD}"
33
+    # craft-phpmyadmin:
34
+    #     image: phpmyadmin/phpmyadmin
35
+    #     container_name: "vue-phpmyadmin"
36
+    #     depends_on:
37
+    #         - craft-db
38
+    #     ports:
39
+    #         - 8181:80
40
+    #     environment:
41
+    #         PMA_HOST: craft-db
42
+    #         MYSQL_ROOT_PASSWORD: "${DB_PASSWORD}"
43 43
 
44 44
 volumes:
45
-    db:
45
+    db:

+ 3
- 0
plugins/posts-to-posts/.idea/copyright/profiles_settings.xml 查看文件

@@ -0,0 +1,3 @@
1
+<component name="CopyrightManager">
2
+  <settings default="" />
3
+</component>

+ 34
- 0
plugins/posts-to-posts/.idea/misc.xml 查看文件

@@ -0,0 +1,34 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="PhpUnit">
4
+    <phpunit_settings>
5
+      <PhpUnitSettings />
6
+    </phpunit_settings>
7
+  </component>
8
+  <component name="ProjectInspectionProfilesVisibleTreeState">
9
+    <entry key="Project Default">
10
+      <profile-state>
11
+        <expanded-state>
12
+          <State>
13
+            <id />
14
+          </State>
15
+        </expanded-state>
16
+        <selected-state>
17
+          <State>
18
+            <id>Blade files</id>
19
+          </State>
20
+        </selected-state>
21
+      </profile-state>
22
+    </entry>
23
+  </component>
24
+  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
25
+    <OptionsSetting value="true" id="Add" />
26
+    <OptionsSetting value="true" id="Remove" />
27
+    <OptionsSetting value="true" id="Checkout" />
28
+    <OptionsSetting value="true" id="Update" />
29
+    <OptionsSetting value="true" id="Status" />
30
+    <OptionsSetting value="true" id="Edit" />
31
+    <ConfirmationsSetting value="0" id="Add" />
32
+    <ConfirmationsSetting value="0" id="Remove" />
33
+  </component>
34
+</project>

+ 8
- 0
plugins/posts-to-posts/.idea/modules.xml 查看文件

@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ProjectModuleManager">
4
+    <modules>
5
+      <module fileurl="file://$PROJECT_DIR$/.idea/posts-to-posts.iml" filepath="$PROJECT_DIR$/.idea/posts-to-posts.iml" />
6
+    </modules>
7
+  </component>
8
+</project>

+ 20
- 0
plugins/posts-to-posts/.idea/posts-to-posts.iml 查看文件

@@ -0,0 +1,20 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<module type="WEB_MODULE" version="4">
3
+  <component name="NewModuleRootManager">
4
+    <content url="file://$MODULE_DIR$" />
5
+    <orderEntry type="inheritedJdk" />
6
+    <orderEntry type="sourceFolder" forTests="false" />
7
+    <orderEntry type="module-library">
8
+      <library name="PHP">
9
+        <CLASSES>
10
+          <root url="file://$MODULE_DIR$/../../../wp-admin" />
11
+          <root url="file://$MODULE_DIR$/../../../wp-includes" />
12
+        </CLASSES>
13
+        <SOURCES>
14
+          <root url="file://$MODULE_DIR$/../../../wp-admin" />
15
+          <root url="file://$MODULE_DIR$/../../../wp-includes" />
16
+        </SOURCES>
17
+      </library>
18
+    </orderEntry>
19
+  </component>
20
+</module>

+ 6
- 0
plugins/posts-to-posts/.idea/vcs.xml 查看文件

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="VcsDirectoryMappings">
4
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+  </component>
6
+</project>

+ 1
- 1
plugins/posts-to-posts/admin/box-factory.php 查看文件

@@ -145,7 +145,7 @@ class P2P_Box_Factory extends P2P_Factory {
145 145
 
146 146
 		$box = $this->create_box( $directed );
147 147
 
148
-		$method = 'ajax_' . $_REQUEST['subaction'];
148
+		$method = 'ajax_' . esc_attr( $_REQUEST['subaction'] );
149 149
 
150 150
 		$box->$method();
151 151
 	}

+ 0
- 2
plugins/posts-to-posts/composer.json 查看文件

@@ -6,8 +6,6 @@
6 6
     "minimum-stability": "dev",
7 7
     "require": {
8 8
         "composer/installers": "~1.0",
9
-        "scribu/lib-posts-to-posts": "dev-master",
10
-        "mustache/mustache": "~2.6"
11 9
     },
12 10
     "repositories": [
13 11
         {

+ 2
- 2
plugins/posts-to-posts/posts-to-posts.php 查看文件

@@ -2,7 +2,7 @@
2 2
 /*
3 3
 Plugin Name: Posts 2 Posts
4 4
 Description: Create many-to-many relationships between all types of posts.
5
-Version: 1.6.5
5
+Version: 1.6.6
6 6
 Author: scribu
7 7
 Author URI: http://scribu.net/
8 8
 Plugin URI: http://scribu.net/wordpress/posts-to-posts
@@ -10,7 +10,7 @@ Text Domain: posts-to-posts
10 10
 Domain Path: /lang
11 11
 */
12 12
 
13
-define( 'P2P_PLUGIN_VERSION', '1.6.5' );
13
+define( 'P2P_PLUGIN_VERSION', '1.6.6' );
14 14
 
15 15
 define( 'P2P_TEXTDOMAIN', 'posts-to-posts' );
16 16
 

+ 12
- 4
plugins/posts-to-posts/readme.txt 查看文件

@@ -1,10 +1,12 @@
1 1
 === Posts 2 Posts ===
2 2
 
3
-Contributors: scribu, ciobi  
3
+Contributors: scribu, ciobi, ayecode, stiofansisland
4 4
 Tags: connections, custom post types, relationships, many-to-many, users  
5 5
 Requires at least: 3.9  
6
-Tested up to: 4.3  
7
-Stable tag: 1.6.5  
6
+Requires PHP: 5.6
7
+Tested up to: 5.4
8
+Stable tag: 1.6.6
9
+
8 10
 License: GPLv2 or later  
9 11
 License URI: http://www.gnu.org/licenses/gpl-2.0.html  
10 12
 
@@ -27,7 +29,9 @@ Additionally, you can create many-to-many relationships between posts and users.
27 29
 
28 30
 = Support & Maintenance =
29 31
 
30
-I, scribu, will not be offering support (either free or paid) for this plugin anymore.
32
+AyeCode Ltd have committed to security and maintenance updates due to this plugins requirement in our [List Manager Extension.](https://wpgeodirectory.com/downloads/list-manager/)
33
+
34
+~~I, scribu, will not be offering support (either free or paid) for this plugin anymore.~~
31 35
 
32 36
 If you want to help maintain the plugin, fork it [on github](https://github.com/scribu/wp-posts-to-posts) and open pull requests.
33 37
 
@@ -57,6 +61,10 @@ Additional info can be found on the [wiki](http://github.com/scribu/wp-posts-to-
57 61
 
58 62
 == Changelog ==
59 63
 
64
+= 1.6.6 =
65
+* AyeCode Ltd have committed to security and maintenance updates - INFO
66
+* Deprecated PHP notices showing with latest WordPress - FIXED
67
+
60 68
 = 1.6.5 =
61 69
 * fixed error when Mustache is already loaded. props ApatheticG
62 70
 * fixed WP_User_Query warning. props PatelUtkarsh

+ 1
- 2
plugins/posts-to-posts/vendor/scribu/scb-framework/AdminPage.php 查看文件

@@ -135,7 +135,6 @@ abstract class scbAdminPage {
135 135
 		}
136 136
 
137 137
 		add_action( 'admin_menu', array( $this, 'page_init' ), $this->args['admin_action_priority'] );
138
-		add_filter( 'contextual_help', array( $this, '_contextual_help' ), 10, 2 );
139 138
 
140 139
 		if ( $file ) {
141 140
 			$this->file = $file;
@@ -186,7 +185,6 @@ abstract class scbAdminPage {
186 185
 	 */
187 186
 	protected function page_header() {
188 187
 		echo "<div class='wrap'>\n";
189
-		screen_icon( $this->args['screen_icon'] );
190 188
 		echo html( 'h2', $this->args['page_title'] );
191 189
 	}
192 190
 
@@ -540,6 +538,7 @@ abstract class scbAdminPage {
540 538
 	 * @param string|object $screen
541 539
 	 *
542 540
 	 * @return string
541
+	 * @deprecated 1.6.6 Not used
543 542
 	 */
544 543
 	public function _contextual_help( $help, $screen ) {
545 544
 		if ( is_object( $screen ) ) {

+ 2
- 2
vue-theme/functions.php 查看文件

@@ -54,7 +54,7 @@ function vue_theme_scripts() {
54 54
 
55 55
 	wp_enqueue_style( 'style', get_stylesheet_uri() );
56 56
 
57
-	if ( defined( 'IS_DEV' ) && IS_DEV ) {
57
+	if ( defined( 'IS_DEV' ) && IS_DEV === 'true') {
58 58
 		wp_register_script(
59 59
             'vue-theme',
60 60
             'http://localhost:8081/build/main.js',
@@ -65,7 +65,7 @@ function vue_theme_scripts() {
65 65
 	} else {
66 66
         wp_register_script(
67 67
             'vue-theme',
68
-            get_template_directory_uri() . '/public/main.js',
68
+            get_template_directory_uri() . '/build/main.js',
69 69
             array( 'jquery' ),
70 70
             false,
71 71
             true 

+ 1284
- 353
vue-theme/package-lock.json
文件差異過大導致無法顯示
查看文件


+ 14
- 13
vue-theme/package.json 查看文件

@@ -4,7 +4,7 @@
4 4
   "description": "Wordpress SPA theme base",
5 5
   "main": "index.js",
6 6
   "scripts": {
7
-    "dev": "webpack-dev-server --open"
7
+    "dev": "webpack-dev-server --hot"
8 8
   },
9 9
   "keywords": [
10 10
     "wordpress",
@@ -13,34 +13,35 @@
13 13
   "author": "TOJ",
14 14
   "license": "UNLICENSED",
15 15
   "devDependencies": {
16
-    "@babel/core": "^7.9.0",
16
+    "@babel/core": "^7.12.3",
17 17
     "@babel/plugin-syntax-dynamic-import": "^7.8.3",
18 18
     "@babel/preset-env": "^7.9.0",
19
+    "@vue/compiler-sfc": "^3.0.2",
19 20
     "axios": "^0.19.2",
20 21
     "babel-loader": "^8.1.0",
21
-    "css-loader": "^3.4.2",
22
-    "file-loader": "^6.0.0",
23
-    "postcss-calc": "^7.0.2",
22
+    "css-loader": "^3.6.0",
23
+    "file-loader": "^6.1.1",
24
+    "postcss-calc": "^7.0.5",
24 25
     "postcss-import": "^12.0.1",
25 26
     "postcss-loader": "^3.0.0",
26 27
     "precss": "^4.0.0",
27 28
     "pug": "^2.0.4",
28 29
     "pug-plain-loader": "^1.0.0",
30
+    "style-loader": "^2.0.0",
29 31
     "sugarss": "^2.0.0",
30 32
     "url-loader": "^4.0.0",
31 33
     "vue-hot-reload-api": "^2.3.4",
32
-    "vue-loader": "^15.9.1",
33
-    "vue-style-loader": "^4.1.2",
34
-    "vue-template-compiler": "^2.6.11",
35
-    "webpack": "^4.42.1",
36
-    "webpack-cli": "^3.3.11",
34
+    "vue-loader": "^16.0.0-beta.8",
35
+    "vue-template-compiler": "^2.6.12",
36
+    "webpack": "^4.44.2",
37
+    "webpack-cli": "^3.3.12",
37 38
     "webpack-dev-server": "^3.11.0"
38 39
   },
39 40
   "dependencies": {
40 41
     "compression-webpack-plugin": "^3.1.0",
41
-    "vue": "^2.6.11",
42
-    "vue-router": "^3.1.6",
43
-    "vuex": "^3.1.3"
42
+    "vue": "^3.0.2",
43
+    "vue-router": "^4.0.0-rc.1",
44
+    "vuex": "^4.0.0-beta.4"
44 45
   },
45 46
   "babel": {
46 47
     "presets": [

+ 9
- 0
vue-theme/postcss.config.js 查看文件

@@ -0,0 +1,9 @@
1
+module.exports = {
2
+    parser: 'sugarss',
3
+    plugins: [
4
+        require('postcss-import'),
5
+        require('postcss-calc'),
6
+        require('precss'),
7
+        require('autoprefixer')
8
+    ]
9
+}

+ 1
- 1
vue-theme/src/app.vue 查看文件

@@ -1,5 +1,5 @@
1 1
 <template lang="pug">
2
-div#theme.f-col
2
+#theme.f-col
3 3
     cia-nav
4 4
     cia-hero
5 5
     main.f-col

+ 9
- 5
vue-theme/src/components/gallery.vue 查看文件

@@ -1,14 +1,14 @@
1 1
 <template lang="pug">
2
-.gallery.f-col.center(v-if="fullscreengallery + 1 > 0")
2
+.gallery.f-col.center(v-if="showGallery")
3 3
     button(@click="hideGallery").hide hide
4 4
     ul
5 5
         li(v-for="(image, i) of images" :class="{ active: i === selected }")
6 6
             .image-wrapper.f-col.center
7 7
                 img(:src="image")
8 8
     .controls.f-row
9
-        button(@click="prev") <
9
+        button(@click="prev") left
10 10
         .f-grow
11
-        button(@click="next") >
11
+        button(@click="next") right
12 12
 </template>
13 13
 
14 14
 <script>
@@ -22,6 +22,11 @@ export default {
22 22
             selected: -1
23 23
         }
24 24
     },
25
+    computed: {
26
+        showGallery() {
27
+            return this.fullscreengallery + 1 > 0
28
+        }
29
+    },
25 30
     methods: {
26 31
         prev() {
27 32
             this.selected > 0 ? this.selected-- : this.selected = this.images.length - 1
@@ -48,7 +53,6 @@ export default {
48 53
     },
49 54
     watch: {
50 55
         fullscreengallery(newVal, oldVal) {
51
-
52 56
             this.selected = newVal
53 57
         }
54 58
     },
@@ -67,7 +71,7 @@ export default {
67 71
 <style lang="postcss">
68 72
 .gallery
69 73
     position: fixed
70
-    top: 0q
74
+    top: 0
71 75
     left: 0
72 76
     width: 100%
73 77
     height: 100%

二進制
vue-theme/src/favicon.ico 查看文件


+ 7
- 27
vue-theme/src/index.js 查看文件

@@ -1,31 +1,11 @@
1
-import Vue from 'vue'
2
-import VueRouter from 'vue-router'
3
-
4
-Vue.use(VueRouter)
5
-
6
-import App from '@/app.vue'
7
-
1
+import { createApp } from 'vue'
2
+import router from '@/router'
8 3
 import store from '@/store'
9 4
 
10
-import IndexPage from '@/pages/index.vue'
5
+import App from '@/app.vue'
11 6
 
12
-const router = new VueRouter({
13
-    mode: 'history',
14
-    routes: [
15
-        // Home Page
16
-        { path: '/', component: IndexPage },
17
-        // List Pages
18
-        { path: '/episodes', component: () => import(/* webpackChunkName: "pages-list" */ './pages/list.vue'), props: { sidebar: false } },
19
-        { path: '/:type', component: () => import(/* webpackChunkName: "pages-list" */ './pages/list.vue'), props: { sidebar: true } },
20
-        // Sorted List Pages 
21
-        { path: '/:type/by-alpha', component: () => import(/* webpackChunkName: "pages-list" */ './pages/list.vue'), props: { sidebar: true, sortBy: 'by-alpha' } },
22
-        { path: '/:type/recent', component: () => import(/* webpackChunkName: "pages-list" */ './pages/list.vue'), props: { sidebar: true, sortBy: 'recent' } },
23
-        { path: '/:type/by-material', component: () => import(/* webpackChunkName: "pages-list" */ './pages/list.vue'), props: { sidebar: true, sortBy: 'by-material' } },
24
-        { path: '/:type/by-episode', component: () => import(/* webpackChunkName: "pages-list" */ './pages/list.vue'), props: { sidebar: true, sortBy: 'by-episode' } },
25
-        { path: '/:type/by-artist', component: () => import(/* webpackChunkName: "pages-list" */ './pages/list.vue'), props: { sidebar: true, sortBy: 'by-artist' } },
26
-        // Single Pages
27
-        { path: '/:type/:slug', component: () => import(/* webpackChunkName: "pages-single" */ './pages/single.vue'), props: { sidebar: true } },
28
-    ]
29
-})
7
+const craft = createApp(App)
30 8
 
31
-new Vue({ store, router, render: h => h(App) }).$mount('#wp-app')
9
+craft.use(router)
10
+    .use(store)
11
+    .mount('#wp-app')

+ 4
- 4
vue-theme/src/pages/index.vue 查看文件

@@ -6,22 +6,22 @@
6 6
             section(v-if="allEpisodesLoaded").shadow
7 7
                 router-link(:to="`./episodes`")
8 8
                     h4.t-cap episodes
9
-                router-link(:to="`./episodes/${Object.values(allEpisodes)[0].slug}`")
9
+                router-link(:to="{ path: `/episodes/${Object.values(allEpisodes)[0].slug}` }")
10 10
                     p {{ Object.values(allEpisodes)[0].title }}
11 11
             section(v-if="allArtistsLoaded").shadow
12 12
                 router-link(:to="`./artists`")
13 13
                     h4.t-cap artists
14
-                router-link(:to="`./artists/${Object.values(allArtists)[0].slug}`")
14
+                router-link(:to="{ path: `/artists/${Object.values(allArtists)[0].slug}` }")
15 15
                     p {{ Object.values(allArtists)[0].title }}
16 16
             section(v-if="allPagesLoaded").shadow
17 17
                 h4.t-cap pages
18
-                router-link(:to="`./pages/${Object.values(allPages)[0].slug}`")
18
+                router-link(:to="{ path: `/pages/${Object.values(allPages)[0].slug}` }")
19 19
                     p {{ Object.values(allPages)[0].title }}
20 20
         .f-row
21 21
             section(v-if="allPostsLoaded").shadow
22 22
                 router-link(:to="`./posts`")
23 23
                     h4.t-cap posts
24
-                router-link(:to="`./posts/${Object.values(allPosts)[0].slug}`")
24
+                router-link(:to="{ path: `/posts/${Object.values(allPosts)[0].slug}` }")
25 25
                     p {{ Object.values(allPosts)[0].title }}
26 26
         .f-row
27 27
             section

+ 1
- 1
vue-theme/src/pages/list.vue 查看文件

@@ -59,7 +59,7 @@ export default {
59 59
         },
60 60
         posts() {
61 61
             let type = this.convertTitleCase(this.type)
62
-
62
+            console.log('type: ', type)
63 63
             // We're override the API to sort by date
64 64
             // because items are returned by ID
65 65
             let unsortedOfType = Object.values(this[`all${type}`])

+ 7
- 1
vue-theme/src/pages/single.vue 查看文件

@@ -1,5 +1,5 @@
1 1
 <template lang="pug">
2
-.page--single.f-row.between(v-if="$route.params.slug")
2
+.page--single.f-row.between(v-if="allPostsLoaded && allPagesLoaded && allArtistsLoaded && allEpisodesLoaded")
3 3
     gallery(:fullscreengallery="fullscreengallery" v-on:close="fullscreengallery = -1" :images="images")
4 4
     article.f-grow.shadow
5 5
         header
@@ -64,15 +64,21 @@ export default {
64 64
     },
65 65
     methods: {
66 66
         pageBlocks(posts) {
67
+            console.log('block for: ', this.posts)
68
+            console.log(this.$route.params.slug)
67 69
             return posts[this.$route.params.slug].blocks.map(block => {
68 70
                 if(block) return block
69 71
             })
70 72
         },
71 73
         checkForImages(posts) {
74
+            if(Object.keys(posts).length === 0) return
75
+            console.log(posts)
72 76
             this.pageBlocks(posts).forEach(block => {
73 77
                 if(!block) return
78
+
74 79
                 const doc = new DOMParser().parseFromString(block, 'text/html')
75 80
                 const gallery = doc.querySelectorAll('.blocks-gallery-item img')
81
+                
76 82
                 // add captions
77 83
                 if(gallery.length) {
78 84
                     this.images = [].slice.call(gallery).map(

+ 9
- 0
vue-theme/src/router/index.js 查看文件

@@ -0,0 +1,9 @@
1
+import { createRouter, createWebHistory } from 'vue-router'
2
+import routes from './routes'
3
+
4
+const router = createRouter({
5
+    history: createWebHistory('/'),
6
+    routes
7
+})
8
+
9
+export default router

+ 17
- 0
vue-theme/src/router/routes.js 查看文件

@@ -0,0 +1,17 @@
1
+import indexPage from '@/pages/index.vue'
2
+
3
+export default [
4
+    // Home Page
5
+    { path: '/', component: indexPage },
6
+    // List Pages
7
+    { path: '/episodes', component: () => import(/* webpackChunkName: "pages-list" */ '@/pages/list.vue'), props: { sidebar: false } },
8
+    { path: '/:type', component: () => import(/* webpackChunkName: "pages-list" */ '@/pages/list.vue'), props: { sidebar: true } },
9
+    // Sorted List Pages 
10
+    { path: '/:type/by-alpha', component: () => import(/* webpackChunkName: "pages-list" */ '@/pages/list.vue'), props: { sidebar: true, sortBy: 'by-alpha' } },
11
+    { path: '/:type/recent', component: () => import(/* webpackChunkName: "pages-list" */ '@/pages/list.vue'), props: { sidebar: true, sortBy: 'recent' } },
12
+    { path: '/:type/by-material', component: () => import(/* webpackChunkName: "pages-list" */ '@/pages/list.vue'), props: { sidebar: true, sortBy: 'by-material' } },
13
+    { path: '/:type/by-episode', component: () => import(/* webpackChunkName: "pages-list" */ '@/pages/list.vue'), props: { sidebar: true, sortBy: 'by-episode' } },
14
+    { path: '/:type/by-artist', component: () => import(/* webpackChunkName: "pages-list" */ '@/pages/list.vue'), props: { sidebar: true, sortBy: 'by-artist' } },
15
+    // Single Pages
16
+    { path: '/:type/:slug', component: () => import(/* webpackChunkName: "pages-single" */ '@/pages/single.vue'), props: { sidebar: true } },
17
+]

+ 1
- 1
vue-theme/src/sss/_helpers.sss 查看文件

@@ -1,4 +1,4 @@
1
-// Custom selectors
1
+/* Custom selectors */
2 2
 @custom-selector :--headings h1, h2, h3, h4, h5, h6
3 3
 
4 4
 @custom-media --viewport-medium (width <= 50rem)

+ 4
- 4
vue-theme/src/sss/_reset.sss 查看文件

@@ -1,4 +1,4 @@
1
-// Kill margins and paddings; add border-box
1
+/* Kill margins and paddings; add border-box */
2 2
 *
3 3
     margin: 0
4 4
     padding: 0
@@ -20,19 +20,19 @@ html
20 20
     tab-size: 4
21 21
     box-sizing: border-box
22 22
     
23
-// Always set color/background/font-size on root
23
+/* Always set color/background/font-size on root */
24 24
 body
25 25
     margin: 0
26 26
     color: #000
27 27
     font-size: 16px
28 28
     font-family: Helvetica, Arial, sans-serif
29 29
 
30
-// Remove list-style in navigation tags
30
+/* Remove list-style in navigation tags */
31 31
 nav
32 32
     ol, ul
33 33
         list-style: none
34 34
 
35
-// Reset some other default styles
35
+/* Reset some other default styles */
36 36
 button, input, select, textarea
37 37
     font-family: inherit
38 38
     font-size: inherit

+ 4
- 4
vue-theme/src/sss/variables.sss 查看文件

@@ -1,4 +1,4 @@
1
-// Colors
1
+/* Colors */
2 2
 $blue: #0076A3
3 3
 $chart-bg: rgba(20,20,20)
4 4
 $background: #444
@@ -12,18 +12,18 @@ $primary-light: #00D6A3
12 12
 $primary-lighter: #CEFFF3
13 13
 $primary-dark: #007351
14 14
 
15
-// Fonts
15
+/* Fonts */
16 16
 $sans: 'sans-serif'
17 17
 $serif: 'serif'
18 18
 $mono: 'monospace'
19 19
 
20
-// Proportion (to be replaced with modular scale)
20
+/* Proportion (to be replaced with modular scale) */
21 21
 $ms: 1vw
22 22
 $base: 1em
23 23
 
24 24
 $max-width: 70em
25 25
 
26
-// Circles for add page
26
+/* Circles for add page */
27 27
 $radius: 2.5vw
28 28
 $path: 4px
29 29
 

+ 7
- 5
vue-theme/src/store/index.js 查看文件

@@ -1,5 +1,5 @@
1 1
 // SHAMELESS THEFT: https://github.com/EvanAgee/vuejs-wordpress-theme-starter
2
-import Vue from 'vue'
2
+
3 3
 import Vuex from 'vuex'
4 4
 
5 5
 import * as actions from './actions'
@@ -10,11 +10,10 @@ import post from './modules/post'
10 10
 import artist from './modules/artist'
11 11
 import episode from './modules/episode'
12 12
 
13
-Vue.use(Vuex)
14 13
 
15 14
 const debug = process.env.NODE_ENV !== 'production'
16 15
 
17
-Vue.config.devtools = true 
16
+// Vue.config.devtools = true 
18 17
 
19 18
 // Current page state
20 19
 const state = {
@@ -26,6 +25,7 @@ const state = {
26 25
   },
27 26
   view: 'list'
28 27
 }
28
+
29 29
 const mutations = {
30 30
   SET_HERO(state, hero) {
31 31
     if (hero.url) {
@@ -36,7 +36,7 @@ const mutations = {
36 36
   },
37 37
 }
38 38
 
39
-export default new Vuex.Store({
39
+const store = new Vuex.Store({
40 40
   actions,
41 41
   getters,
42 42
   mutations,
@@ -48,4 +48,6 @@ export default new Vuex.Store({
48 48
       episode
49 49
   },
50 50
   strict: debug,
51
-})
51
+})
52
+
53
+export default store

+ 5
- 14
vue-theme/webpack.config.js 查看文件

@@ -15,7 +15,6 @@ module.exports = (env = {}) => {
15 15
         resolve: {
16 16
         alias: {
17 17
                 '@': path.resolve(__dirname, 'src'),
18
-                'vue$': 'vue/dist/vue.esm.js'
19 18
             },
20 19
             extensions: ['*', '.js', '.sss', '.vue', '.json']
21 20
         },
@@ -56,18 +55,10 @@ module.exports = (env = {}) => {
56 55
                 },
57 56
                 {
58 57
                     test: /\.(css|sss|postcss)$/,
59
-                    use: [{
60
-                            loader: 'vue-style-loader'
61
-                        },
62
-                        {
63
-                            loader: 'postcss-loader',
64
-                            options: {
65
-                                parser: 'sugarss',
66
-                                plugins: () => {
67
-                                    return PostCssPlugins
68
-                                }
69
-                            }
70
-                        }
58
+                    use: [
59
+                        'style-loader',
60
+                        'css-loader',
61
+                        'postcss-loader',
71 62
                     ]
72 63
                 }
73 64
             ]
@@ -84,7 +75,7 @@ module.exports = (env = {}) => {
84 75
             noInfo: false,
85 76
             historyApiFallback: true,
86 77
             hot: true,
87
-            open: true,
78
+            open: false,
88 79
             hotOnly: true,
89 80
             disableHostCheck: true,
90 81
             writeToDisk: true,

Loading…
取消
儲存