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

feat: newsletter page #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
15 changes: 15 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func main() {
app.Router.Handle("/events", handlerEvents(app))
app.Router.Handle("/gnolang", handlerLanguage(app))
app.Router.Handle("/ecosystem", handlerEcosystem(app))
app.Router.Handle("/newsletter", handlerNewsletter(app))
app.Router.Handle("/r/{path:.*}", handlerRedirect(app))
app.Router.Handle("/p/{path:.*}", handlerRedirect(app))
app.Router.Handle("/static/{path:.+}", handlerStaticFile(app))
Expand Down Expand Up @@ -115,6 +116,20 @@ func handlerLanguage(app gotuna.App) http.Handler {
})
}

func handlerNewsletter(app gotuna.App) http.Handler {
md := filepath.Join(flags.pagesDir, "NEWSLETTER.md")
mainContent := osm.MustReadFile(md)

return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
app.NewTemplatingEngine().
Set("Title", "Sign up for Gno News to get regular engineering and community updates").
Set("Description", "Sign up for the Gno.land newsletter to learn more about our mainnet progress, proof of contribution, smart contracts and rewarding open source software.").
Set("Flags", flags).
Set("MainContent", string(mainContent)).
Render(w, r, "generic.html", "funcs.html")
})
}

func handlerEcosystem(app gotuna.App) http.Handler {
md := filepath.Join(flags.pagesDir, "ECOSYSTEM.md")
mainContent := osm.MustReadFile(md)
Expand Down
26 changes: 26 additions & 0 deletions pages/NEWSLETTER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Welcome Gnomes!

<div class="columns-1">
<div class="column">
<!-- mailchimp -->
<div id="mc_embed_signup" class="stack stack--center">
<form action="https://land.us18.list-manage.com/subscribe/post?u=8befe3303cf82796d2c1a1aff&amp;id=5499ca154b&amp;f_id=008d70e7f0" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_self">
<label for="mce-EMAIL">Sign up for Gno News to get regular engineering and community updates</label>
<div id="mc_embed_signup_scroll">
<div class="mc-field-group">
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" placeholder="Type your email here" required>
<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button">
</div>
<div hidden="true"><input type="hidden" name="tags" value="2525514"></div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div>
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_8befe3303cf82796d2c1a1aff_5499ca154b" tabindex="-1" value=""></div>
</div>
</form>
</div>
<!-- /mailchimp -->
</div>
</div>
2 changes: 1 addition & 1 deletion static/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ code {
.stack > p {
flex-direction: row;
}
.stack *:not(:first-child) {
.stack > *:not(:first-child) {
margin-left: 3.75rem;
}
.stack > a,
Expand Down
Loading