Skip to content

Commit

Permalink
Add links to homepage (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey committed Aug 17, 2022
1 parent 0f39053 commit 9a93e03
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
11 changes: 9 additions & 2 deletions src/subcommand/server/templates/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub(crate) struct RootHtml {

impl Content for RootHtml {
fn title(&self) -> String {
"Ordinal Block Explorer".to_string()
"Ordinals".to_string()
}

fn page(self) -> PageHtml {
Expand Down Expand Up @@ -38,7 +38,14 @@ mod tests {
}
.to_string(),
"
<h1>Recent Blocks</h1>
<h1>Ordinals</h1>
<nav>
<a href=https://rodarmor.com/blog/ordinal-theory/>Theory</a>
<a href=https://github.com/casey/ord/blob/master/bip.mediawiki>BIP</a>
<a href=https://github.com/casey/ord>GitHub</a>
<a href=https://discord.gg/87cjuz4FYg>Discord</a>
</nav>
<h2>Recent Blocks</h2>
<ul>
<li>1 - <a href=/block/1111111111111111111111111111111111111111111111111111111111111111>1111111111111111111111111111111111111111111111111111111111111111</a></li>
<li>0 - <a href=/block/0000000000000000000000000000000000000000000000000000000000000000>0000000000000000000000000000000000000000000000000000000000000000</a></li>
Expand Down
9 changes: 8 additions & 1 deletion templates/root.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<h1>Recent Blocks</h1>
<h1>Ordinals</h1>
<nav>
<a href=https://rodarmor.com/blog/ordinal-theory/>Theory</a>
<a href=https://github.com/casey/ord/blob/master/bip.mediawiki>BIP</a>
<a href=https://github.com/casey/ord>GitHub</a>
<a href=https://discord.gg/87cjuz4FYg>Discord</a>
</nav>
<h2>Recent Blocks</h2>
<ul>
%% for block in &self.blocks {
<li>{{block.0}} - <a href=/block/{{block.1}}>{{block.1}}</a></li>
Expand Down
4 changes: 3 additions & 1 deletion tests/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ fn root() {
state.request_regex(
"/",
200,
".*<h1>Recent Blocks</h1>
".*<title>Ordinals</title>.*<h1>Ordinals</h1>
<nav>.*</nav>
<h2>Recent Blocks</h2>
<ul>
<li>1 - <a href=/block/[[:xdigit:]]{64}>[[:xdigit:]]{64}</a></li>
<li>0 - <a href=/block/0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206>0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206</a></li>
Expand Down

0 comments on commit 9a93e03

Please sign in to comment.