首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >撇号博客模块:个人博客帖子404

撇号博客模块:个人博客帖子404
EN

Stack Overflow用户
提问于 2017-02-27 08:13:58
回答 1查看 411关注 0票数 0

我在用撇号博客模块显示个人博客文章页面时遇到了困难。我一定是遗漏了什么还是忘了什么?

下面是如何复制这个问题的方法(使用下面的repo:https://github.com/newdesignideas/sample-veebidisainer中的代码)

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

我的app.js如下:

代码语言:javascript
运行
复制
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/模块文件结构的快照

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-02-28 13:11:15

博客文章本身的URL相对于博客页面URL。因此,如果您在/blog有一个博客页面,并且有一个带有test片段的测试文章,那么您应该能够在/blog/test上看到它。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42480701

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档