Skip to content

Commit

Permalink
fix(index.html): add meta
Browse files Browse the repository at this point in the history
  • Loading branch information
lv-z-l committed Jul 30, 2023
1 parent cc85bd8 commit c945b48
Show file tree
Hide file tree
Showing 7 changed files with 1,078 additions and 346 deletions.
291 changes: 266 additions & 25 deletions .vitepress/cache/deps/@theme_index.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions .vitepress/cache/deps/@theme_index.js.map

Large diffs are not rendered by default.

61 changes: 14 additions & 47 deletions .vitepress/cache/deps/_metadata.json
Original file line number Diff line number Diff line change
@@ -1,62 +1,29 @@
{
"hash": "afa575f4",
"browserHash": "ba10fc58",
"hash": "b52c4302",
"browserHash": "27707c7d",
"optimized": {
"vue": {
"src": "../../../node_modules/vue/dist/vue.runtime.esm-bundler.js",
"src": "../../../node_modules/.pnpm/[email protected]/node_modules/vue/dist/vue.runtime.esm-bundler.js",
"file": "vue.js",
"fileHash": "3584c4da",
"fileHash": "35a33a4d",
"needsInterop": false
},
"@theme/index": {
"src": "../../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected]/node_modules/vitepress/dist/client/theme-default/index.js",
"file": "@theme_index.js",
"fileHash": "a126200a",
"needsInterop": false
},
"naive-ui/lib/timeline": {
"src": "../../../node_modules/.pnpm/[email protected][email protected]/node_modules/naive-ui/lib/timeline/index.js",
"file": "naive-ui_lib_timeline.js",
"fileHash": "0c6905b8",
"needsInterop": true
},
"naive-ui/lib/tag": {
"src": "../../../node_modules/.pnpm/[email protected][email protected]/node_modules/naive-ui/lib/tag/index.js",
"file": "naive-ui_lib_tag.js",
"fileHash": "8d031ea1",
"needsInterop": true
},
"naive-ui/lib/space": {
"src": "../../../node_modules/.pnpm/[email protected][email protected]/node_modules/naive-ui/lib/space/index.js",
"file": "naive-ui_lib_space.js",
"fileHash": "611da8f6",
"needsInterop": true
},
"xmind-embed-viewer": {
"src": "../../../node_modules/.pnpm/[email protected]/node_modules/xmind-embed-viewer/dist/esm/index.js",
"file": "xmind-embed-viewer.js",
"fileHash": "9a4cb895",
"vitepress > @vue/devtools-api": {
"src": "../../../node_modules/.pnpm/@[email protected]/node_modules/@vue/devtools-api/lib/esm/index.js",
"file": "vitepress___@vue_devtools-api.js",
"fileHash": "5d71ca29",
"needsInterop": false
},
"vue-next-directive/lib/directives/lazy/index": {
"src": "../../../node_modules/.pnpm/[email protected][email protected]/node_modules/vue-next-directive/lib/directives/lazy/index.js",
"file": "vue-next-directive_lib_directives_lazy_index.js",
"fileHash": "752b70ed",
"@theme/index": {
"src": "../../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected]/node_modules/vitepress/dist/client/theme-default/index.js",
"file": "@theme_index.js",
"fileHash": "4f9de96f",
"needsInterop": false
}
},
"chunks": {
"chunk-RWW4PKXB": {
"file": "chunk-RWW4PKXB.js"
},
"chunk-RTHLRGAT": {
"file": "chunk-RTHLRGAT.js"
},
"chunk-KYV4F4PX": {
"file": "chunk-KYV4F4PX.js"
},
"chunk-CF3WPAMV": {
"file": "chunk-CF3WPAMV.js"
"chunk-OX6HOUGK": {
"file": "chunk-OX6HOUGK.js"
}
}
}
5 changes: 1 addition & 4 deletions .vitepress/cache/deps/vue.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions buildend/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { readFileSync, writeFileSync } = require('fs')

const path = require('path')

const { JSDOM } = require('jsdom')

const htmlString = readFileSync(path.resolve('.vitepress/dist/index.html'), { encoding: 'utf-8' })

const dom = new JSDOM(htmlString)

const document = dom.window.document

const head = document.querySelector('head')

const meta = document.createElement('meta')
meta.setAttribute('name', 'referrer')
meta.setAttribute('content', 'nerver')

head.insertBefore(meta, head.childNodes[0])

writeFileSync(path.resolve('.vitepress/dist/index.html'), document.querySelector('html').outerHTML)
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
"license": "ISC",
"scripts": {
"docs:dev": "vitepress dev",
"docs:build": "vitepress build",
"docs:build": "vitepress build && node ./buildend/index.js",
"docs:preview": "vitepress preview"
},
"devDependencies": {
"cz-conventional-changelog": "^3.3.0",
"vitepress": "1.0.0-beta.5"
},
"dependencies": {
"jsdom": "^22.1.0",
"xmind-embed-viewer": "^1.1.0"
},
"config": {
Expand Down
Loading

0 comments on commit c945b48

Please sign in to comment.