Skip to content

博客功能 (Blog)

主题提供了完善的博客功能,包括博客列表页 (Blog Listing) 和文章详情页 (Article Page)。

博客列表页

博客列表页用于展示博客文章的聚合列表。使用的是 main-blog section。

模板文件

  • templates/blog.json

配置选项

在主题编辑器中,导航至 Blogs 页面进行配置:

  • 布局 (Layout):
    • Grid: 网格布局(默认)
    • Collage: 拼贴布局
  • 显示图片 (Show image): 是否显示文章特色图片
  • 图片高度 (Image height):
    • Adapt to image: 自适应图片比例
    • Small: 固定高度(小)
    • Medium: 固定高度(中)
    • Large: 固定高度(大)
  • 显示日期 (Show date): 是否显示发布日期
  • 显示作者 (Show author): 是否显示文章作者
  • 内边距 (Padding): 设置 section 的上下内边距

文章详情页

文章详情页用于展示单篇文章的具体内容。使用的是 main-article section。

模板文件

  • templates/article.json

配置选项

在主题编辑器中,导航至 Blog posts 页面进行配置:

  • 特色图片 (Featured Image):
    • 可以设置图片高度 (Image height)
  • 标题区域 (Title):
    • 显示日期 (Show date): 控制是否在标题下显示发布日期
    • 显示作者 (Show author): 控制是否在标题下显示作者名
  • 分享按钮 (Share):
    • 可以自定义分享标签文本 (Share label)

如何使用

  1. 创建博客:

    • 在 Shopify 后台,进入 Online Store > Blog posts.
    • 点击 Manage blogs,然后 Add blog(例如命名为 "News" 或 "Blog")。
    • 默认情况下,新博客将自动使用主题的默认博客模板 (blog.json)。
  2. 添加文章:

    • Blog posts 页面点击 Add blog post
    • 撰写文章内容,上传特色图片。
    • 在右侧 Organization 部分,选择刚才创建的博客分类。
    • 默认情况下,文章将自动使用主题的默认文章模板 (article.json)。
  3. 添加到导航:

    • 进入 Online Store > Navigation.
    • 选择 Main menu
    • 添加菜单项,链接选择 Blogs > [您的博客名称]
    • 这样用户就可以在前台导航栏点击进入博客列表页。

Released under the MIT License.