Skip to content

Commit

Permalink
Let users decide the thumbnail extension
Browse files Browse the repository at this point in the history
Signed-off-by: Jay Wang <[email protected]>
  • Loading branch information
xiaohk committed Nov 27, 2023
1 parent 1133e3a commit fc7c680
Show file tree
Hide file tree
Showing 5 changed files with 1,499 additions and 1,030 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Deploy with gh-pages
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
npx gh-pages -u "github-actions-bot <[email protected]>" -d ./gh-page
npx gh-pages -u "github-actions-bot <[email protected]>" -m "Deploy $(git log '--format=format:%H' main -1)" -d ./gh-page
if: ${{ github.ref == 'refs/heads/main' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38 changes: 33 additions & 5 deletions metadata/parse-table.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "ModuleNotFoundError",
"evalue": "No module named 'requests_ip_rotator'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m/Users/jaywang/Documents/Programs/phd/23-supernova/metadata/parse-table.ipynb Cell 1\u001b[0m line \u001b[0;36m1\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/jaywang/Documents/Programs/phd/23-supernova/metadata/parse-table.ipynb#W0sZmlsZQ%3D%3D?line=10'>11</a>\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39mPIL\u001b[39;00m \u001b[39mimport\u001b[39;00m Image\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/jaywang/Documents/Programs/phd/23-supernova/metadata/parse-table.ipynb#W0sZmlsZQ%3D%3D?line=11'>12</a>\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39mtime\u001b[39;00m \u001b[39mimport\u001b[39;00m sleep\n\u001b[0;32m---> <a href='vscode-notebook-cell:/Users/jaywang/Documents/Programs/phd/23-supernova/metadata/parse-table.ipynb#W0sZmlsZQ%3D%3D?line=12'>13</a>\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39mrequests_ip_rotator\u001b[39;00m \u001b[39mimport\u001b[39;00m ApiGateway, EXTRA_REGIONS, ALL_REGIONS\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/jaywang/Documents/Programs/phd/23-supernova/metadata/parse-table.ipynb#W0sZmlsZQ%3D%3D?line=13'>14</a>\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39mtqdm\u001b[39;00m \u001b[39mimport\u001b[39;00m tqdm\n",
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'requests_ip_rotator'"
]
}
],
"source": [
"import numpy as np\n",
"import re\n",
Expand Down Expand Up @@ -764,10 +776,26 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"entries = yaml.safe_load(open('./../src/data/supernova.yaml', 'r'))\n",
"for e in entries:\n",
" e['thumbnail'] = e['name']+'.webp'"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": []
"source": [
"with open('./../src/data/supernova.yaml', 'w') as fp:\n",
" for entry in entries:\n",
" fp.write(yaml.dump([entry]))\n",
" fp.write('\\n')"
]
}
],
"metadata": {
Expand All @@ -786,7 +814,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
"version": "3.9.13"
},
"orig_nbformat": 4
},
Expand Down
8 changes: 4 additions & 4 deletions src/components/grid-panel/GridPanel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@
<img
class="thumbnail"
src="{`${import.meta.env.BASE_URL}images/thumbnails/${
showingEntry?.name
}.webp`}"
showingEntry?.thumbnail
}`}"
alt="{`Thumbnail of ${showingEntry.name}`}"
/>
</div>
Expand Down Expand Up @@ -341,8 +341,8 @@
<img
class="thumbnail"
src="{`${import.meta.env.BASE_URL}images/thumbnails/${
entry.name
}.webp`}"
entry.thumbnail
}`}"
alt="{`Thumbnail of ${entry.name}`}"
/>
</div>
Expand Down
Loading

0 comments on commit fc7c680

Please sign in to comment.