Skip to content

Commit

Permalink
fix(deploy-docs): support i18n files (#166)
Browse files Browse the repository at this point in the history
Signed-off-by: Kenji Miyake <[email protected]>
  • Loading branch information
kenji-miyake authored Jun 10, 2022
1 parent be9ce38 commit 2e96e34
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion deploy-docs/create-doc-comment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ done
comment_lines=("Documentation URL: $base_url")
comment_lines+=("Modified URLs:")
for markdown_path in "${markdown_paths[@]}"; do
lang=""
if [[ $markdown_path =~ .*\..*\.md$ ]]; then
lang=$(echo "$markdown_path" | sed -r 's|.*\.(\w+)\.md|\1|')/
markdown_path=$(echo "$markdown_path" | sed -r 's|(.*)\.\w+(\.md)|\1\2|')
fi

if [[ $markdown_path =~ README\.md$ ]]; then
url_path=${markdown_path/README.md/}
elif [[ $markdown_path =~ index\.md$ ]]; then
Expand All @@ -54,7 +60,7 @@ for markdown_path in "${markdown_paths[@]}"; do
url_path=${markdown_path/.md/\/}
fi

comment_lines+=("- $base_url$url_path")
comment_lines+=("- $base_url$url_path$lang")
done

# Workaround for multiline strings
Expand Down

0 comments on commit 2e96e34

Please sign in to comment.