Skip to content

Commit

Permalink
这能跑吗 试试看
Browse files Browse the repository at this point in the history
  • Loading branch information
xxtg666 committed Oct 6, 2024
1 parent 49de60d commit a904769
Show file tree
Hide file tree
Showing 270 changed files with 651 additions and 3 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/check-similarity-img.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Check Similarity Images

on:
workflow_dispatch:

jobs:
check-similarity-img:
name: Check Similarity Images
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: 3.10.*
- name: Install dependencies
run: |
python -m pip install Pillow
- name: check similarity images
run: |
python shell/imgcheck.py
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'chore: update similarity images data'
file_pattern: static/data/similar_images.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37 changes: 37 additions & 0 deletions .github/workflows/generate-article-page.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Generate article page

on:
push:
branches:
- 'main'
paths:
- 'art/*'
- 'shell/art2text.sh'
- 'shell/genartlist.sh'
- '.github/workflows/generate-article-page.yml'

jobs:
generate-article-page:
name: Generate article page
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: remove previous build
run: |
rm -f ./text/*.html
- name: generate directory
run: |
./shell/genartlist.sh
- name: build article
run: |
./shell/art2text.sh
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'chore: update article page'
file_pattern: 'text/*.html'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/generate-config-file.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Generate config file

on:
push:
branches:
- 'main'
paths:
- 'meme/**'
- '.github/workflows/generate-config-file.yml'

jobs:
generate-config-file:
name: Generate config file
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: build config
run: |
./shell/computed.sh
cat static/scripts/config.js
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'chore: update config file'
file_pattern: static/scripts/config.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# memebox generating

PAGELANG?=en
PAGELANG?=zh

TITLE?=MemeBox
DESC?=Joy for Everyone
TITLE?=PCL Community 梗
DESC?=PCL Community 群大佬们的日常
TDESC?=> _Text memes description._
FOOTER?=** Footer **

Expand Down
74 changes: 74 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<!DOCTYPE html>
<html lang="zh">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="PCL Community 群大佬们的日常">
<link rel="icon" href="/static/favicon.ico">
<title>PCL Community 梗 | PCL Community 群大佬们的日常</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/[email protected]/css/pico.min.css">
<link rel="stylesheet" href="/static/style.css">
</head>

<body>
<main class="container">
<h1>PCL Community 梗 | <a href="text">文字梗</a></h1>
<h5 id="description"></h5>
<article id="view">
<div>
<h2></h2>
<div>
<a download title="下载图片">
<svg width="32" height="32" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"
fill="currentColor">
<path
d="M5.36891 8.08074L7.50833 10.2202V4.46802H8.50833V10.1473L10.5749 8.08074L11.282 8.78784L8.32545 11.7444H7.61835L4.6618 8.78784L5.36891 8.08074Z" />
<path
d="M14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14C11.3137 14 14 11.3137 14 8ZM13 8C13 10.7614 10.7614 13 8 13C5.23858 13 3 10.7614 3 8C3 5.23858 5.23858 3 8 3C10.7614 3 13 5.23858 13 8Z" />
</svg>
</a>
<span id="refresh-btn" title="梗图不喜欢?换一张试试看">
<svg width="32" height="32" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"
fill="currentColor">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M4.681 3H2V2h3.5l.5.5V6H5V4a5 5 0 1 0 4.53-.761l.302-.954A6 6 0 1 1 4.681 3z" />
</svg>
</span>
<a href="#" title="返回画廊">
<svg width="40" height="40" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"
fill="currentColor">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M8 8.707l3.646 3.647.708-.707L8.707 8l3.647-3.646-.707-.708L8 7.293 4.354 3.646l-.707.708L7.293 8l-3.646 3.646.707.708L8 8.707z" />
</svg>
</a>
</div>
</div>

<img alt="查看大图">
</article>
<div id="gallery">
<div class="column" id="col1"></div>
<div class="column" id="col2"></div>
<div class="column" id="col3"></div>
</div>

<footer id="footer">
<p>** Footer **</p>
</footer>
</main>

<template id="gallery-item">
<article class="item">
<a href="${id}">
<img src="${src}" alt="${alt}">
<span aria-busy="false">${title}</span>
</a>
</article>
</template>

<script src="./static/scripts/index.js" type="module"></script>
</body>

</html>
Binary file added meme/ad-closenn/Ad你要被夹(彩色).jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/ad-closenn/Ad你要被夹(灰色).jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/ad-closenn/I USE WINDOWS.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/ad-closenn/不是md c.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/ad-closenn/喵~.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/ad-closenn/坏男娘.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/ad-closenn/时代变了.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/ad-closenn/甲辰年.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/allmagic/《与表格斗智斗勇》.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/allmagic/一群__.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/allmagic/传下去,凌云成猫娘了.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/allmagic/似了.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/allmagic/你甚至不结合上下文.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/allmagic/又有人举报我.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/allmagic/草.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/allmagic/说实话.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/chiloven945/我的柚子.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/chiloven945/草.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/chiloven945/设精了.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/ddf/lazy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/ddf/《执着》.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/ddf/《那就太好了》.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/ddf/世界他坐大牢.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme/ddf/实话实说.png
Binary file added meme/ddf/怎么没有我的.png
Binary file added meme/ddf/我是废物.png
Binary file added meme/encvar/编译一下直接爆炸.jpg
Binary file added meme/http/202.jpg
Binary file added meme/http/204.jpg
Binary file added meme/http/206.jpg
Binary file added meme/http/307.jpg
Binary file added meme/http/400.jpg
Binary file added meme/http/403.gif
Binary file added meme/http/408.jpg
Binary file added meme/http/418.jpg
Binary file added meme/http/429.jpg
Binary file added meme/http/451.jpg
Binary file added meme/http/504.jpg
Binary file added meme/httpcat/0.jpg
Binary file added meme/httpcat/100.jpg
Binary file added meme/httpcat/101.jpg
Binary file added meme/httpcat/102.jpg
Binary file added meme/httpcat/103.jpg
Binary file added meme/httpcat/200.jpg
Binary file added meme/httpcat/201.jpg
Binary file added meme/httpcat/202.jpg
Binary file added meme/httpcat/203.jpg
Binary file added meme/httpcat/204.jpg
Binary file added meme/httpcat/205.jpg
Binary file added meme/httpcat/206.jpg
Binary file added meme/httpcat/207.jpg
Binary file added meme/httpcat/208.jpg
Binary file added meme/httpcat/214.jpg
Binary file added meme/httpcat/226.jpg
Binary file added meme/httpcat/300.jpg
Binary file added meme/httpcat/301.jpg
Binary file added meme/httpcat/302.jpg
Binary file added meme/httpcat/303.jpg
Binary file added meme/httpcat/304.jpg
Binary file added meme/httpcat/305.jpg
Binary file added meme/httpcat/307.jpg
Binary file added meme/httpcat/308.jpg
Binary file added meme/httpcat/400.jpg
Binary file added meme/httpcat/401.jpg
Binary file added meme/httpcat/402.jpg
Binary file added meme/httpcat/403.jpg
Binary file added meme/httpcat/404.jpg
Binary file added meme/httpcat/405.jpg
Binary file added meme/httpcat/406.jpg
Binary file added meme/httpcat/407.jpg
Binary file added meme/httpcat/408.jpg
Binary file added meme/httpcat/409.jpg
Binary file added meme/httpcat/410.jpg
Binary file added meme/httpcat/411.jpg
Binary file added meme/httpcat/412.jpg
Binary file added meme/httpcat/413.jpg
Binary file added meme/httpcat/414.jpg
Binary file added meme/httpcat/415.jpg
Binary file added meme/httpcat/416.jpg
Binary file added meme/httpcat/417.jpg
Binary file added meme/httpcat/418.jpg
Binary file added meme/httpcat/420.jpg
Binary file added meme/httpcat/421.jpg
Binary file added meme/httpcat/422.jpg
Binary file added meme/httpcat/423.jpg
Binary file added meme/httpcat/424.jpg
Binary file added meme/httpcat/425.jpg
Binary file added meme/httpcat/426.jpg
Binary file added meme/httpcat/428.jpg
Binary file added meme/httpcat/429.jpg
Binary file added meme/httpcat/431.jpg
Binary file added meme/httpcat/444.jpg
Binary file added meme/httpcat/450.jpg
Binary file added meme/httpcat/451.jpg
Binary file added meme/httpcat/497.jpg
Binary file added meme/httpcat/498.jpg
Binary file added meme/httpcat/499.jpg
Binary file added meme/httpcat/500.jpg
Binary file added meme/httpcat/501.jpg
Binary file added meme/httpcat/502.jpg
Binary file added meme/httpcat/503.jpg
Binary file added meme/httpcat/504.jpg
Binary file added meme/httpcat/506.jpg
Binary file added meme/httpcat/507.jpg
Binary file added meme/httpcat/508.jpg
Binary file added meme/httpcat/509.jpg
Binary file added meme/httpcat/510.jpg
Binary file added meme/httpcat/511.jpg
Binary file added meme/httpcat/521.jpg
Binary file added meme/httpcat/522.jpg
Binary file added meme/httpcat/523.jpg
Binary file added meme/httpcat/525.jpg
Binary file added meme/httpcat/530.jpg
Binary file added meme/httpcat/599.jpg
Binary file added meme/jinghai-lingyun/jhly 嗦 ammb.png
Binary file added meme/jinghai-lingyun/你好坏欸.png
Binary file added meme/jinghai-lingyun/全员难绷.png
Binary file added meme/jinghai-lingyun/爽!!!.jpg
Binary file added meme/jinghai-lingyun/草.png
Binary file added meme/joker2184/我是废物.png
Binary file added meme/light-beacon/6.png
Binary file added meme/light-beacon/emmmm.png
Binary file added meme/light-beacon/sb锁了.png
Binary file added meme/light-beacon/spam.jpg
Binary file added meme/light-beacon/¿.png
Binary file added meme/light-beacon/。。。.png
Binary file added meme/light-beacon/《傲娇》.png
Binary file added meme/light-beacon/不更懒得写.png
Binary file added meme/light-beacon/中毒.png
Binary file added meme/light-beacon/你想怎么搞.png
Binary file added meme/light-beacon/你猜.png
Binary file added meme/light-beacon/你要被夹.jpg
Binary file added meme/light-beacon/写炸了.png
Binary file added meme/light-beacon/哦吼.png
Binary file added meme/light-beacon/完全没必要啊.png
Binary file added meme/light-beacon/干脆直接飞了.png
Binary file added meme/light-beacon/很棒 对吧.png
Binary file added meme/light-beacon/快打 127.0.0.1.png
Binary file added meme/light-beacon/怎么了.png
Binary file added meme/light-beacon/怎么来活了.png
Binary file added meme/light-beacon/滑稽抽烟.png
Binary file added meme/light-beacon/让我看看.png
Binary file added meme/light-beacon/语气.jpg
Binary file added meme/light-beacon/错误的.png
Binary file added meme/light-beacon/麻了.png
Binary file added meme/light-beacon/?.png
Binary file added meme/ltcat/6.jpg
Binary file added meme/ltcat/mod 仙人.jpg
Binary file added meme/ltcat/你要被夹.jpg
Binary file added meme/ltcat/别装optifine.jpg
Binary file added meme/ltcat/啊?不是?.jpg
Binary file added meme/ltcat/喜欢刷屏哦.jpg
Binary file added meme/ltcat/夹子宽带.jpg
Binary file added meme/ltcat/屁嘞(.jpg
Binary file added meme/ltcat/开香槟咯.jpg
Binary file added meme/ltcat/我不能理解.jpg
Binary file added meme/ltcat/我说过个锤锤.jpg
Binary file added meme/ltcat/载人航天.png
Binary file added meme/ltcat/鸣潮公式.png
Binary file added meme/luolinlin/《信标怎么样》.jpg
Binary file added meme/luolinlin/典!!.jpg
Binary file added meme/luolinlin/戳爆野指针.png
Binary file added meme/luolinlin/挺好.png
Binary file added meme/luolinlin/给新人的提示.png
Binary file added meme/mxmilu666/不小心打错了.png
Binary file added meme/mxmilu666/我是废物.png
Binary file added meme/pigeon0v0/Solved.png
Binary file added meme/pigeon0v0/TMD.png
Binary file added meme/pigeon0v0/《List 的故事》.png
Binary file added meme/pigeon0v0/也可以.png
Binary file added meme/pigeon0v0/你们可以整点新活.png
Binary file added meme/pigeon0v0/啥玩意儿.png
Binary file added meme/pigeon0v0/害怕.png
Binary file added meme/pigeon0v0/开盒.png
Binary file added meme/pigeon0v0/我看看怎么个事.png
Binary file added meme/pigeon0v0/我群退早了.png
Binary file added meme/pigeon0v0/所以这是个啥.png
Binary file added meme/pigeon0v0/是吧.png
Binary file added meme/pigeon0v0/真他妈傻逼啊.png
Binary file added meme/pigeon0v0/真他妈服了.png
Binary file added meme/pigeon0v0/草.jpg
Binary file added meme/pigeon0v0/?.png
Binary file added meme/saltwood/传下去,凌云成猫娘了.png
Binary file added meme/saltwood/草.png
Binary file added meme/tangge233/FUCKYOUMS.png
Binary file added meme/tangge233/gayhub.png
Binary file added meme/tangge233/入典.png
Binary file added meme/tangge233/再蹲一下.png
Binary file added meme/tangge233/压缩机压 AMD.png
Binary file added meme/tangge233/在新线程分析.png
Binary file added meme/tangge233/多线程呢.png
Binary file added meme/tangge233/夹夹乐.png
Binary file added meme/tangge233/我不是人.png
Binary file added meme/tangge233/新型诈骗.png
Binary file added meme/this_way_sir.png
Binary file added meme/wforst-breeze/全员难绷.png
Binary file added meme/wforst-breeze/喵~.png
Binary file added meme/wforst-breeze/草.png
Binary file added meme/wldxl/先爽刷几个t再说.png
Binary file added meme/wldxl/快打 192.168.1.1.png
Binary file added meme/worldhim/。.jpg
Binary file added meme/worldhim/菊花.png
Binary file added meme/wyc/你妈 砍个屁.png
Binary file added meme/wyc/可乐猫.png
Binary file added meme/wyc/必须给每个人都安排上.png
Binary file added meme/wyc/草.png
Binary file added meme/xxtg666/中登招待所.png
Binary file added meme/xxtg666/猫娘柚子?.jpg
Binary file added meme/xxtg666/绷.png
Binary file added meme/youzi/byd.png
Binary file added meme/youzi/《信标怎么样》.jpg
Binary file added meme/youzi/《我是傻逼》.jpg
Binary file added meme/youzi/《柚子自述》.jpg
Binary file added meme/youzi/不乱设-移精了.png
Binary file added meme/youzi/你要被夹.jpg
Binary file added meme/youzi/傻逼开发板.png
Binary file added meme/youzi/全能柚子.png
Binary file added meme/youzi/哈哈哈哈哈草.png
Binary file added meme/youzi/精.jpg
Binary file added meme/youzi/草.png
Binary file added meme/z0z0r4/Image_1726558041906.png
Binary file added meme/z0z0r4/Image_1726558122477.png
Binary file added meme/z0z0r4/Image_1726558138297.png
Binary file added meme/z0z0r4/Image_1726558151857.png
Binary file added meme/z0z0r4/Image_1726558158283.png
Binary file added meme/z0z0r4/Image_1726558166928.png
Binary file added meme/z0z0r4/Image_1726558172857.png
Binary file added meme/z0z0r4/Image_1726558179120.png
Binary file added meme/z0z0r4/Image_1726558185084.png
Binary file added meme/z0z0r4/Image_1726558188369.png
Binary file added meme/z0z0r4/Image_1726558246869.png
Binary file added meme/z0z0r4/Image_1726558252536.png
Binary file added meme/z0z0r4/Image_1726558259114.png
Binary file added meme/z0z0r4/Image_1726558285735.png
Binary file added meme/z0z0r4/Image_1726558293086.png
Binary file added meme/z0z0r4/Image_1726558295964.png
Binary file added meme/z0z0r4/Image_1726558310751.png
Binary file added meme/z0z0r4/……?.png
Binary file added meme/z0z0r4/你们真无敌了….png
Binary file added meme/zhao6888/我不是大佬.png
Binary file added meme/《信标怎么样》.jpg
Binary file added meme/《大佬项目》.png
Binary file added meme/《踢了chiloven》.jpg
Binary file added meme/一下.jpg
Binary file added meme/传下去,凌云成猫娘了.png
Binary file added meme/全员难绷.png
Binary file added meme/计网不咎.jpg
54 changes: 54 additions & 0 deletions shell/art2text.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env bash

direrr() {
echo -e "\e[41m[ERROR] You should run me under \e[1;33mthe root of this repository.\e[0m"
exit 1
}

[[ -d "art" ]] || direrr
[[ -d "text" ]] || direrr

for doc in art/*.md
do
echo Converting "'${doc:4}'" ...
cat > "text/${doc:4:-3}.html" <<EOF
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Joy for Everyone">
<link rel="icon" href="/static/favicon.ico">
<title>MemeBox | Joy for Everyone</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/[email protected]/css/pico.min.css">
<link rel="stylesheet" href="/static/style.css">
<style>
#view {
text-align: left;
}
</style>
</head>
<body>
<main class="container">
<h1>MemeBox | <a href="/text">Text memes</a></h1>
<article id="view">
<github-md>
EOF
cat "$doc" >> "text/${doc:4:-3}.html"
cat >> "text/${doc:4:-3}.html" <<EOF
</github-md>
</article>
<footer id="footer">
<p>** Footer **</p>
</footer>
</main>
</body>
<script src="https://cdn.jsdelivr.net/gh/MarketingPipeline/Markdown-Tag/markdown-tag.js"></script>
</html>
EOF
done
13 changes: 13 additions & 0 deletions shell/computed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#! /bin/bash
echo 'export default {
items: [' > ./static/scripts/config.js

find meme -type f -print0 | grep -z -i -E '\.(jpg|png|jfif|webp|gif|jpeg|bmp)$' | sort -z | while IFS= read -r -d '' file_name
do
echo -n ' ' >> ./static/scripts/config.js
echo $(jq -R -c . <<< "$file_name")',' >> ./static/scripts/config.js
# echo ',' >> ./static/scripts/config.js
done

echo ' ]
}' >> ./static/scripts/config.js
69 changes: 69 additions & 0 deletions shell/genartlist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/usr/bin/env bash

direrr() {
echo -e "\e[41m[ERROR] You should run me under \e[1;33mthe root of this repository.\e[0m"
exit 1
}

titleerr() {
rm -f text/index.html
echo -e "\e[41m[ERROR] The title of the article \e[1;33mcannot be found!\e[0m"
exit 1
}

[[ -d "art" ]] || direrr
[[ -d "text" ]] || direrr

echo "Generating article directory..."

cat > "text/index.html" <<EOF
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Joy for Everyone">
<link rel="icon" href="/static/favicon.ico">
<title>MemeBox | Joy for Everyone</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/[email protected]/css/pico.min.css">
<link rel="stylesheet" href="/static/style.css">
<style>
#view {
text-align: left;
}
</style>
</head>
<body>
<main class="container">
<h1>MemeBox | <a href="/">Picture memes</a></h1>
<h5 id="description"></h5>
<article id="view">
<github-md>
> _Text memes description._
EOF

for doc in art/*.md
do
echo Adding "'${doc:4:-3}'" ...
title="$(grep -E '^# ' "$doc" | head -n1)"
[[ -z "$title" ]] && titleerr
echo "- [${title:2}](./${doc:4:-3}.html)" >> "text/index.html"
done

cat >> "text/index.html" <<EOF
</github-md>
</article>
<footer id="footer">
<p>** Footer **</p>
</footer>
</main>
</body>
<script src="https://cdn.jsdelivr.net/gh/MarketingPipeline/Markdown-Tag/markdown-tag.js"></script>
</html>
EOF
Loading

0 comments on commit a904769

Please sign in to comment.