Skip to content

Commit

Permalink
Merge branch 'release/6.0.21'
Browse files Browse the repository at this point in the history
* release/6.0.21:
  fixing the canonical link
  UI updates to fix #930
  • Loading branch information
austintoddj committed Feb 4, 2021
2 parents 496a56f + f9167f7 commit d8d79c7
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 24 deletions.
2 changes: 1 addition & 1 deletion public/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/app.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"/js/app.js": "/js/app.js?id=520b5900e4af085892ba",
"/js/app.js": "/js/app.js?id=90af637484ed2deeb568",
"/css/app.css": "/css/app.css?id=a49a08395034a6be9488"
}
6 changes: 3 additions & 3 deletions resources/js/components/modals/SeoModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@
</div>
<div class="form-group row">
<div class="col-12">
<label for="canonicalLink" class="font-weight-bold text-uppercase text-muted small">
<label for="canonical_link" class="font-weight-bold text-uppercase text-muted small">
{{ trans.canonical_link }}
</label>
<input
v-model="post.meta.canonical_link"
id="canonicalLink"
id="canonical_link"
type="text"
class="form-control border-0"
name="canonicalLink"
name="canonical_link"
:title="trans.canonical_link"
:placeholder="trans.canonical_link_placeholder"
@input="update"
Expand Down
31 changes: 23 additions & 8 deletions resources/js/ui/views/ShowPost.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,16 @@ export default {
metaInfo() {
return {
title: this.post ? this.post.title : 'Canvas',
title: this.post?.meta?.title,
meta: [
{ name: 'description', content: this.post ? this.post.summary : '' },
{ property: 'og:title', content: this.post ? this.post.title : '' },
{ property: 'og:image', content: this.post ? this.post.featured_image : '' },
{ property: 'og:description', content: this.post ? this.post.summary : '' },
{ name: 'description', content: this.post?.meta?.description },
{ property: 'og:title', content: this.post?.meta?.title },
{ property: 'og:image', content: this.post?.featured_image },
{ property: 'og:description', content: this.post?.meta?.description },
{ name: 'twitter:card', content: 'summary' },
{ name: 'twitter:title', content: this.post ? this.post.meta.title : '' },
{ name: 'twitter:description', content: this.post ? this.post.summary : '' },
{ name: 'twitter:image', content: this.post ? this.post.featured_image : '' },
{ name: 'twitter:title', content: this.post?.meta?.title },
{ name: 'twitter:description', content: this.post?.meta?.description },
{ name: 'twitter:image', content: this.post?.featured_image },
],
};
},
Expand All @@ -174,6 +174,15 @@ export default {
async created() {
await Promise.all([this.fetchPost()]);
// Hack since vue-meta doesn't seem to like canonical tags
if (this.post?.meta?.canonical_link != null) {
let link = document.createElement('link');
link.rel = 'canonical';
link.href = this.post.meta.canonical_link;
document.head.appendChild(link);
}
this.isReady = true;
NProgress.done();
},
Expand All @@ -188,6 +197,12 @@ export default {
});
},
beforeRouteLeave(to, from, next) {
// Hack to remove the canonical tag when you navigate away
document.querySelector('link[rel="canonical"]').remove();
next();
},
methods: {
fetchPost() {
return this.request()
Expand Down
2 changes: 1 addition & 1 deletion resources/js/views/EditPost.vue
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export default {
meta: {
description: null,
title: null,
canonicalLink: null,
canonical_link: null,
},
tags: [],
topic: [],
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1040,9 +1040,9 @@
integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==

"@types/node@*":
version "14.14.22"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.22.tgz#0d29f382472c4ccf3bd96ff0ce47daf5b7b84b18"
integrity sha512-g+f/qj/cNcqKkc3tFqlXOYjrmZA+jNBiDzbP3kH+B+otKFqAdPgVTGP1IeKRdMml/aE69as5S4FqtxAbl+LaMw==
version "14.14.25"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.25.tgz#15967a7b577ff81383f9b888aa6705d43fbbae93"
integrity sha512-EPpXLOVqDvisVxtlbvzfyqSsFeQxltFbluZNRndIb8tr9KiBnYNLzrc1N3pyKUCww2RNrfHDViqDWWE1LCJQtQ==

"@types/parse-glob@*":
version "3.0.29"
Expand Down Expand Up @@ -2792,9 +2792,9 @@ [email protected]:
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=

electron-to-chromium@^1.3.649:
version "1.3.652"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.652.tgz#9465d884d609acffd131ba71096de7bfabd63670"
integrity sha512-85J5D0Ksxjq2MIHfgwOURRej72UMlexbaa7t+oKTJan3Pa/RBE8vJ4/JzwaQjLCElPvd0XeLWi7+xYTVrq96aA==
version "1.3.653"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.653.tgz#1d98400eba330538a7fe169808c6bf9d83c44450"
integrity sha512-LehOhcl74u9fkV9Un6WahJ+Xh+0FZLCCDnKYis1Olx1DX2ugRww5PJicE65OG8yznMj8EOQZRcz6FSV1xKxqsA==

elliptic@^6.5.3:
version "6.5.4"
Expand Down Expand Up @@ -7540,9 +7540,9 @@ webpack-sources@^2.1.1:
source-map "^0.6.1"

webpack@^5.1.3:
version "5.20.1"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.20.1.tgz#dfecbcfb660544113a923479c8ca1044fdbf1533"
integrity sha512-cStILc8W14WZXsgfeJmNIQlmQU06F7THfCJ6id3pIB/EXuR6nquolJ2ZJoaLNb6zdec6O2jOAzVKtBYc7vGDjg==
version "5.20.2"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.20.2.tgz#55a6e461e2a6e1ca7467a419886acf9c7b052d5f"
integrity sha512-gGPip54KK7DznaaPHVuNGqym3LAXXL+bPkZ9SlLTCdHmmk+m5x+D4UZdhWvw32CMahYlZwZYPsioFIw36/txYQ==
dependencies:
"@types/eslint-scope" "^3.7.0"
"@types/estree" "^0.0.46"
Expand Down

0 comments on commit d8d79c7

Please sign in to comment.