Skip to content
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

refactor(WIP): gnoland home realm #3888

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
311 changes: 186 additions & 125 deletions examples/gno.land/r/gnoland/home/home.gno
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
package home

import (
"std"
"strconv"

"gno.land/p/demo/ownable"
"gno.land/p/demo/ui"
"gno.land/p/moul/dynreplacer"
blog "gno.land/r/gnoland/blog"
events "gno.land/r/gnoland/events"
"gno.land/r/leon/hof"
)

// XXX: p/demo/ui API is crappy, we need to make it more idiomatic
Expand All @@ -30,144 +25,233 @@ func Render(_ string) string {
out, _ := events.RenderEventWidget(events.MaxWidgetSize)
return out
})
r.RegisterCallback(":latest-hof:", func() string {
return hof.RenderExhibWidget(5)
})
r.RegisterCallback(":qotb:", quoteOfTheBlock)
r.RegisterCallback(":chain-height:", func() string {
return strconv.Itoa(int(std.ChainHeight()))
})
Comment on lines -33 to -39
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should not remove these things, they are about allowing to have dynamic content on the homepage which is a target.

ps: you should also use some of them in the template code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@moul We plan to use them (dynamic parts) for other purpose (roadmap for ex).


template := `# Welcome to gno.land

We’re building gno.land, set to become the leading open-source smart contract
platform, using Gno, an interpreted and fully deterministic variation of the
Go programming language for succinct and composable smart contracts.
## We're building a user-owned internet where governance is fair, development is open, and innovation is rewarded.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should not use H2 just to make text bigger.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a good idea to use it as an H2 for SEO purposes (not for text size).


With transparent and timeless code, gno.land is the next generation of smart
contract platforms, serving as the “GitHub” of the ecosystem, with realms built
using fully transparent, auditable code that anyone can inspect and reuse.
[/about](/about)     [/github](/github)     [/try gno](/try-gno)

Intuitive and easy to use, gno.land lowers the barrier to web3 and makes
censorship-resistant platforms accessible to everyone. If you want to help lay
the foundations of a fairer and freer world, join us today.
We’re building gno.land, set to be the leading open-source smart contract platform for the Internet of the future. At its core, gno.land is powered by Gno, an interpreted and fully deterministic variation of the Go programming language, designed for succinct and composable smart contracts.

## Learn about gno.land
The gno.land blockchain is the first experiment showcasing what’s possible with Gno, providing a secure, auditable, and reusable architecture for building and iterating on decentralized applications. With transparent and timeless code, gno.land serves as the “GitHub” of the Gno ecosystem, enabling anyone to inspect, reuse, and contribute to the development of Gno-based dApps. Intuitive and easy to use, gno.land makes anti-censorship-resistant web3 applications the standard for the future. Join us in building an open-source-first, fairer, and freer Internet for everyone

- [About](/about)
- [GitHub](https://github.com/gnolang)
- [Blog](/blog)
- [Events](/events)
- Tokenomics (soon)
- [Partners, Fund, Grants](/partners)
- [Explore the Ecosystem](/ecosystem)
- [Careers](https://jobs.ashbyhq.com/allinbits)
- Reusability - smart contracts built with Gno are designed to encourage reusability, composability, and forkability when needed. 
- Open and transparent - all smart contracts and applications are fully open-source and auditable, ensuring verifiability. 
- Decentralized Governance – governance is maintained by trusted contributors and the community. 
- Developer-Friendly – Go developers can easily transition to Gno and start building without learning a new, restrictive language.

## Build with Gno

- [Write Gno in the browser](https://play.gno.land)
- [Read about the Gno Language](/gnolang)
- [Visit the official documentation](https://docs.gno.land)
- [Gno by Example](https://gno-by-example.com/)
- [Efficient local development for Gno](https://docs.gno.land/gno-tooling/cli/gno-tooling-gnodev)
- [Get testnet GNOTs](https://faucet.gno.land)
---

## Explore the universe
Why Gno?

- [Discover demo packages](https://github.com/gnolang/gno/tree/master/examples)
- [Gnoscan](https://gnoscan.io)
- [Portal Loop](https://docs.gno.land/concepts/portal-loop)
- [Testnet 4](https://test4.gno.land/)
- [Faucet Hub](https://faucet.gno.land)
## A new decentralized operating system (dOS) to power the Internet of Everyone

## [Latest Blogposts](/r/gnoland/blog)
We are building an operating system and network for everyone who wants to contribute and change the way the human component of the web currently operates. Find out more how gno.land is making this happen.

:latest-blogposts:
<gno-columns>

## [Latest Events](/r/gnoland/events)
####

:upcoming-events:
![Social coordination & community](#)

### Social coordination & community

Censorship-resistant, community-organized social impact platforms that provide coordination, conversation, conflict resolution, and a builder-owned governance sstructure.


####

![Governance & organization](#)

### Governance & Organization

Redefining governance frameworks, negotiation systems, and decentralized autonomous organizations (DAOs) to prioritize a common ecosystem alignment, active participation and ownership, and application specific implementations in lieu of a solely capital-based control system.

####

![New-Economic-Model](#)

### New Economic Model

A contribution-driven economic model that incentivizes creators, innovators, moderators, and maintainers to ensure a sustainable, builder-aligned governance and organizational framework for an alternative model to the current speculation or advertising based internet.

####

![The next killer app](#)

### The next killer app

A reusable technical architecture for everyone to build the killer applications of the future that attract the next wave of builders and users to the Internet of Everyone.

## [Hall of Fame](/r/leon/hof)

:latest-hof:
</gno-columns>

TODO: Add 'Beta Mainnet Coming Soon!' section
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leohhhn can you make this dynamic, i.e., by having like r/gnoland/blog to have a "news" tag?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@moul OK, that's what I wrote above about the dynamic sections


Stay tuned for the first phase of gno.land's launch, the beta mainnet release, and airdrop distribution. [Road to Mainnet and Beyond](https://gno.land/r/gnoland/blog:p/road-to-mainnet)

TODO: Include the gno.land roadmap dynamic infographic

**A moment in time (May 20th, 2020)*: Cosmos snapshot
**Milestone complete (July 2024)**: A multi-node, permanent and stable testnet with 1st implementation of the GovDAO
**Milestone complete (November 2024)**: Extended validator set, testnet improvements and GovDAO v2
**Milestone 'Beta Mainnet Release' (March 2025)**: GovDAO v3, r/Boards, Token distribution, Security audit complete
**Milestone 'Build the Future' (2025)**: Bridging Cosmos and gno.land, the foundations of a network of everyone
**Milestone 'Mainnet' (2025)**: A complete mainnet with token transfers and Cosmos bridge with ICS and IBC

---

## [Gno Playground](https://play.gno.land)
Ecosystem

## Discover the gno.land universe

Explore gno.land's expanding ecosystem of applications, wallets, and explorers.

[/the universe ](#)


<gno-columns>

####

![Wallet](#)

### Wallets

Execute transactions on gno.land using wallets, or a CLI keychain and client tool.

- [Adena Wallet](https://www.adena.app/)
- [gnokey](https://docs.gno.land/gno-tooling/cli/gnokey/)

####

![Explorers](#)

### Explorers

Monitor and track the status of on-chain transactions in real time.

- [gnoscan](https://gnoscan.io/)


####

Gno Playground is a web application designed for building, running, testing, and
interacting with your Gno code, enhancing your understanding of the Gno
language. With Gno Playground, you can share your code, execute tests, deploy
your realms and packages to gno.land, and explore a multitude of other features.
![Defi](#)

Experience the convenience of code sharing and rapid experimentation with
[Gno Playground](https://play.gno.land).
### Defi and Games

## Explore New Packages and Realms
Try out the DeFi platforms and gaming applications on gno.land.

### [r/gnoland](https://github.com/gnolang/gno/tree/master/examples/gno.land/r/gnoland)
- [gnoswap - a gno.land DEX](http://beta.gnoswap.io/)
- [gnochess](TODO)
- [Flippando](https://flippando.xyz/#)
- [Shifumi] (TODO)
- [Conway's Game of Life](TODO)

- [r/gnoland/blog](r/gnoland/blog)
- [r/gnoland/dao](r/gnoland/dao)
- [r/gnoland/faucet](r/gnoland/faucet)
- [r/gnoland/home](r/gnoland/home)
- [r/gnoland/pages](r/gnoland/pages)
####

### [r/sys](https://github.com/gnolang/gno/tree/master/examples/gno.land/r/sys)
![Social dApps](#)

- [r/sys/names](r/sys/names)
- [r/sys/rewards](r/sys/rewards)
- [/r/sys/validators/v2](/r/sys/validators/v2)
### Social and Community dApps

### [r/demo](https://github.com/gnolang/gno/tree/master/examples/gno.land/r/demo)
Register your gno.land username and be a part of the conversation happening on gno.land social network, r/Boards.

- [r/demo/boards](r/demo/boards)
- [r/demo/users](r/demo/users)
- [r/demo/banktest](r/demo/banktest)
- [r/demo/foo20](r/demo/foo20)
- [r/demo/foo721](r/demo/foo721)
- [r/demo/microblog](r/demo/microblog)
- [r/demo/nft](r/demo/nft)
- [r/demo/types](r/demo/types)
- [r/demo/art/gnoface](r/demo/art/gnoface)
- [r/demo/art/millipede](r/demo/art/millipede)
- [r/demo/groups](r/demo/groups)
- ...
- [r/users - gno.land's user name registry](https://gno.land/r/gnoland/users/v1)
- [r/Boards - gno.land's social network](TODO)

### [p/demo](https://github.com/gnolang/gno/tree/master/examples/gno.land/p/demo)

- [p/demo/avl](p/demo/avl)
- [p/demo/blog](p/demo/blog)
- [p/demo/ui](p/demo/ui)
- [p/demo/ufmt](p/demo/ufmt)
- [p/demo/merkle](p/demo/merkle)
- [p/demo/bf](p/demo/bf)
- [p/demo/flow](p/demo/flow)
- [p/demo/gnode](p/demo/gnode)
- [p/demo/grc/grc20](p/demo/grc/grc20)
- [p/demo/grc/grc721](p/demo/grc/grc721)
- ...
</gno-columns>

## A community of gnomes

gno.land is a contribution-driven network and community where gnomes, its dedicated contributors, serve as the builders, guardians, and pioneers of a future Internet of Everyone.

<gno-columns>
##

![Blog](#)

### Our Blog

:latest-blogposts:

##

![Events](#)

### Past Events

:upcoming-events:

</gno-columns>

---

## Socials
Builders

## Build on gno.land

gno.land builders are at the center of creating a user-owned network where applications remain open and reusable, governance aligns with contributors, and innovation extends beyond financial speculation.

[/read the documentation](docs.gno.land)

<gno-columns>

### Builder Portal

The Builder Portal is a collection of educational resources and tools to help you learn, experiment, and develop your Gno skills.

[TODO](/)

- Check out our [community projects](https://github.com/gnolang/awesome-gno)
- [Discord](https://discord.gg/S8nKUqwkPn)
- [Twitter](https://twitter.com/_gnoland)
- [Youtube](https://www.youtube.com/@_gnoland)
- [Telegram](https://t.me/gnoland)
### Bounties

## Quote of the ~Day~ Block#:chain-height:
The Gno bounty program is a good way to find interesting challenges in Gno, and get rewarded for helping us advance the project.

> :qotb:
[/read more](https://github.com/gnolang/bounties)

### gno.land grants

gno.land grants program provides financial support to developers interested in exploring new blockchain technology, and/or are already actively contributing to gno.land.

[/read more](https://github.com/gnolang/grants)

</gno-columns>

---

**This is a testnet.**
Package names are not guaranteed to be available for production.
<gno-columns>

### General

- [About](#)
- [Events](#)
- [Blog](#)
- [Carreer](#)

### Advanced

- [Builder Guides](#)
- [Tokenomics](#)
- [Demo list](#)
- [Docs](#)

### Explore

- [Faucet](#)
- [Ecosystem](#)
- [Partners](#)
- [Gnops](#)

### Social

- [GitHub](#)
- [Discord](#)
- [YouTube](#)
- [Twitter](#)

</gno-columns>
`

if override != "" {
Expand All @@ -177,29 +261,6 @@ Package names are not guaranteed to be available for production.
return result
}

func latestHOFItems(num int) ui.Element {
submissions := hof.RenderExhibWidget(num)

return ui.Element{
ui.H2("[Hall of Fame](/r/leon/hof)"),
ui.Text(submissions),
}
}

func quoteOfTheBlock() string {
quotes := []string{
"Gno is for Truth.",
"Gno is for Social Coordination.",
"Gno is _not only_ for DeFi.",
"Now, you Gno.",
"Come for the Go, Stay for the Gno.",
}
height := std.ChainHeight()
idx := int(height) % len(quotes)
qotb := quotes[idx]
return qotb
}

func AdminSetOverride(content string) {
Admin.AssertCallerIsOwner()
override = content
Expand Down