Skip to content

Commit

Permalink
Merge pull request #63 from security-alliance/feature/add_tags
Browse files Browse the repository at this point in the history
Feature/add tags
  • Loading branch information
mattaereal authored Sep 23, 2024
2 parents fafc3ee + 524a22a commit 75a8c91
Show file tree
Hide file tree
Showing 7 changed files with 393 additions and 34 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
1 change: 1 addition & 0 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ assets_version = "2.1.0" # DO NOT EDIT: Managed by `mdbook-catppuccin install`

[output.html]
additional-css = ["./theme/catppuccin.css", "./theme/catppuccin-admonish.css", "./mdbook-admonish.css", "./theme/custom.css"]
additional-js = ["./theme/tagsindex.json"]
template-path = "theme"
copy-images = true
default-theme = "navy"
Expand Down
24 changes: 21 additions & 3 deletions serve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@ if ! test -e theme/index.hbs; then
echo "Run serve.sh inside root folder."
exit 1
fi
trap "sed -i 's|{{ path_to_root }}|/book/|g' theme/index.hbs" INT
sed -i 's|/book/|{{ path_to_root }}|g' theme/index.hbs
mdbook serve

# Function to perform sed operation in a cross-platform manner
cross_platform_sed() {
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS (BSD sed)
sed -i '' 's|/book/|{{ path_to_root }}|g' theme/index.hbs
else
# Linux and others (GNU sed)
sed -i 's|/book/|{{ path_to_root }}|g' theme/index.hbs
fi
}

# Set up trap for cleanup
trap "cross_platform_sed" INT

# Perform initial sed operation
cross_platform_sed

node theme/tags_generator.js

mdbook serve --watcher native
Loading

0 comments on commit 75a8c91

Please sign in to comment.