Skip to content

add tags#29

Merged
dgorodnichy merged 2 commits into
masterfrom
add-tags
Aug 27, 2024
Merged

add tags#29
dgorodnichy merged 2 commits into
masterfrom
add-tags

Conversation

@AucT
Copy link
Copy Markdown
Collaborator

@AucT AucT commented Aug 27, 2024

tags will be with short link

/tags/:tag

Summary by CodeRabbit

  • New Features

    • Enabled taxonomy and term content types in the site configuration.
    • Introduced clickable tag links in blog post layouts for improved navigation.
    • Added a tags section in individual blog posts for better content discoverability.
    • Enhanced header functionality to display context-sensitive content based on page type.
    • Included Open Graph and Twitter card tags for optimized social media sharing.
  • Bug Fixes

    • Streamlined tag rendering process for better performance and readability.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 27, 2024

Walkthrough

The changes involve modifications to the hugo.toml configuration file, primarily altering the disableKinds setting to enable taxonomy and term content. Updates were also made to the blog post layout templates, enhancing the rendering of tags and introducing a new section for displaying them. Conditional rendering was added to the header template to adapt based on the page type, specifically for tag-related content.

Changes

Files Change Summary
hugo.toml Changed disableKinds from ["taxonomy", "term"] to [], enabling all content types; updated blog permalink.
themes/beaver/layouts/_default/list.html Simplified tag rendering by directly generating clickable links for tags without intermediate steps.
themes/beaver/layouts/blog/single.html Added a new section for displaying tags as clickable links after the post title.
themes/beaver/layouts/partials/page/header.html Introduced conditional rendering to include a partial template for tag-related content and added Open Graph tags.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Header
    participant TagPartial

    User->>Header: Access blog page
    Header->>Header: Check page type
    Header->>TagPartial: Include "header/blog.html" if type is "tags"
    TagPartial-->>Header: Render tag-specific content
    Header-->>User: Display updated header
Loading

🐇 Hop, hop, hooray! The tags are now free,
With links that bounce like a bumblebee!
In the header they dance, in the list they play,
Our blog's now a garden, come explore the way!
🥕✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8b195d9 and 8d1b0c5.

Files selected for processing (4)
  • hugo.toml (1 hunks)
  • themes/beaver/layouts/_default/list.html (1 hunks)
  • themes/beaver/layouts/blog/single.html (1 hunks)
  • themes/beaver/layouts/partials/page/header.html (1 hunks)
Additional comments not posted (6)
themes/beaver/layouts/blog/single.html (1)

27-27: LGTM!

The new HTML element for displaying tags is correctly implemented and enhances the user experience by making tags accessible as clickable links.

The code changes are approved.

themes/beaver/layouts/_default/list.html (1)

50-50: LGTM!

The new implementation for rendering tags is correct and simplifies the code by removing the need for an intermediate variable, enhancing readability and efficiency.

The code changes are approved.

hugo.toml (1)

8-8: LGTM!

The modification to the disableKinds setting is correct and allows for the inclusion of taxonomy and term-related content.

The code changes are approved.

themes/beaver/layouts/partials/page/header.html (3)

90-90: LGTM!

The conditional check for .Type being "tags" is correctly implemented.

The code changes are approved.


91-91: LGTM!

The partial template "header/blog.html" is correctly included when .Type is "tags".

The code changes are approved.


92-92: LGTM!

The conditional block is correctly ended.

The code changes are approved.

@dgorodnichy
Copy link
Copy Markdown
Collaborator

@AucT , Сделай пожалуйста еще чтобы эти теги на индексной странице тоже были кликабельные:
Screenshot 2024-08-27 at 12 45 47

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8d1b0c5 and 0fd2671.

Files ignored due to path filters (1)
  • content/blog/og-blog.jpg is excluded by !**/*.jpg
Files selected for processing (4)
  • content/blog/_index.md (1 hunks)
  • hugo.toml (1 hunks)
  • themes/beaver/layouts/blog/list.html (1 hunks)
  • themes/beaver/layouts/partials/page/header.html (2 hunks)
Files skipped from review due to trivial changes (1)
  • content/blog/_index.md
Files skipped from review as they are similar to previous changes (2)
  • hugo.toml
  • themes/beaver/layouts/partials/page/header.html
Additional comments not posted (1)
themes/beaver/layouts/blog/list.html (1)

50-50: LGTM!

The code segment simplifies the way tags are displayed for each blog post and improves readability and maintainability. The tags are now formatted as clickable links that enhance user navigation.

The code changes are approved.

@dgorodnichy
Copy link
Copy Markdown
Collaborator

LGTM. Checked on my local environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants