Open
Conversation
htfy96
reviewed
Dec 29, 2020
data/mapping.yml
Outdated
| - fedora-iot | ||
| - fedora-ostree | ||
| - fedora-secondary | ||
| - - rpmfusion |
htfy96
reviewed
Dec 29, 2020
| - 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 |
Contributor
There was a problem hiding this comment.
Why does this line write JSON into an html file (mapping.html)?
Member
Author
There was a problem hiding this comment.
The resulting mirror-help.xml will then have a special entry metadata:mapping. Inside that is JSON data. We could parse it in frontend.
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.