Ver código fonte

:recycle: changing custom types to ignore permalink front matter | altering routes to recognize blog

tags/0.9.0
J 4 anos atrás
pai
commit
4efd49866e

+ 4
- 0
plugins/cia-post-types/cia-post-types.php Ver arquivo

55
             'has_archive'        => false,
55
             'has_archive'        => false,
56
             'show_in_rest'       => true,
56
             'show_in_rest'       => true,
57
             'publicly_queryable' => true, // Needed for slug
57
             'publicly_queryable' => true, // Needed for slug
58
+            'rewrite'            => array( // Rewrite permalink stuff
59
+                'slug' => ucfirst($this->post_type),
60
+                'with_front' => false
61
+            ),
58
         ];
62
         ];
59
 
63
 
60
         register_post_type( $this->post_type, $args );
64
         register_post_type( $this->post_type, $args );

+ 2
- 1
vue-theme/src/components/navigation/navigation.vue Ver arquivo

48
          */
48
          */
49
         const menuItems = computed(() => {
49
         const menuItems = computed(() => {
50
             const extras = [
50
             const extras = [
51
-                // 'center',
51
+                'blog',
52
                 // 'education',
52
                 // 'education',
53
                 // 'resources',
53
                 // 'resources',
54
                 // 'support',
54
                 // 'support',
57
             ]
57
             ]
58
             const ignore = [
58
             const ignore = [
59
                 'page',
59
                 'page',
60
+                'post',
60
                 'sticky',
61
                 'sticky',
61
             ]
62
             ]
62
             const filtered = postTypes.filter(val => !ignore.includes(val))
63
             const filtered = postTypes.filter(val => !ignore.includes(val))

+ 1
- 1
vue-theme/src/pages/list.vue Ver arquivo

55
     },
55
     },
56
     computed: {
56
     computed: {
57
         type() {
57
         type() {
58
-            return this.$route.params.type
58
+            return postTypes.includes(this.$route.params.type) ? this.$route.params.type : 'post'
59
         },
59
         },
60
         sortBy() {
60
         sortBy() {
61
             return this.$route.params.sortBy
61
             return this.$route.params.sortBy

+ 1
- 1
vue-theme/src/pages/single.vue Ver arquivo

64
     },
64
     },
65
     computed: {
65
     computed: {
66
         type() {
66
         type() {
67
-            return this.$route.params.type
67
+            return postTypes.includes(this.$route.params.type) ? this.$route.params.type : 'post'
68
         },
68
         },
69
         slug() {
69
         slug() {
70
             return this.$route.params.slug
70
             return this.$route.params.slug

+ 9
- 3
vue-theme/src/router/routes.js Ver arquivo

3
 import singlePage from '@/pages/single.vue'
3
 import singlePage from '@/pages/single.vue'
4
 
4
 
5
 export default [
5
 export default [
6
-    // Home Page
6
+    /**
7
+     * Home Page
8
+     */
7
     { path: '/', component: indexPage },
9
     { path: '/', component: indexPage },
8
 
10
 
9
-    // List Pages
11
+    /**
12
+     * List Pages
13
+     */ 
10
     { path: '/:type', component: listPage },
14
     { path: '/:type', component: listPage },
11
     {
15
     {
12
         path: '/:type/sorted/:sortBy',
16
         path: '/:type/sorted/:sortBy',
13
         component: listPage,
17
         component: listPage,
14
     },
18
     },
15
     
19
     
16
-    // Single Pages
20
+    /**
21
+     * Single Pages
22
+     */ 
17
     {
23
     {
18
         path: '/:type/:slug',
24
         path: '/:type/:slug',
19
         component: singlePage,
25
         component: singlePage,

Carregando…
Cancelar
Salvar