Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ intialize-work-dir:
@mkdir -p _site
@chmod -R 777 _site/
@bundle install

.PHONY: build
build: node_modules vendor/bundle
# @bundle exec rake catalog:update
Expand Down
20 changes: 10 additions & 10 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Dotenv.load
SIDENAV_INDEX_DEFAULT_TITLE = 'Overview'
SIDENAV_FILE_BLACKLIST = [
'./vendor/**/*.md',
'./connections/**/**.md',
'./*.md',
'./_*/**/*.md'
'./src/connections/**/**.md',
'./src/*.md',
'./src/_*/**/*.md'
]

PLATFORM_API_URL = "https://platform.segmentapis.com"
Expand All @@ -25,7 +25,7 @@ namespace :nav do

p 'Updating _data/sidenav.yml based on current docs...'

docs = FileList.new('./**/*.md').exclude(SIDENAV_FILE_BLACKLIST)
docs = FileList.new('./src/**/*.md').exclude(SIDENAV_FILE_BLACKLIST)
sections = Hash.new()

docs.map do |file_list|
Expand Down Expand Up @@ -114,22 +114,22 @@ namespace :nav do
partners_nav = { 'sections' => partners_sections.values }

# Main sidenav
File.open("./_data/sidenav/main.yml","w") do |file|
File.open("./src/_data/sidenav/main.yml","w") do |file|
file.write main_nav.to_yaml({ indention: 4, separator: '' })
end

# Legal sidenav
File.open("./_data/sidenav/legal.yml","w") do |file|
File.open("./src/_data/sidenav/legal.yml","w") do |file|
file.write legal_nav.to_yaml({ indention: 4, separator: '' })
end

# API sidenav
File.open("./_data/sidenav/api.yml","w") do |file|
File.open("./src/_data/sidenav/api.yml","w") do |file|
file.write api_nav.to_yaml({ indention: 4, separator: '' })
end

# Partners sidenav
File.open("./_data/sidenav/partners.yml","w") do |file|
File.open("./src/_data/sidenav/partners.yml","w") do |file|
file.write partners_nav.to_yaml({ indention: 4, separator: '' })
end
end
Expand Down Expand Up @@ -169,7 +169,7 @@ namespace :catalog do

destinations.sort_by! { |d| d['name'] }

File.open("./_data/catalog/destinations.yml","w") do |file|
File.open("./src/_data/catalog/destinations.yml","w") do |file|
file.write "# AUTOGENERATED FROM PLATFORM API. DO NOT EDIT\n"
file.write(({"destinations" => destinations}).to_yaml({ indention: 4, separator: '' }))
end
Expand Down Expand Up @@ -197,7 +197,7 @@ namespace :catalog do

sources.sort_by! { |d| d['name'] }

File.open("./_data/catalog/sources.yml","w") do |file|
File.open("./src/_data/catalog/sources.yml","w") do |file|
file.write "# AUTOGENERATED FROM PLATFORM API. DO NOT EDIT\n"
file.write(({"sources" => sources}).to_yaml({ indention: 4, separator: '' }))
end
Expand Down