diff --git a/tools/checkdocs/checkdocs.go b/tools/checkdocs/checkdocs.go index e09c052dcfe0..200c0532abc0 100644 --- a/tools/checkdocs/checkdocs.go +++ b/tools/checkdocs/checkdocs.go @@ -45,12 +45,13 @@ func checkFiles(files []string, logf, fatalf func(string, ...any)) { var failed bool for _, file := range files { - b, err := os.ReadFile(file) + fileInBytes, err := os.ReadFile(file) if err != nil { fatalf("Couldn't read file %s: %s", file, err) } - if b, err = extractFrontMatter(b); err != nil { + b, err := extractFrontMatter(fileInBytes) + if err != nil { fatalf("Couldn't extract front matter from %s: %s", file, err) } @@ -68,6 +69,11 @@ func checkFiles(files []string, logf, fatalf func(string, ...any)) { logf("%q: %s", file, err) failed = true } + + if err = verifyTruncateString(fileInBytes); err != nil { + logf("%q: %s", file, err) + failed = true + } } if failed { @@ -75,6 +81,15 @@ func checkFiles(files []string, logf, fatalf func(string, ...any)) { } } +// verifyTruncateString checks that the truncate string is present. +func verifyTruncateString(b []byte) error { + if !bytes.Contains(b, []byte("")) { + return fmt.Errorf(" must be included to have \"Read more\" link on the homepage") + } + + return nil +} + // extractFrontMatter returns the front matter of a blog post. func extractFrontMatter(fm []byte) ([]byte, error) { var in bool diff --git a/tools/checkdocs/checkdocs_test.go b/tools/checkdocs/checkdocs_test.go index 0e5d8fcf23e7..274cfefd540a 100644 --- a/tools/checkdocs/checkdocs_test.go +++ b/tools/checkdocs/checkdocs_test.go @@ -62,3 +62,8 @@ func TestVerifyTags(t *testing.T) { err := verifyTags(fm) assert.EqualError(t, err, `tag "documents databases" is not in the allowed list`) } + +func TestVerifyTruncateString(t *testing.T) { + err := verifyTruncateString(fm) + assert.EqualError(t, err, " must be included to have \"Read more\" link on the homepage") +} diff --git a/website/blog/2024-01-08-new-ferretdb-v118-support-oplog-functionality.md b/website/blog/2024-01-08-new-ferretdb-v118-support-oplog-functionality.md index e5ed4859d786..7c0cf35a5de3 100644 --- a/website/blog/2024-01-08-new-ferretdb-v118-support-oplog-functionality.md +++ b/website/blog/2024-01-08-new-ferretdb-v118-support-oplog-functionality.md @@ -13,6 +13,8 @@ tags: [release] We are starting the new year with a major feature addition! The latest version of FerretDB v1.18.0 has just been released with support for basic OpLog functionality, along with other exciting features. + + OpLog (operations log) functionality has been one of our most requested features, and it would make it possible for developers to build real-time applications using the Meteor framework. We made this a priority in the last quarter and are super excited that it's now available. We can't wait to see what you build with FerretDB!