Skip to content

Commit

Permalink
Show posts by tags in desc
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-dharti-r committed Jun 27, 2024
1 parent 0e8c7aa commit c4fa864
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-backend-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: DeployBackendDev
on:
push:
branches:
- "master"
- "use-nuxt-image-to-show-images"

jobs:
deploy-backend-dev:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-backend-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: DeployBackendProd
on:
push:
branches:
- "master"
- "use-nuxt-image-to-show-images"

jobs:
deploy-backend-prod:
Expand Down
10 changes: 7 additions & 3 deletions nuxt-frontend/components/partials/NewHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ export default {
methods: {
handleScroll() {
let scrollY = this.podcastRef
? this.podcastRef.scrollTop
: window.scrollY;
? this.podcastRef.scrollTop
: window.scrollY;
let pageYOffset = this.podcastRef ? scrollY : window.pageYOffset;
let scrollUp = this.lastScrollY > scrollY && pageYOffset > 100;
this.showNavbar = scrollUp || (this.showNavbar && pageYOffset > 0);
Expand All @@ -286,10 +286,14 @@ export default {
// Check if any child URL matches
if (navbar.subMenus) {
return navbar.subMenus.some(
(subMenu) => this.$route.path === subMenu.url,
(subMenu) => this.$route.path === subMenu.url
);
}
if (name == "Portfolio" && this.$route.path.startsWith("/portfolio")) {
return true;
}
return false;
},
},
Expand Down
3 changes: 2 additions & 1 deletion post/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ func (repository *Repository) GetPostsByTag(c *gin.Context) {
posts := []Post{}
err = repository.Db.Select(&posts, `SELECT id, title, slug, tags as tag, is_featured, is_published, published_on, published_at, reading_time, summary
FROM posts
WHERE `+query+` tags @> $1`, `[{"slug": "`+slug+`"}]`)
WHERE `+query+` tags @> $1`, `[{"slug": "`+slug+`"}]
ORDER BY published_on DESC`)
if err != nil {
log.Error("Error while fetching posts: ", err)
c.AbortWithStatus(http.StatusInternalServerError)
Expand Down

0 comments on commit c4fa864

Please sign in to comment.