Skip to content

Commit

Permalink
feat: enable mkdocs to publish docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jiachengxu committed Sep 10, 2023
1 parent de66099 commit cce447c
Show file tree
Hide file tree
Showing 21 changed files with 53 additions and 2 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: publish-docs
on:
push:
branches:
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# token-security-benchmark
# Token Security Benchmark
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Token Security Benchmark
2 changes: 1 addition & 1 deletion hack/gendocs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func main() {
if err != nil {
log.Fatalf("failed to parse template: %v", err)
}
f, err := os.Create(filepath.Join("./docs", fmt.Sprintf("%s %s.md", item.ID, item.Name)))
f, err := os.Create(filepath.Join("./docs", fmt.Sprintf("%s.md", item.ID)))
if err != nil {
log.Fatalf("failed to create the docs file for risk item: %s, %v", item.ID, err)
}
Expand Down
26 changes: 26 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
site_name: Token Security Benchmark
site_description: Token Security Benchmark
repo_url: https://github.com/cryptousersecurity/token-security-benchmark
strict: true
theme:
name: "material"
language: en

nav:
- Overview: index.md
- TSB-2023-001 Honeypot: TSB-2023-001.md
- TSB-2023-002 Mintable: TSB-2023-002.md
- TSB-2023-003 OwnershipRetrieval: TSB-2023-003.md
- TSB-2023-004 BalanceManipulation: TSB-2023-004.md
- TSB-2023-005 HiddenOwnership: TSB-2023-005.md
- TSB-2023-006 SelfDestruction: TSB-2023-006.md
- TSB-2023-007 ExternalInvocation: TSB-2023-007.md
- TSB-2023-008 BlackListFunction: TSB-2023-008.md
- TSB-2023-009 FullSaleRestriction: TSB-2023-009.md
- TSB-2023-010 SlippageModification: TSB-2023-010.md
- TSB-2023-011 TransferPausable: TSB-2023-011.md
- TSB-2023-012 PersonalSlippageModification: TSB-2023-012.md
- TSB-2023-013 TransactionWhitelisting: TSB-2023-013.md
- TSB-2023-014 AntiWhale: TSB-2023-014.md
- TSB-2023-015 AntiWhaleModification: TSB-2023-015.md
- TSB-2023-016 TradingCooldown: TSB-2023-016.md

0 comments on commit cce447c

Please sign in to comment.