File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change 22 * docs-mixin: used by any page under /docs path
33 */
44import { makeTOC , scrollTo , offsetTop } from '~/utils'
5- import { bvDescription } from '~/content'
5+ import { bvDescription , nav } from '~/content'
66
77const TOC_CACHE = { }
88
@@ -38,6 +38,14 @@ export default {
3838 return [ title , section , 'BootstrapVue' ] . filter ( Boolean ) . join ( ' | ' )
3939 } ,
4040 headMeta ( ) {
41+ const section = this . $route . name . split ( '-' ) [ 1 ]
42+ const sectionMeta = section ? nav . find ( n => n . base === `${ section } /` ) : null
43+ const description =
44+ this . meta && this . meta . description
45+ ? this . meta . description
46+ : sectionMeta && sectionMeta . description
47+ ? sectionMeta . description
48+ : bvDescription
4149 const meta = [
4250 {
4351 hid : 'og:title' ,
@@ -46,25 +54,17 @@ export default {
4654 content : this . headTitle
4755 }
4856 ]
49- if ( this . meta && this . meta . description ) {
50- const desc = this . meta . description
57+ if ( description ) {
5158 meta . push ( {
5259 hid : 'description' ,
5360 name : 'description' ,
54- content : desc
61+ content : description
5562 } )
5663 meta . push ( {
5764 hid : 'og:description' ,
5865 name : 'og:description' ,
5966 property : 'og:description' ,
60- content : desc
61- } )
62- } else if ( bvDescription ) {
63- // TODO: Check if section group has description
64- meta . push ( {
65- hid : 'description' ,
66- name : 'description' ,
67- content : bvDescription
67+ content : description
6868 } )
6969 }
7070 return meta
You can’t perform that action at this time.
0 commit comments