diff --git a/_config.yml b/_config.yml index 213bb2f..c285938 100644 --- a/_config.yml +++ b/_config.yml @@ -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 diff --git a/source/build.py b/source/build.py index 4c5e860..bc35d18 100755 --- a/source/build.py +++ b/source/build.py @@ -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: diff --git a/source/config.py b/source/config.py index 60581a9..283a280 100644 --- a/source/config.py +++ b/source/config.py @@ -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