Class: ContentfulBootstrap::Templates::Blog

Inherits:
Base
  • Object
show all
Defined in:
lib/contentful_bootstrap/templates/blog.rb

Instance Attribute Summary

Attributes inherited from Base

#space

Instance Method Summary collapse

Methods inherited from Base

#initialize, #run

Constructor Details

This class inherits a constructor from ContentfulBootstrap::Templates::Base

Instance Method Details

#content_typesObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/contentful_bootstrap/templates/blog.rb', line 7

def content_types
  [
    {
      id: 'author',
      name: 'Author',
      display_field: 'name',
      fields: [
        {
          id: 'name',
          name: "Author Name",
          type: "Symbol"
        }
      ]
    },
    {
      id: 'post',
      name: 'Post',
      display_field: 'title',
      fields: [
        {
          id: 'title',
          name: "Post Title",
          type: "Symbol"
        },
        {
          id: 'content',
          name: "Content",
          type: "Text"
        },
        {
          id: 'author',
          name: "Author",
          type: "Link",
          link_type: "Entry"
        }
      ]
    }
  ]
end

#entriesObject



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/contentful_bootstrap/templates/blog.rb', line 47

def entries
  {
    'author' => [
      {
        id: "dan_brown",
        name: "Dan Brown"
      },
      {
        id: "pablo_neruda",
        name: "Pablo Neruda"
      }
    ],
    'post' => [
      {
        title: "Inferno",
        content: "Inferno is the last book in Dan Brown's collection...",
        author: EntryLink.new("dan_brown")
      },
      {
        title: "Alturas de Macchu Picchu",
        content: "Alturas de Macchu Picchu is one of Pablo Neruda's most famous poetry books...",
        author: EntryLink.new("pablo_neruda")
      }
    ]
  }
end