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

Code quality improvements and updated README #29

Merged
merged 4 commits into from
Oct 21, 2023
Merged
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
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
# Mercurius
Community Newsletter Initiative
*A Community Newsletter Initiative developed and maintained by OSDC*

## Setting up locally 🚀

- Install hugo on your system (steps vary with different OS). For convenience, refer this [link](https://gohugo.io/installation/).
- Download and install NodeJs from [here](https://nodejs.org/en/download)
- Fork and clone the project and follow these steps
- `cd Mercurius && npm i` to install npm based dependencies.
- `hugo serve` to start the local development server (localhost/port details will be available in console).
- To send out mail notifications, update email list from `scripts/mail-scripts/emails.json` followed by `cd scripts/mail-scripts && go run main.go` (though the email list and credentials needed to authenticate this operation will be confidential to maintainers only).
- Email template for the mail to be sent is written in HTML format and is super-easy to edit. You can contribute changes to it from `scripts/mail-scripts/email_body.html`,

## Blog Submissions 📖

- Head to `content/post`
- Write the blog that you wish to publish in a md file and save it this folder.
- Be sure to include the header at the start of you blog's md (check `content/post/Example1.md`for more).
- Create a PR and notify the maintainers if your blog doesn't get published within a week.
6 changes: 3 additions & 3 deletions content/post/Example1.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: "Example"
date: 2021-04-15T16:26:49+05:30
title: "Mercurius ;>"
date: 2023-10-21T14:00:00+05:30
---



Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Mercurius test drive fellas, let's see how soon can we get it done!!!
17 changes: 17 additions & 0 deletions scripts/mail-scripts/email_body.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mercurius</title>
</head>
<body>
<h1>Ahoy OSDC CT!</h1>
<p>~~Sample Content of the mail to be sent~~</p>
<p>This mail marks the completion of back-end code. Feel free to customize this mail and
the mercurius website itself from <a href="https://github.com/osdc/Mercurius">github</a> with
your own content CT, way to go!!!</p>
<p>Check out the <a href="https://mercurius.netlify.app/">website</a> for mercurius.</p>
<p>Best regards,<br>OSDC</p>
</body>
</html>
10 changes: 8 additions & 2 deletions scripts/mail-scripts/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,18 @@ func send(body string, to []string) {
panic(err)
}

bodyContent, err := ioutil.ReadFile("email_body.html")
if err != nil {
log.Fatal(err)
}

m := gomail.NewMessage()
for _, r := range to {
fmt.Printf("Sending email to: %s\n", r)
m.SetHeader("From", from)
m.SetAddressHeader("To", r, r)
m.SetHeader("Subject", "Newsletter Test")
m.SetBody("text/html", body)
m.SetHeader("Subject", "Mercurius Test")
m.SetBody("text/html", string(bodyContent))

if err := gomail.Send(s, m); err != nil {
log.Printf("Could not send email to %q: %v", r, err)
Expand Down
5 changes: 4 additions & 1 deletion themes/drizzle/layouts/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{{ define "main" }}
<div class="py-10">
<div class="text-center font-black mx-2 text-4xl text-transparent bg-clip-text bg-gradient-to-r from-purple-500 to-green-500">
An OSDC Newsletter here, //probably in a cool font? And then hopefully a second line.
Open Source Developers Community (OSDC)
</div>
<div class="text-2xl italic flex items-center flex-col my-4 mb-12">
May the source be with you ^-^
</div>
</div>
<div class="flex items-center flex-col my-4 mb-12">
Expand Down
Loading