Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
junsan1 committed Jul 9, 2024
1 parent 7376b3e commit b017505
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 9 deletions.
15 changes: 15 additions & 0 deletions _plugins/letter_page_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def generate(site)
locale = load_locale(site, lang)

process_root_page(site, lang, locale)
process_subscribe_page(site, lang, locale)

SECTIONS.each do |section|
section_path = File.join(site.source, lang, section)
Expand Down Expand Up @@ -52,6 +53,20 @@ def process_root_page(site, lang, locale)
end
end

def process_subscribe_page(site, lang, locale)
subscribe_file = File.join(site.source, lang, 'subscribe.md')
unless File.exist?(subscribe_file)
content = "---\nlayout: subscribe\ntitle: #{locale['subscribe']}\n---\n"
File.write(subscribe_file, content)
end

page = Jekyll::Page.new(site, site.source, lang, 'subscribe.md')
page.data['lang'] = lang
page.data['locale'] = locale
page.data['permalink'] = "/#{lang}/subscribe/"
site.pages << page
end

def process_section(site, lang, section, section_path, locale)
if ['soft', 'market-data', 'brokers', 'community'].include?(section)
process_catalog_section(site, lang, section, section_path, locale)
Expand Down
1 change: 0 additions & 1 deletion en/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: home
title: Algorithmic Trading Library
lang: en
---
2 changes: 0 additions & 2 deletions en/subscribe.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
layout: subscribe
title: Subscribe
lang: en
permalink: /en/subscribe/
---
1 change: 0 additions & 1 deletion ru/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: home
title: Библиотека алготрейдинга
lang: ru
---
2 changes: 0 additions & 2 deletions ru/subscribe.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
layout: subscribe
title: Подписка
lang: ru
permalink: /ru/subscribe/
---
1 change: 0 additions & 1 deletion zh/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: home
title: 算法交易库
lang: zh
---
2 changes: 0 additions & 2 deletions zh/subscribe.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
layout: subscribe
title: 订阅
lang: zh
permalink: /zh/subscribe/
---

0 comments on commit b017505

Please sign in to comment.