ソースを参照

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

tags/0.9.0
J 5年前
コミット
7d4f7fe681

+ 2
- 1
configs/wp-config.php ファイルの表示

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

+ 17
- 17
docker-compose.yml ファイルの表示

1
 version: '3' 
1
 version: '3' 
2
 
2
 
3
 services:
3
 services:
4
-    vue-wp:
4
+    craft-wp:
5
         depends_on:
5
         depends_on:
6
-            - vue-db
6
+            - craft-db
7
         image: wordpress
7
         image: wordpress
8
-        container_name: "vue-wp"
8
+        container_name: "craft-wp"
9
         volumes:
9
         volumes:
10
             - ./configs/wp-config.php:/usr/src/wordpress/wp-config-sample.php
10
             - ./configs/wp-config.php:/usr/src/wordpress/wp-config-sample.php
11
             - ./uploads:/var/www/html/wp-content/uploads
11
             - ./uploads:/var/www/html/wp-content/uploads
15
         ports:
15
         ports:
16
             - "8080:80"
16
             - "8080:80"
17
         links:
17
         links:
18
-            - vue-db:mysql
18
+            - craft-db:mysql
19
         environment:
19
         environment:
20
             WORDPRESS_DB_PASSWORD: "${DB_PASSWORD}"
20
             WORDPRESS_DB_PASSWORD: "${DB_PASSWORD}"
21
             IS_DEV: "${IS_DEV}"
21
             IS_DEV: "${IS_DEV}"
22
             WORDPRESS_DB_NAME: current_db
22
             WORDPRESS_DB_NAME: current_db
23
 
23
 
24
-    vue-db:
24
+    craft-db:
25
         image: mariadb
25
         image: mariadb
26
-        container_name: "vue-db"
26
+        container_name: "craft-db"
27
         environment:
27
         environment:
28
             MYSQL_ROOT_PASSWORD: "${DB_PASSWORD}"
28
             MYSQL_ROOT_PASSWORD: "${DB_PASSWORD}"
29
             INNODB_FLUSH_METHOD: O_DSYNC
29
             INNODB_FLUSH_METHOD: O_DSYNC
30
         volumes:
30
         volumes:
31
             - db:/var/lib/mysql
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
 volumes:
44
 volumes:
45
-    db:
45
+    db:

+ 3
- 0
plugins/posts-to-posts/.idea/copyright/profiles_settings.xml ファイルの表示

1
+<component name="CopyrightManager">
2
+  <settings default="" />
3
+</component>

+ 34
- 0
plugins/posts-to-posts/.idea/misc.xml ファイルの表示

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 ファイルの表示

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 ファイルの表示

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 ファイルの表示

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
 
145
 
146
 		$box = $this->create_box( $directed );
146
 		$box = $this->create_box( $directed );
147
 
147
 
148
-		$method = 'ajax_' . $_REQUEST['subaction'];
148
+		$method = 'ajax_' . esc_attr( $_REQUEST['subaction'] );
149
 
149
 
150
 		$box->$method();
150
 		$box->$method();
151
 	}
151
 	}

+ 0
- 2
plugins/posts-to-posts/composer.json ファイルの表示

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

+ 2
- 2
plugins/posts-to-posts/posts-to-posts.php ファイルの表示

2
 /*
2
 /*
3
 Plugin Name: Posts 2 Posts
3
 Plugin Name: Posts 2 Posts
4
 Description: Create many-to-many relationships between all types of posts.
4
 Description: Create many-to-many relationships between all types of posts.
5
-Version: 1.6.5
5
+Version: 1.6.6
6
 Author: scribu
6
 Author: scribu
7
 Author URI: http://scribu.net/
7
 Author URI: http://scribu.net/
8
 Plugin URI: http://scribu.net/wordpress/posts-to-posts
8
 Plugin URI: http://scribu.net/wordpress/posts-to-posts
10
 Domain Path: /lang
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
 define( 'P2P_TEXTDOMAIN', 'posts-to-posts' );
15
 define( 'P2P_TEXTDOMAIN', 'posts-to-posts' );
16
 
16
 

+ 12
- 4
plugins/posts-to-posts/readme.txt ファイルの表示

1
 === Posts 2 Posts ===
1
 === Posts 2 Posts ===
2
 
2
 
3
-Contributors: scribu, ciobi  
3
+Contributors: scribu, ciobi, ayecode, stiofansisland
4
 Tags: connections, custom post types, relationships, many-to-many, users  
4
 Tags: connections, custom post types, relationships, many-to-many, users  
5
 Requires at least: 3.9  
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
 License: GPLv2 or later  
10
 License: GPLv2 or later  
9
 License URI: http://www.gnu.org/licenses/gpl-2.0.html  
11
 License URI: http://www.gnu.org/licenses/gpl-2.0.html  
10
 
12
 
27
 
29
 
28
 = Support & Maintenance =
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
 If you want to help maintain the plugin, fork it [on github](https://github.com/scribu/wp-posts-to-posts) and open pull requests.
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
 
61
 
58
 == Changelog ==
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
 = 1.6.5 =
68
 = 1.6.5 =
61
 * fixed error when Mustache is already loaded. props ApatheticG
69
 * fixed error when Mustache is already loaded. props ApatheticG
62
 * fixed WP_User_Query warning. props PatelUtkarsh
70
 * fixed WP_User_Query warning. props PatelUtkarsh

+ 1
- 2
plugins/posts-to-posts/vendor/scribu/scb-framework/AdminPage.php ファイルの表示

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

+ 2
- 2
vue-theme/functions.php ファイルの表示

54
 
54
 
55
 	wp_enqueue_style( 'style', get_stylesheet_uri() );
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
 		wp_register_script(
58
 		wp_register_script(
59
             'vue-theme',
59
             'vue-theme',
60
             'http://localhost:8081/build/main.js',
60
             'http://localhost:8081/build/main.js',
65
 	} else {
65
 	} else {
66
         wp_register_script(
66
         wp_register_script(
67
             'vue-theme',
67
             'vue-theme',
68
-            get_template_directory_uri() . '/public/main.js',
68
+            get_template_directory_uri() . '/build/main.js',
69
             array( 'jquery' ),
69
             array( 'jquery' ),
70
             false,
70
             false,
71
             true 
71
             true 

+ 1284
- 353
vue-theme/package-lock.json
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 14
- 13
vue-theme/package.json ファイルの表示

4
   "description": "Wordpress SPA theme base",
4
   "description": "Wordpress SPA theme base",
5
   "main": "index.js",
5
   "main": "index.js",
6
   "scripts": {
6
   "scripts": {
7
-    "dev": "webpack-dev-server --open"
7
+    "dev": "webpack-dev-server --hot"
8
   },
8
   },
9
   "keywords": [
9
   "keywords": [
10
     "wordpress",
10
     "wordpress",
13
   "author": "TOJ",
13
   "author": "TOJ",
14
   "license": "UNLICENSED",
14
   "license": "UNLICENSED",
15
   "devDependencies": {
15
   "devDependencies": {
16
-    "@babel/core": "^7.9.0",
16
+    "@babel/core": "^7.12.3",
17
     "@babel/plugin-syntax-dynamic-import": "^7.8.3",
17
     "@babel/plugin-syntax-dynamic-import": "^7.8.3",
18
     "@babel/preset-env": "^7.9.0",
18
     "@babel/preset-env": "^7.9.0",
19
+    "@vue/compiler-sfc": "^3.0.2",
19
     "axios": "^0.19.2",
20
     "axios": "^0.19.2",
20
     "babel-loader": "^8.1.0",
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
     "postcss-import": "^12.0.1",
25
     "postcss-import": "^12.0.1",
25
     "postcss-loader": "^3.0.0",
26
     "postcss-loader": "^3.0.0",
26
     "precss": "^4.0.0",
27
     "precss": "^4.0.0",
27
     "pug": "^2.0.4",
28
     "pug": "^2.0.4",
28
     "pug-plain-loader": "^1.0.0",
29
     "pug-plain-loader": "^1.0.0",
30
+    "style-loader": "^2.0.0",
29
     "sugarss": "^2.0.0",
31
     "sugarss": "^2.0.0",
30
     "url-loader": "^4.0.0",
32
     "url-loader": "^4.0.0",
31
     "vue-hot-reload-api": "^2.3.4",
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
     "webpack-dev-server": "^3.11.0"
38
     "webpack-dev-server": "^3.11.0"
38
   },
39
   },
39
   "dependencies": {
40
   "dependencies": {
40
     "compression-webpack-plugin": "^3.1.0",
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
   "babel": {
46
   "babel": {
46
     "presets": [
47
     "presets": [

+ 9
- 0
vue-theme/postcss.config.js ファイルの表示

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
 <template lang="pug">
1
 <template lang="pug">
2
-div#theme.f-col
2
+#theme.f-col
3
     cia-nav
3
     cia-nav
4
     cia-hero
4
     cia-hero
5
     main.f-col
5
     main.f-col

+ 9
- 5
vue-theme/src/components/gallery.vue ファイルの表示

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

バイナリ
vue-theme/src/favicon.ico ファイルの表示


+ 7
- 27
vue-theme/src/index.js ファイルの表示

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
 import store from '@/store'
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
             section(v-if="allEpisodesLoaded").shadow
6
             section(v-if="allEpisodesLoaded").shadow
7
                 router-link(:to="`./episodes`")
7
                 router-link(:to="`./episodes`")
8
                     h4.t-cap episodes
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
                     p {{ Object.values(allEpisodes)[0].title }}
10
                     p {{ Object.values(allEpisodes)[0].title }}
11
             section(v-if="allArtistsLoaded").shadow
11
             section(v-if="allArtistsLoaded").shadow
12
                 router-link(:to="`./artists`")
12
                 router-link(:to="`./artists`")
13
                     h4.t-cap artists
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
                     p {{ Object.values(allArtists)[0].title }}
15
                     p {{ Object.values(allArtists)[0].title }}
16
             section(v-if="allPagesLoaded").shadow
16
             section(v-if="allPagesLoaded").shadow
17
                 h4.t-cap pages
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
                     p {{ Object.values(allPages)[0].title }}
19
                     p {{ Object.values(allPages)[0].title }}
20
         .f-row
20
         .f-row
21
             section(v-if="allPostsLoaded").shadow
21
             section(v-if="allPostsLoaded").shadow
22
                 router-link(:to="`./posts`")
22
                 router-link(:to="`./posts`")
23
                     h4.t-cap posts
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
                     p {{ Object.values(allPosts)[0].title }}
25
                     p {{ Object.values(allPosts)[0].title }}
26
         .f-row
26
         .f-row
27
             section
27
             section

+ 1
- 1
vue-theme/src/pages/list.vue ファイルの表示

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

+ 7
- 1
vue-theme/src/pages/single.vue ファイルの表示

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

+ 9
- 0
vue-theme/src/router/index.js ファイルの表示

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 ファイルの表示

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

+ 4
- 4
vue-theme/src/sss/_reset.sss ファイルの表示

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

+ 4
- 4
vue-theme/src/sss/variables.sss ファイルの表示

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

+ 7
- 5
vue-theme/src/store/index.js ファイルの表示

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

+ 5
- 14
vue-theme/webpack.config.js ファイルの表示

15
         resolve: {
15
         resolve: {
16
         alias: {
16
         alias: {
17
                 '@': path.resolve(__dirname, 'src'),
17
                 '@': path.resolve(__dirname, 'src'),
18
-                'vue$': 'vue/dist/vue.esm.js'
19
             },
18
             },
20
             extensions: ['*', '.js', '.sss', '.vue', '.json']
19
             extensions: ['*', '.js', '.sss', '.vue', '.json']
21
         },
20
         },
56
                 },
55
                 },
57
                 {
56
                 {
58
                     test: /\.(css|sss|postcss)$/,
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
             noInfo: false,
75
             noInfo: false,
85
             historyApiFallback: true,
76
             historyApiFallback: true,
86
             hot: true,
77
             hot: true,
87
-            open: true,
78
+            open: false,
88
             hotOnly: true,
79
             hotOnly: true,
89
             disableHostCheck: true,
80
             disableHostCheck: true,
90
             writeToDisk: true,
81
             writeToDisk: true,

読み込み中…
キャンセル
保存