Skip to content

Commit

Permalink
Fix links in index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
programming-wolf committed Nov 23, 2023
1 parent c0989b2 commit 0af0875
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/main/java/org/isaqb/asciidoc/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,30 @@ public static void main(final String[] args) {
language,
projectVersion,
curriculumFileName,
versionDate
versionDate,
curriculumFileName
));
convertInLanguage(
ENGLISH,

convertInFormat(HTML,
projectVersion,
INDEX_FILE_NAME,
versionDate);
versionDate,
ENGLISH,
curriculumFileName);
}

private static void convertInLanguage(
final String language,
final String projectVersion,
final String curriculumFileName,
final String versionDate) {
final String versionDate,
final String curriculumName) {
Stream.of(FORMATS).forEach(format -> convertInFormat(
format, projectVersion,
curriculumFileName,
versionDate,
language
language,
curriculumName
));
}

Expand All @@ -77,11 +82,12 @@ private static void convertInFormat(
final String projectVersion,
final String curriculumFileName,
final String versionDate,
final String language) {
final String language,
final String curriculumName) {
try (final Asciidoctor asciidoctor = create()) {
final Attributes attributes = toAttributes(
projectVersion,
curriculumFileName,
curriculumName,
versionDate,
language);
asciidoctor.convertDirectory(
Expand All @@ -98,7 +104,9 @@ private static void convertInFormat(
.toDir(new File(OUTPUT_DIR))
.safe(SafeMode.UNSAFE)
.build());

if (!INDEX_FILE_NAME.equals(curriculumFileName)) {
// rename only if we're not creating the index file.
renameResultAccordingToLanguage(curriculumFileName, format, language);
}
}
Expand Down

0 comments on commit 0af0875

Please sign in to comment.