Skip to content

Commit ad3da9a

Browse files
author
Alasdair Allan
authored
Merge pull request raspberrypi#2156 from raspberrypi/kill_extra_html
Prevent extraneous HTML files being created
2 parents 25e64e3 + 8f6159f commit ad3da9a

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

makefiles/jekyll.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ MARKER_FILE = $(OUTPUT_DIR)/.done
77
NEXT_MAKEFILE = makefiles/html.mk
88

99
AUTO_NINJABUILD = $(BUILD_DIR)/auto_jekyll.ninja
10+
ASCIIDOC_INCLUDES_DIR = $(BUILD_DIR)/adoc_includes
1011

1112
# The $(MARKER_FILE) is used to ensure that all the asciidoc files are copied before we try invoking jekyll
1213
all: | $(MARKER_FILE)
@@ -47,7 +48,7 @@ $(OUTPUT_DIR)/_includes/%.html: $(SCRIPTS_DIR)/fetch_header_and_fonts.py | $(OUT
4748
$< https://esi.raspberrypi.org/en/components/$*/ $@
4849

4950
$(AUTO_NINJABUILD): $(SCRIPTS_DIR)/create_jekyll_ninjabuild.py $(DOCUMENTATION_INDEX) | $(BUILD_DIR)
50-
$< $(DOCUMENTATION_INDEX) $(SITE_CONFIG) $(ASCIIDOC_DIR) $(OUTPUT_DIR) $@
51+
$< $(DOCUMENTATION_INDEX) $(SITE_CONFIG) $(ASCIIDOC_DIR) $(OUTPUT_DIR) $(ASCIIDOC_INCLUDES_DIR) $@
5152

5253
$(OUTPUT_DIR)/_data/index.json: $(SCRIPTS_DIR)/create_output_index_json.py $(DOCUMENTATION_INDEX) | $(OUTPUT_DIR)/_data
5354
$< $(DOCUMENTATION_INDEX) $@

makefiles/shared.ninja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ rule create_search
1717
command = $SCRIPTS_DIR/create_search.py $DOCUMENTATION_INDEX $src_dir $out
1818

1919
rule create_build_adoc
20-
command = $SCRIPTS_DIR/create_build_adoc.py $DOCUMENTATION_INDEX $SITE_CONFIG $GITHUB_EDIT_TEMPLATE $in $out_dir $out
20+
command = $SCRIPTS_DIR/create_build_adoc.py $DOCUMENTATION_INDEX $SITE_CONFIG $GITHUB_EDIT_TEMPLATE $in $inc_dir $out
2121

2222
rule create_build_adoc_include
2323
command = $SCRIPTS_DIR/create_build_adoc_include.py $SITE_CONFIG $GITHUB_EDIT_TEMPLATE $in $out

scripts/create_build_adoc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
config_yaml = sys.argv[2]
1212
github_edit = sys.argv[3]
1313
src_adoc = sys.argv[4]
14-
build_dir = sys.argv[5]
14+
includes_dir = sys.argv[5]
1515
build_adoc = sys.argv[6]
1616
output_subdir = os.path.basename(os.path.dirname(build_adoc))
1717
adoc_filename = os.path.basename(build_adoc)
@@ -63,4 +63,4 @@
6363
:sectanchors:
6464
6565
{}
66-
""".format(output_subdir, build_dir, '{} - {}'.format(site_config['title'], index_title), index_title, new_contents))
66+
""".format(output_subdir, includes_dir, '{} - {}'.format(site_config['title'], index_title), index_title, new_contents))

scripts/create_jekyll_ninjabuild.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ def scan_adoc(adoc_filename, apparent_filename):
3838
if not os.path.exists(input_dir):
3939
raise Exception("Error: {} doesn't exist".format(input_dir))
4040
output_dir = sys.argv[4]
41-
output_ninjabuild = sys.argv[5]
41+
adoc_includes_dir = sys.argv[5]
42+
output_ninjabuild = sys.argv[6]
4243

4344
# Read _config.yml
4445
with open(config_yaml) as config_fh:
@@ -74,6 +75,7 @@ def scan_adoc(adoc_filename, apparent_filename):
7475
ninja.newline()
7576
ninja.variable('src_dir', input_dir)
7677
ninja.variable('out_dir', output_dir)
78+
ninja.variable('inc_dir', adoc_includes_dir)
7779
ninja.newline()
7880
ninja.include('makefiles/shared.ninja')
7981
ninja.newline()
@@ -100,7 +102,7 @@ def scan_adoc(adoc_filename, apparent_filename):
100102
for page in sorted(doc_pages):
101103
if page in join_files:
102104
for include in join_files[page]:
103-
dest = os.path.join('$out_dir', include)
105+
dest = os.path.join('$inc_dir', include)
104106
source = os.path.join('$src_dir', include)
105107
if source not in all_doc_sources:
106108
scan_adoc(include, page)

0 commit comments

Comments
 (0)