mirror of
https://github.com/monero-project/monero-site.git
synced 2025-01-28 18:56:33 +02:00
moneropedia auto-fill index, entry for mining
This commit is contained in:
parent
3851424f2b
commit
f7a3f8ec5d
@ -31,6 +31,7 @@ module Jekyll
|
|||||||
class Markdown < Converter
|
class Markdown < Converter
|
||||||
alias base_converter convert
|
alias base_converter convert
|
||||||
@@moneropedia = Array.new
|
@@moneropedia = Array.new
|
||||||
|
@@moneropedia_ordered = Hash.new
|
||||||
|
|
||||||
def convert(content)
|
def convert(content)
|
||||||
# build up index of Moneropedia summaries
|
# build up index of Moneropedia summaries
|
||||||
@ -47,10 +48,27 @@ module Jekyll
|
|||||||
|
|
||||||
if !entry.empty?
|
if !entry.empty?
|
||||||
@@moneropedia.push({ :terms => entry['terms'], :summary => entry['summary'], :file => File.basename(entry_file, ".*") })
|
@@moneropedia.push({ :terms => entry['terms'], :summary => entry['summary'], :file => File.basename(entry_file, ".*") })
|
||||||
|
@@moneropedia_ordered = @@moneropedia_ordered.merge({ entry['entry'] => File.basename(entry_file, ".*") })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Jekyll.logger.warn YAML::dump(@@moneropedia_ordered)
|
||||||
|
if content.include? '@moneropedia'
|
||||||
|
# Moneropedia index, replace with a list of entries
|
||||||
|
cur_letter = 'A'
|
||||||
|
replace = "<div class='col-lg-4'>\n<h4 class='text-center'>A</h4>\n"
|
||||||
|
@@moneropedia_ordered.sort.map do |entry, link|
|
||||||
|
if cur_letter != entry[0]
|
||||||
|
replace += "</div>\n<div class='col-lg-4'>\n<h4 class='text-center'>" + entry[0] + "</h4>\n"
|
||||||
|
cur_letter = entry[0]
|
||||||
|
end
|
||||||
|
replace += "<a href='/knowledge-base/moneropedia/" + link + "'>" + entry + "</a><br>\n"
|
||||||
|
end
|
||||||
|
replace += "</div>"
|
||||||
|
content = content.gsub(/(\@moneropedia)/i, replace)
|
||||||
|
end
|
||||||
|
|
||||||
# replace instances of @term with tooltips of the summary
|
# replace instances of @term with tooltips of the summary
|
||||||
@@moneropedia.each do |entry|
|
@@moneropedia.each do |entry|
|
||||||
entry[:terms].each do |term|
|
entry[:terms].each do |term|
|
||||||
|
@ -9,5 +9,14 @@ icon: "icon_wiki"
|
|||||||
attribution: "<!-- Icon is based on work by Freepik (http://www.freepik.com) and is licensed under Creative Commons BY 3.0 -->"
|
attribution: "<!-- Icon is based on work by Freepik (http://www.freepik.com) and is licensed under Creative Commons BY 3.0 -->"
|
||||||
---
|
---
|
||||||
|
|
||||||
### Work in Progress
|
---
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
@moneropedia
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
If there is an entry you'd like to modify or be added, please [open an issue on this website's Github repository](https://github.com/monero-project/monero-site/issues) or submit changes via pull request.
|
||||||
|
10
knowledge-base/moneropedia/miners.md
Normal file
10
knowledge-base/moneropedia/miners.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
layout: moneropedia
|
||||||
|
entry: "Mining"
|
||||||
|
terms: ["mining", "miner", "miners"]
|
||||||
|
summary: "the process of cryptographically computing a mathematical proof for a block, containing a number of transactions, which is then added to the blockchain"
|
||||||
|
---
|
||||||
|
|
||||||
|
### The Basics
|
||||||
|
|
||||||
|
{{ page.summary | capitalize }}.
|
Loading…
Reference in New Issue
Block a user