diff --git a/.gitignore b/.gitignore index c6faf97..07d8b98 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ reporting/reporting reporting/output -.idea \ No newline at end of file +.idea +.DS_Store diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..0f2371f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,53 @@ +# Contributing to the Gno Blog + +Thank you for considering a contribution to the Gno Blog. We appreciate all and every open-source contribution to the Gno.land project, as everything we do revolves around open-source. +Below, you will find guidelines on how to submit a blog post to the Gno Blog. + +If you are unsure about something, please don’t hesitate to reach out for help by opening an issue here, on Discord, or directly to the Gno.land DevRel team. +Likewise, if you have an idea on how to improve this guide, go for it as well. + +### What we are looking for +We’re seeking contributions that will bring value to our growing community of gnomes. If you can bring technical expertise or a different perspective to the table, we want to hear from you. Please ensure your article is written in high-quality text and formatted according to the specifications below. We don’t tolerate plagiarism, excessive self-promotion, link spamming, SEO stuffing, or hate speech. + +Below are topics of particular interest to us, but we’re open to all suggestions, so if you have an idea that’s not on the list, but you believe will make great reading, feel free to submit your story. + +- Web3 news and developments and how they impact our community (e.g. legislation, industry trends, technical advances) +- Gno ecosystem news (e.g. interesting new realms/apps, newly-added core functionality, etc.) +- Technical deep dives (e.g. language comparisons, pros and cons, examining the core stack) +- Tutorials and how-to guides +- Useful intros about basic concepts in Gno.land (e.g. package/realm distinction) +- General content that helps explain reasoning or thought processes (e.g. writing the entire stack in Go vs implementing components in Rust) +- Op-ed pieces and alternative views (e.g. building effective governance, decentralizing social media, the importance of censorship-resistant tools) + +### Contribution process + +If you've considered the previous section and would like to contribute to the Gno Blog, here are the steps to follow: +- Write a blog post you'd like to see included to the Gno Blog, while strictly following the [Style Guide](#gno-blog-style-guide). +- Submit a PR using [this template](https://github.com/gnolang/blog/pull/35), while following the structure of the folders & naming, as shown in the example blog post. +- Ping the Gno.land DevRel team, [@waymobetta](https://github.com/waymobetta) and [@leohhhn](https://github.com/leohhhn) for a review. + +After your blog post passes the review process, it will be merged into the `main` branch and shortly after deployed on-chain. + +## Gno Blog Style Guide + +This style guide offers rules and preferences for contributing to the Gno Blog. +Below are some rules to follow when writing a blog post. + +1. All Gno Blog posts are written in standard Markdown. Follow the formatting for headers, links, bold, italic, strikethrough, etc. as you usually would. +2. Check your content for spelling and grammatical mistakes before submitting. +3. Use the Oxford comma. +4. Make sure the target reader is addressed consistently. +5. Make sure the product, company, tech, and other names are accurate. +6. Fact-check your content. +7. If your post contains images, please add a `src` folder to contain them, and link to them in Markdown. +8. Include front-matter in your blog post, detailing the following: + 1. Title + 2. Publication date + 3. Slug + 4. [Tags](#tags) + 5. Authors + +#### Tags +Tags, or [hashtags](https://en.wikipedia.org/wiki/Hashtag), should be lowercase and without spaces; eg, #foobar NOT #FooBar. + +If you're unsure of how to style or format something, take a look at the [example blog post PR](https://github.com/gnolang/blog/pull/35) or review the other [blog posts in this repo](posts) for inspiration; as a last resort, message [@waymobetta](https://github.com/waymobetta) or [@leohhhn](https://github.com/leohhhn) for help within your PR or issue thread. diff --git a/README.md b/README.md index 2f21d41..676bf68 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,10 @@ powered by the [`p/demo/blog` library](https://github.com/gnolang/gno/tree/maste The blog posts are written in markdown format, and include a frontmatter prefix to define metadata. +## Contributing a blog post + +See [CONTRIBUTING.md](./CONTRIBUTING.md). + ## CLI ([`./gnoblog-cli`](./gnoblog-cli)) _See [#1](https://github.com/gnolang/blog/issues/1)_ diff --git a/Test Blog Post b/Test Blog Post deleted file mode 100644 index 76f6775..0000000 --- a/Test Blog Post +++ /dev/null @@ -1 +0,0 @@ -This is a test blog post diff --git a/gnoblog-cli/client.go b/gnoblog-cli/client.go index c3740df..c1d01b8 100644 --- a/gnoblog-cli/client.go +++ b/gnoblog-cli/client.go @@ -6,7 +6,7 @@ import ( "context" "flag" "fmt" - "io/ioutil" + "io" "log" "os" "strings" @@ -96,7 +96,7 @@ func run(args []string) error { } if !opts.Debug { - log.SetOutput(ioutil.Discard) + log.SetOutput(io.Discard) } if err := root.Run(context.Background()); err != nil { diff --git a/gnoblog-cli/post.go b/gnoblog-cli/post.go index 721954b..4b0dda3 100644 --- a/gnoblog-cli/post.go +++ b/gnoblog-cli/post.go @@ -3,6 +3,7 @@ package main import ( "fmt" "io" + "strings" "time" "github.com/adrg/frontmatter" @@ -24,6 +25,18 @@ func parsePost(reader io.Reader) (*post, error) { return nil, fmt.Errorf("invalid post: %w", err) } p.Body = string(rest) + p.Tags = removeWhitespace(p.Tags) return &p, nil } + +// removeWhitespace loops over a slice of tags (strings) and truncates each tag +// by removing whitespace +// ie, []string{"example spaced tag"} -> []string{"examplespacedtag"} +func removeWhitespace(tags []string) []string { + for index, tag := range tags { + tags[index] = strings.Replace(tag, " ", "", -1) + } + + return tags +} diff --git a/posts/2023-09-29_gnomobile/README.md b/posts/2023-09-29_gnomobile/README.md index b6aa4f6..a34b60e 100644 --- a/posts/2023-09-29_gnomobile/README.md +++ b/posts/2023-09-29_gnomobile/README.md @@ -21,9 +21,8 @@ Simply put, GnoMobile is a framework for developing Gno mobile applications. Thi For communication between the mobile app and the Gno code, GnoMobile uses [gRPC](https://grpc.io/), a well-supported framework that sends and receives Google Protobuf messages. Even though the core Gno code is written in Go, the app code can use React Native, Java, Swift, etc. The following system diagram shows how gRPC is used.