From fee2be41b48a64c62d0865897e70609973ab33b2 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Sun, 28 Apr 2024 15:55:58 +0700 Subject: [PATCH] [Change] use index.html --- pdf/.github/workflows/workflow.yml | 51 ------------------------------ pdf/.gitignore | 1 + pdf/index.html | 22 +++++++++++++ 3 files changed, 23 insertions(+), 51 deletions(-) delete mode 100644 pdf/.github/workflows/workflow.yml create mode 100644 pdf/.gitignore create mode 100644 pdf/index.html diff --git a/pdf/.github/workflows/workflow.yml b/pdf/.github/workflows/workflow.yml deleted file mode 100644 index eec2a07..0000000 --- a/pdf/.github/workflows/workflow.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Generate Directory Listing and Deploy to GitHub Pages - -on: [push] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install beautifulsoup4 - - - name: Generate Directory Listing - run: | - import os - import pathlib - from bs4 import BeautifulSoup - - def create_index_html(path): - soup = BeautifulSoup("", "html.parser") - ul = soup.find("ul") - - for child in sorted(path.iterdir()): - li = soup.new_tag("li") - a = soup.new_tag("a", href=str(child)) - a.string = str(child) - li.append(a) - ul.append(li) - - with open(path / "index.html", "w") as f: - f.write(str(soup)) - - root = pathlib.Path(".") - for path in sorted(root.rglob('*')): - if path.is_dir(): - create_index_html(path) - - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: . diff --git a/pdf/.gitignore b/pdf/.gitignore new file mode 100644 index 0000000..723ef36 --- /dev/null +++ b/pdf/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/pdf/index.html b/pdf/index.html new file mode 100644 index 0000000..a0fa270 --- /dev/null +++ b/pdf/index.html @@ -0,0 +1,22 @@ + + + + +