Class: JekyllNotion::NotionDatabase
Instance Method Summary
collapse
#config, #id, #initialize
Instance Method Details
#collection_name ⇒ Object
25
26
27
|
# File 'lib/jekyll-notion/notion_database.rb', line 25
def collection_name
config["collection"] || "posts"
end
|
#data_name ⇒ Object
29
30
31
|
# File 'lib/jekyll-notion/notion_database.rb', line 29
def data_name
config["data"]
end
|
#fetch ⇒ Object
Returns an empty array or a NotionToMd:Page array
6
7
8
9
10
11
12
|
# File 'lib/jekyll-notion/notion_database.rb', line 6
def fetch
return [] unless id?
@fetch ||= @notion.database_query(query)[:results].map do |page|
NotionToMd::Page.new(:page => page, :blocks => build_blocks(page.id))
end
end
|
#filter ⇒ Object
14
15
16
|
# File 'lib/jekyll-notion/notion_database.rb', line 14
def filter
config["filter"]
end
|
#sorts ⇒ Object
18
19
20
21
22
23
|
# File 'lib/jekyll-notion/notion_database.rb', line 18
def sorts
if config["sort"]
Jekyll.logger.warn("Jekyll Notion:", "sort property is deprecated, use sorts instead")
end
config["sorts"]
end
|