Title metatag support, update Vuepress

This commit is contained in:
Kristian Polso 2018-04-24 11:56:52 +03:00
parent 632dc99b61
commit b112541a73
11 changed files with 216 additions and 24 deletions

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
.DS_Store
.directory
node_modules/
npm-debug.log*
yarn-debug.log*

View file

@ -1,5 +1,6 @@
// .vuepress/config.js
module.exports = {
title: 'LBRY.tech',
themeConfig: {
repo: 'lbryio/lbry.tech',
docsBranch: 'master',

View file

@ -75,7 +75,6 @@
<script>
import Vue from 'vue'
import nprogress from 'nprogress'
import Vuetify from 'vuetify'
import VueResource from 'vue-resource'
import VueHighlightJS from 'vue-highlightjs'
@ -92,11 +91,56 @@ Vue.use(VueHighlightJS)
export default {
data () {
return {
}
},
created () {
if (this.$ssrContext) {
this.$ssrContext.title = this.$title
this.$ssrContext.lang = this.$lang
this.$ssrContext.description = this.$page.description || this.$description
}
},
mounted () {
// update title / meta tags
this.currentMetaTags = []
const updateMeta = () => {
document.title = this.$title
document.documentElement.lang = this.$lang
const meta = [
{
name: 'description',
content: this.$description
},
...(this.$page.frontmatter.meta || [])
]
this.currentMetaTags = updateMetaTags(meta, this.currentMetaTags)
}
this.$watch('$page', updateMeta)
updateMeta()
},
beforeDestroy () {
updateMetaTags(null, this.currentMetaTags)
}
}
function updateMetaTags (meta, current) {
if (current) {
current.forEach(c => {
document.head.removeChild(c)
})
}
if (meta) {
return meta.map(m => {
const tag = document.createElement('meta')
Object.keys(m).forEach(key => {
tag.setAttribute(key, m[key])
})
document.head.appendChild(tag)
return tag
})
}
}
</script>
<style src="../../node_modules/vuetify/dist/vuetify.min.css"></style>

View file

@ -1,5 +1,6 @@
---
home: true
title: LBRY.tech
---
# LBRY.tech website

View file

@ -1,3 +1,7 @@
---
title: Contributing
---
# Contributing to LBRY
Interested in progressing content freedom? Awesome! This guide will get you started.

View file

@ -1 +1,5 @@
---
title: Development
---
Development resources and guides

View file

@ -1,3 +1,7 @@
---
title: Documentation
---
# Documentation lives here!
## Second level header

View file

@ -1,3 +1,7 @@
---
title: Overview
---
# Introduction to LBRY protocol #
![Placeholder](https://placehold.it/1200x600?text=Placeholder+Graphic)

View file

@ -21,7 +21,7 @@
"vue-image-upload-resize": "^1.1.6",
"vue-images-loaded": "^1.1.2",
"vue-resource": "^1.5.0",
"vuepress": "^0.7.0",
"vuepress": "^0.8.3",
"vuetify": "^1.0.16"
}
}

View file

@ -1,4 +1,8 @@
# Important Resources #
---
title: Resources
---
# Important Resources
- [Discord](https://discord.gg/YjYbwhS)
- [Slack](https://chat.lbry.io/)

165
yarn.lock
View file

@ -69,6 +69,10 @@ acorn@^5.0.0, acorn@^5.0.3, acorn@^5.4.1:
version "5.5.3"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.3.tgz#f473dd47e0277a08e28e9bec5aeeb04751f0b8c9"
agentkeepalive@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-2.2.0.tgz#c5d1bd4b129008f1163f236f86e5faea2026e2ef"
ajv-keywords@^3.0.0, ajv-keywords@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.1.0.tgz#ac2b27939c543e95d2c06e7f7f5c27be4aa543be"
@ -98,6 +102,26 @@ ajv@^6.0.1, ajv@^6.1.0:
json-schema-traverse "^0.3.0"
uri-js "^3.0.2"
algoliasearch@^3.24.5:
version "3.27.0"
resolved "https://registry.yarnpkg.com/algoliasearch/-/algoliasearch-3.27.0.tgz#675b7f2d186e5785a1553369b15d47b53d4efb31"
dependencies:
agentkeepalive "^2.2.0"
debug "^2.6.8"
envify "^4.0.0"
es6-promise "^4.1.0"
events "^1.1.0"
foreach "^2.0.5"
global "^4.3.2"
inherits "^2.0.1"
isarray "^2.0.1"
load-script "^1.0.0"
object-keys "^1.0.11"
querystring-es3 "^0.2.1"
reduce "^1.0.1"
semver "^5.1.0"
tunnel-agent "^0.6.0"
alphanum-sort@^1.0.1, alphanum-sort@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3"
@ -262,6 +286,12 @@ atob@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.0.tgz#ab2b150e51d7b122b9efc8d7340c06b6c41076bc"
autocomplete.js@^0.29.0:
version "0.29.0"
resolved "https://registry.yarnpkg.com/autocomplete.js/-/autocomplete.js-0.29.0.tgz#0185f7375ee9daf068f7d52d794bc90dcd739fd7"
dependencies:
immediate "^3.2.3"
autoprefixer@^6.3.1:
version "6.7.7"
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-6.7.7.tgz#1dbd1c835658e35ce3f9984099db00585c782014"
@ -857,10 +887,6 @@ combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5:
dependencies:
delayed-stream "~1.0.0"
commander@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-1.0.0.tgz#5e6a88e7070ff5908836ead19169548c30f90bcd"
commander@2.15.x, commander@^2.15.1, commander@^2.9.0, commander@~2.15.0:
version "2.15.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f"
@ -1357,6 +1383,15 @@ dir-glob@^2.0.0:
arrify "^1.0.1"
path-type "^3.0.0"
docsearch.js@^2.5.2:
version "2.5.2"
resolved "https://registry.yarnpkg.com/docsearch.js/-/docsearch.js-2.5.2.tgz#1a3521c92e5f252cc522c57357ef1c47b945b381"
dependencies:
algoliasearch "^3.24.5"
autocomplete.js "^0.29.0"
hogan.js "^3.0.2"
to-factory "^1.0.0"
dom-converter@~0.1:
version "0.1.4"
resolved "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.1.4.tgz#a45ef5727b890c9bffe6d7c876e7b19cb0e17f3b"
@ -1370,6 +1405,10 @@ dom-serializer@0:
domelementtype "~1.1.1"
entities "~1.1.1"
dom-walk@^0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.1.tgz#672226dc74c8f799ad35307df936aba11acd6018"
domain-browser@^1.1.1:
version "1.2.0"
resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda"
@ -1472,6 +1511,13 @@ entities@~1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0"
envify@^4.0.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/envify/-/envify-4.1.0.tgz#f39ad3db9d6801b4e6b478b61028d3f0b6819f7e"
dependencies:
esprima "^4.0.0"
through "~2.3.4"
errno@^0.1.3, errno@~0.1.7:
version "0.1.7"
resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618"
@ -1506,7 +1552,7 @@ es-to-primitive@^1.1.1:
is-date-object "^1.0.1"
is-symbol "^1.0.1"
es6-promise@^4.2.4:
es6-promise@^4.1.0, es6-promise@^4.2.4:
version "4.2.4"
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.4.tgz#dc4221c2b16518760bd8c39a52d8f356fc00ed29"
@ -1555,7 +1601,7 @@ ev-emitter@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/ev-emitter/-/ev-emitter-1.1.1.tgz#8f18b0ce5c76a5d18017f71c0a795c65b9138f2a"
events@^1.0.0:
events@^1.0.0, events@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924"
@ -1987,6 +2033,13 @@ global-dirs@^0.1.0:
dependencies:
ini "^1.3.4"
global@^4.3.2:
version "4.3.2"
resolved "https://registry.yarnpkg.com/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f"
dependencies:
min-document "^2.19.0"
process "~0.5.1"
globby@^7.1.1:
version "7.1.1"
resolved "https://registry.yarnpkg.com/globby/-/globby-7.1.1.tgz#fb2ccff9401f8600945dfada97440cca972b8680"
@ -2066,6 +2119,15 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6:
version "4.1.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
gray-matter@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/gray-matter/-/gray-matter-4.0.1.tgz#375263c194f0d9755578c277e41b1c1dfdf22c7d"
dependencies:
js-yaml "^3.11.0"
kind-of "^6.0.2"
section-matter "^1.0.0"
strip-bom-string "^1.0.0"
har-schema@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e"
@ -2222,6 +2284,13 @@ hoek@4.x.x:
version "4.2.1"
resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb"
hogan.js@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/hogan.js/-/hogan.js-3.0.2.tgz#4cd9e1abd4294146e7679e41d7898732b02c7bfd"
dependencies:
mkdirp "0.3.0"
nopt "1.0.10"
hosted-git-info@^2.1.4:
version "2.6.0"
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.6.0.tgz#23235b29ab230c576aab0d4f13fc046b0b038222"
@ -2332,6 +2401,10 @@ imagesloaded@^4.1.1:
dependencies:
ev-emitter "^1.0.0"
immediate@^3.2.3:
version "3.2.3"
resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.2.3.tgz#d140fa8f614659bd6541233097ddaac25cdd991c"
import-lazy@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43"
@ -2656,6 +2729,10 @@ isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
isarray@^2.0.1:
version "2.0.4"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.4.tgz#38e7bcbb0f3ba1b7933c86ba1894ddfc3781bbb7"
isemail@3.x.x:
version "3.1.2"
resolved "https://registry.yarnpkg.com/isemail/-/isemail-3.1.2.tgz#937cf919002077999a73ea8b1951d590e84e01dd"
@ -2703,7 +2780,7 @@ js-tokens@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
js-yaml@^3.10.0, js-yaml@^3.11.0, js-yaml@^3.4.3, js-yaml@^3.9.0:
js-yaml@^3.11.0, js-yaml@^3.4.3, js-yaml@^3.9.0:
version "3.11.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.11.0.tgz#597c1a8bd57152f26d622ce4117851a51f5ebaef"
dependencies:
@ -2943,6 +3020,10 @@ load-json-file@^4.0.0:
pify "^3.0.0"
strip-bom "^3.0.0"
load-script@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/load-script/-/load-script-1.0.0.tgz#0491939e0bee5643ee494a7e3da3d2bac70c6ca4"
loader-runner@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2"
@ -3253,6 +3334,12 @@ mimic-response@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.0.tgz#df3d3652a73fded6b9b0b24146e6fd052353458e"
min-document@^2.19.0:
version "2.19.0"
resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685"
dependencies:
dom-walk "^0.1.0"
mini-css-extract-plugin@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.4.0.tgz#ff3bf08bee96e618e177c16ca6131bfecef707f9"
@ -3318,6 +3405,10 @@ mixin-object@^2.0.1:
for-in "^0.1.3"
is-extendable "^0.1.1"
mkdirp@0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.3.0.tgz#1bbf5ab1ba827af23575143490426455f481fe1e"
mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
@ -3496,6 +3587,12 @@ node-sass@^4.8.3:
stdout-stream "^1.4.0"
"true-case-path" "^1.0.2"
nopt@1.0.10:
version "1.0.10"
resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee"
dependencies:
abbrev "1"
"nopt@2 || 3":
version "3.0.6"
resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9"
@ -3594,7 +3691,7 @@ object-copy@^0.1.0:
define-property "^0.2.5"
kind-of "^3.0.3"
object-keys@^1.0.8:
object-keys@^1.0.11, object-keys@^1.0.8, object-keys@~1.0.0:
version "1.0.11"
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d"
@ -4205,6 +4302,10 @@ process@^0.11.10:
version "0.11.10"
resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
process@~0.5.1:
version "0.5.2"
resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf"
promise-inflight@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3"
@ -4292,7 +4393,7 @@ query-string@^5.0.1:
object-assign "^4.1.0"
strict-uri-encode "^1.0.0"
querystring-es3@^0.2.0:
querystring-es3@^0.2.0, querystring-es3@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73"
@ -4427,6 +4528,12 @@ reduce-function-call@^1.0.1:
dependencies:
balanced-match "^0.4.2"
reduce@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/reduce/-/reduce-1.0.1.tgz#14fa2e5ff1fc560703a020cbb5fbaab691565804"
dependencies:
object-keys "~1.0.0"
regenerate@^1.2.1:
version "1.3.3"
resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f"
@ -4722,6 +4829,13 @@ scss-tokenizer@^0.2.3:
js-base64 "^2.1.8"
source-map "^0.4.2"
section-matter@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/section-matter/-/section-matter-1.0.0.tgz#e9041953506780ec01d59f292a19c7b850b84167"
dependencies:
extend-shallow "^2.0.1"
kind-of "^6.0.0"
select@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/select/-/select-1.1.2.tgz#0e7350acdec80b1108528786ec1d4418d11b396d"
@ -5097,6 +5211,10 @@ strip-ansi@^4.0.0:
dependencies:
ansi-regex "^3.0.0"
strip-bom-string@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/strip-bom-string/-/strip-bom-string-1.0.0.tgz#e5211e9224369fbb81d633a2f00044dc8cedad92"
strip-bom@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e"
@ -5233,6 +5351,10 @@ through2@^2.0.0:
readable-stream "^2.1.5"
xtend "~4.0.1"
through@~2.3.4:
version "2.3.8"
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
time-fix-plugin@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/time-fix-plugin/-/time-fix-plugin-2.0.0.tgz#d112f1e415b6ed269e008a42990ddbf8053fc315"
@ -5255,6 +5377,10 @@ to-arraybuffer@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43"
to-factory@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/to-factory/-/to-factory-1.0.0.tgz#8738af8bd97120ad1d4047972ada5563bf9479b1"
to-object-path@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af"
@ -5277,6 +5403,10 @@ to-regex@^3.0.1, to-regex@^3.0.2:
regex-not "^1.0.2"
safe-regex "^1.1.0"
toml@^2.3.3:
version "2.3.3"
resolved "https://registry.yarnpkg.com/toml/-/toml-2.3.3.tgz#8d683d729577cb286231dfc7a8affe58d31728fb"
topo@2.x.x:
version "2.0.2"
resolved "https://registry.yarnpkg.com/topo/-/topo-2.0.2.tgz#cd5615752539057c0dc0491a621c3bc6fbe1d182"
@ -5674,9 +5804,9 @@ vuepress-html-webpack-plugin@^3.2.0:
toposort "^1.0.0"
util.promisify "1.0.0"
vuepress@^0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/vuepress/-/vuepress-0.7.0.tgz#dc97846b128e7888f879e53ff3566d5fd989ec4b"
vuepress@^0.8.3:
version "0.8.3"
resolved "https://registry.yarnpkg.com/vuepress/-/vuepress-0.8.3.tgz#1d344a90b38b228071a57b247e589769c675cee3"
dependencies:
autoprefixer "^8.2.0"
buble "^0.19.3"
@ -5688,11 +5818,13 @@ vuepress@^0.7.0:
copy-webpack-plugin "^4.5.1"
css-loader "^0.28.11"
diacritics "^1.3.0"
docsearch.js "^2.5.2"
es6-promise "^4.2.4"
escape-html "^1.0.3"
file-loader "^1.1.11"
fs-extra "^5.0.0"
globby "^8.0.1"
gray-matter "^4.0.1"
js-yaml "^3.11.0"
koa-connect "^2.0.1"
koa-mount "^3.0.0"
@ -5715,6 +5847,7 @@ vuepress@^0.7.0:
semver "^5.5.0"
stylus "^0.54.5"
stylus-loader "^3.0.2"
toml "^2.3.3"
url-loader "^1.0.1"
vue "^2.5.16"
vue-loader "^15.0.0-rc.1"
@ -5728,7 +5861,6 @@ vuepress@^0.7.0:
webpack-serve "^0.3.1"
webpackbar "^2.6.1"
workbox-build "^3.1.0"
yaml-front-matter "^4.0.0"
vuetify@^1.0.16:
version "1.0.16"
@ -6029,13 +6161,6 @@ yallist@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"
yaml-front-matter@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/yaml-front-matter/-/yaml-front-matter-4.0.0.tgz#11c378c54eac3061a82cbaf693a69b4e4c44f484"
dependencies:
commander "1.0.0"
js-yaml "^3.10.0"
yargs-parser@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a"