xqsit94 / gridsome-starter-geek-blog

Tech blog boilerplate built with Gridsome
https://gridsome-geek-blog.netlify.app
MIT License
19 stars 8 forks source link

Changable Sidebar Component #6

Closed neilherbertuk closed 2 years ago

neilherbertuk commented 2 years ago

I've back ported some changes I made to the template on a site I'm working on as I thought it might be useful.

Summary: This will allow users to have different sidebars on different pages

Detailed: Over the series of commits I've allowed users of the template to specify different sidebars for different parts of the site and made an opinionated change to the default setup.

I was wondering whether to change the sidebar used within src/templates/Tag.vue but feel that a tags sidebar could potentially get very messy when a large number of tags are used.

Usage:

Within posts, if the user wants a different sidebar they simply add the following to the post's front matter

---
sidebar: SidebarFileName
---

For other pages they would need to modify the prop for the <app-sidebar /> html tag

<app-sidebar sidebar="SidebarFileName" />

image

Default Sidebar

image

Alternative Sidebar

image

Categories Sidebar on the Blog page

image

Categories Sidebar on the Category page

netlify[bot] commented 2 years ago

✔️ Deploy Preview for gridsome-geek-blog ready!

🔨 Explore the source changes: e1b2961e223e5cde985eef6fea9735510cc7597f

🔍 Inspect the deploy log: https://app.netlify.com/sites/gridsome-geek-blog/deploys/621816c0f7a50b00089cf0f9

😎 Browse the preview: https://deploy-preview-6--gridsome-geek-blog.netlify.app

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

xqsit94 commented 2 years ago

Great Work! @neilherbertuk. Thanks for your contribution! 🥳