ITADN
Portable-Linux-Apps/Portable-Linux-Apps.github.io
README.md
以下内容由 AI 翻译,如有问题请点此提交 issue 反馈
欢迎使用所有 AppImage 软件包和 GNU/Linux 便携应用程序的最完整数据库。

便携式 Linux 应用

首个受 AUR 启发的 AppImage 软件中心!


主页 "Portable-Linux-Apps.github.io"


前往应用程序列表安装 "AM",即包管理器

测试

本网站的大多数页面均由 tools/am2pla-siteivan-hc/AM 仓库中自动生成—— 一个 GitHub Actions 工作流每 30 分钟运行一次该脚本,并将 输出推送回 main。对生成文件(index.mdapps.mdappimages.md、24 个分类页面、apps.json、 本仓库中的 am2pla-site 副本)的手动编辑将在下次同步时被覆盖。 持久性更改位于 _layouts/assets/css/assets/js/_config.ymlGemfile、本 README 以及 .github/workflows/ 中。

在推送之前或处理 拉取请求时,要测试对网站的更改,请从以下三个选项中选择一个。推荐 使用 Docker,因为容器与 GitHub Pages 构建 环境相匹配,并且适用于任何主机 Ruby 版本。

选项 1:Docker(推荐,无需本地 Ruby)

使用官方 ruby:3.3 镜像,该镜像与 GitHub Pages 自身构建所使用的 Ruby 版本相匹配。首次运行需要几分钟,因为 bundle install 正在编译原生 gem;具名的 jekyll-bundle 卷 会缓存它们,以便后续运行快速启动。

# delete any host-generated lockfile so the container can regenerate one
rm -f Gemfile.lock

docker run --rm -it -p 4000:4000 \
  -v "$PWD:/srv/jekyll" -w /srv/jekyll \
  -v jekyll-bundle:/usr/local/bundle \
  ruby:3.3 \
  bash -c "bundle install && bundle exec jekyll serve --host 0.0.0.0"

选项 2:本地 Jekyll

  • 安装 Jekyll
  • 在终端中,切换到仓库根目录
  • 运行 bundle install(仅在首次,或在 Gemfile 更改后需要)
  • 运行 bundle exec jekyll serve

需要 Ruby 3.0 - 3.3github-pages gem 目前固定了旧版本的 jekyll-github-metadata(2.16.1),在 Ruby 3.4+ 上会因 instance_variable_defined? NameError 而崩溃。如果你的发行版 提供 Ruby 3.4 或更高版本,请使用 Docker(选项 1)或通过版本管理器安装 Ruby 3.3,例如 rbenvasdfGemfile:development 组中声明了 webrick,因此 jekyll serve 在 Ruby 3.0+ 上可用(GitHub Pages 生产环境不使用 webrick)。

选项 3:测试站点生成脚本的更改

如果你正在更改 ivan-hc/AM 仓库中的 tools/am2pla-site (该脚本在每次同步时生成目录页面),请针对此网站的分离工作树运行它,以免输出污染 你的主检出。sed 模拟了同步工作流的行为——它 中和了脚本的 cd "$(xdg-user-dir DESKTOP)",使输出落在 工作树中,而不是你的 Desktop 目录中。

# Adjust to wherever you have ivan-hc/AM cloned
AM_REPO=~/src/AM

# Detached worktree of this repo's main branch
git worktree add -d ../pla-site-test main

# Run the patched script inside the worktree
sed 's|^cd "$(xdg-user-dir|#&|' "$AM_REPO/tools/am2pla-site" > /tmp/am2pla-site-test
cd ../pla-site-test && bash /tmp/am2pla-site-test

# Preview with the Docker command from Option 1 (or use Option 2)
docker run --rm -it -p 4000:4000 \
  -v "$PWD:/srv/jekyll" -w /srv/jekyll \
  -v jekyll-bundle:/usr/local/bundle \
  ruby:3.3 \
  bash -c "bundle install && bundle exec jekyll serve --host 0.0.0.0"

# Clean up when done
cd - && git worktree remove --force ../pla-site-test

当 Docker 容器以 root 身份运行时,它会在 worktree 中留下 root 拥有的 _site/Gemfile.lockgit worktree remove --force 将无法删除这些文件,因此如果 remove 报错,请用 sudo rm -rf ../pla-site-test 完成操作。

查看站点

你会看到确认站点已生成且服务器正在运行的消息。然后在浏览器中,导航到 http://127.0.0.1:4000 以确认 你所做的更改是否符合预期。错误消息会显示在你运行 Jekyll 的终端窗口中。当你更改一个文件时,站点 会自动重新构建(这需要几秒钟,完成后会在终端中通知你)。但是,如果你更改了 '_config.yml', 你必须用 ctrl-c 终止 Jekyll 并重新运行以测试更改。


© 2020-present Ivan Alessandro Sala aka 'Ivan-HC' - 我在这里只是为了好玩!


ko-fi.comPayPal.me