Skip to content

Commit

Permalink
Merge pull request #425 from zirreal/master
Browse files Browse the repository at this point in the history
improved build time
  • Loading branch information
zirreal authored Jan 21, 2025
2 parents 61f91fe + 385f59f commit 50650ed
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 162 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:
steps:
# Step 1: Checkout repository with full commit history
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Ensure the full commit history is fetched

# Step 2: Get the list of updated files since the last commit
- name: Get changes
Expand Down
7 changes: 5 additions & 2 deletions gridsome.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,11 @@ module.exports = function (api) {
console.log('exists');
} else {
createPage({
path: `/blog/${locale}/${path}`,
component: './src/templates/BlogTranslations.vue',
path: `/blog/${locale}/${node.name}/`,
component: 'src/pages/redirect.vue',
context: {
redirect: `/blog/${node.name.toLowerCase()}/`,
},
});
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/pages/blog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<page-query>
query ($locale: String!) {

allPostsTags: allPost(filter: {locale: { eq: $locale }} ) {
allPostsTags: allPost(filter: {locale: { eq: $locale }}) {
edges {
node {
tags {
Expand Down
21 changes: 17 additions & 4 deletions src/pages/redirect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ query {
<script>
export default {
metaInfo() {
if (!this.redirect) {
return {}; // Do not add meta info if no redirection is needed
}
return {
// title: `Redirecting to https://robonomics.network/${this.redirect}`,
meta: [
Expand All @@ -36,10 +40,19 @@ export default {
computed: {
redirect(){
if(this.$context.redirect){
return this.$context.redirect
}
}
const target = this.$context.redirect;
if (target && this.$route.path !== target) {
return target;
}
return null;
}
},
mounted() {
if(this.$context.redirect.includes('blog')) {
this.$setLocale('en')
}
}
}
</script>
Expand Down
153 changes: 0 additions & 153 deletions src/templates/BlogTranslations.vue

This file was deleted.

0 comments on commit 50650ed

Please sign in to comment.