-
Notifications
You must be signed in to change notification settings - Fork 24
feat: add mapping for repos #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
data/mapping.yml
Outdated
| - fedora-iot | ||
| - fedora-ostree | ||
| - fedora-secondary | ||
| - - rpmfusion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicate -?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. Fixed.
| - wget -O hugo.tar.gz https://github.com/gohugoio/hugo/releases/download/v0.37.1/hugo_0.37.1_Linux-64bit.tar.gz && tar xzf hugo.tar.gz | ||
| - wget https://github.com/mikefarah/yq/releases/download/v4.2.0/yq_linux_amd64 -O /usr/bin/yq && chmod +x /usr/bin/yq | ||
| script: | ||
| - yq eval -j data/mapping.yml >> content/post/mirror-help/mapping.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this line write JSON into an html file (mapping.html)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The resulting mirror-help.xml will then have a special entry metadata:mapping. Inside that is JSON data. We could parse it in frontend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this looks pretty hackish to me despite possible escaping issues:
<item>
<title>metadata:mapping</title>
<link>https://sjtug.org/post/mirror-help/mapping/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://sjtug.org/post/mirror-help/mapping/</guid>
<description>{
"groups": {
"rust": {
"name": "Rust 语言及工具链",
"repos": [
"crates.io",
"git/crates.io-index",
"static.crates.io",
"rust-static"
]
},
Better to just output JSON into static/mapping.json and fetch the file from the frontend.
We'll introduce categories on our mirror frontend. To do this, we create a special page which contains JSON data, and load them on frontend.