0

我无法使用撇号博客模块显示单个博客文章页面。我一定是错过了什么或忘记了什么?

这是复制问题的方法(使用以下仓库中的代码:https ://github.com/newdesignideas/sample-veebidisainer )

  • 使用 url “test” 和标题 “test” 创建了一篇示例文章或博客文章
  • 示例博客文章“test”标题显示在 localhost:3000/blog 的主博客页面中
  • 示例博客文章在访问 url “localhost:3000/test”时出现 404 错误

我的 app.js 如下:

var apos = require('apostrophe')({
  shortName: 'veebidisainer',
  title: 'veebidisainer',

  // declaring the blog bundle
  bundles: [ 'apostrophe-blog' ],
  // These are the modules we want to bring into the project.
  modules: {
    // This configures the apostrophe-users module to add an admin-level
    // group by default
    'apostrophe-users': {
      groups: [
        {
          title: 'guest',
          permissions: [ ]
        },
        {
          title: 'admin',
          permissions: [ 'admin' ]
        }
      ]
    },
    // This configures the apostrophe-assets module to push a 'site.less'
    // stylesheet by default
    'apostrophe-assets': {
      stylesheets: [
        {
          name: 'site'          
        }
      ],
      scripts: [
        {
          name: 'mo',
        }
      ]
    },
    // Add your modules and their respective configuration here!

    'apostrophe-blog': {
      widget: true
    },
    'apostrophe-blog-pages': {},
    'apostrophe-blog-widgets': {},
    'apostrophe-pages': {
      // We must list 'apostrophe-blog-pages'
      types: [

        { name: 'apostrophe-blog-pages',
          label: 'Blog' 
        },
        {
          name: 'default',
          label: 'Default'
        },
        {
          name: 'home',
          label: 'Home'
        }
      ]
    },
    'b2b-main-menu': {},
    'b2b-main-menu-widgets': {
      extend: 'apostrophe-pieces-widgets'
    },
  }

});

我检查了 MongoDB 数据库,示例测试文章已正确发布。也许我错过了一个视图文件?由于几乎没有文档 - 我尝试在适当的地方创建视图文件。此屏幕截图显示了当前的文件结构:

单击此处查看显示 lib/模块文件结构的屏幕截图

4

1 回答 1

0

博客文章本身的 URL 与博客页面 URL 相关。因此,如果您在 有一个博客页面/blog,并且有一个带有 slug 的测试帖子test,那么您应该能够在/blog/test.

于 2017-02-28T13:11:15.087 回答