change to three collections for three problem sets

This commit is contained in:
Oliver Lew
2018-05-10 21:39:03 +08:00
parent bec48b0b5e
commit c7df45374b
3 changed files with 11 additions and 6 deletions
+8 -2
View File
@@ -28,8 +28,14 @@ exclude: [PATAdvanced/, PATBasic/, Gemfile, Gemfile.lock, source]
# collections
collections:
articles:
Advanced:
output: true
permalink: /:path:output_ext
permalink: /:collection/:path:output_ext
Basic:
output: true
permalink: /:collection/:path:output_ext
Top:
output: true
permalink: /:collection/:path:output_ext
# vim:tabstop=2:softtabstop=2:shiftwidth=2
+2 -3
View File
@@ -104,15 +104,14 @@ class FileBuilder:
"""
write everything to a final markdown file
"""
filename = "{}/{}{:04}.md".format(config.md_dir, self.c, self.i)
tag = config.tag[self.c]
category = config.category[self.c]
filename = os.path.join(config.md_dir, "_" + category, "{:04}.md".format(self.i))
title, problem_div = self.read_html()
code, code_url = self.read_code()
date, expl = self.read_expl()
tag = config.tag[self.c]
print("Building {}".format(filename))
with open(filename, 'w') as f:
+1 -1
View File
@@ -1,6 +1,6 @@
#! /usr/bin/env python3
md_dir = "../_articles" # The dir of final generated markdown file
md_dir = "../" # The dir of final generated markdown file
html_dir = "html" # The dir of html file from patest.cn
analysis_dir = "analysis" # The dir of md files of only analysis text
code_dir = { # Children folders of code_dir