diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8f916ab..1ead656 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,11 +3,9 @@ name: Code Quality and Formatting Check on: push: branches: - - main - staging pull_request: branches: - - main - staging jobs: diff --git a/_posts/smswithoutborders-telemetry-dashboard.md b/_posts/smswithoutborders-telemetry-dashboard.md index c815de4..3783c5d 100644 --- a/_posts/smswithoutborders-telemetry-dashboard.md +++ b/_posts/smswithoutborders-telemetry-dashboard.md @@ -8,6 +8,7 @@ author: picture: "/anon-avatar.jpeg" ogImage: url: "/icon.png" +draft: true --- At SMSwithoutBorders, we're constantly striving to enhance your secure messaging experience. To accomplish this, we rely on data to comprehend how users interact with our tools. Here's where the SMSwithoutBorders Telemetry Dashboard comes in! diff --git a/_releases/metrics-0-1-0.md b/_releases/metrics-0-1-0.md index 17cb8c1..4be6019 100644 --- a/_releases/metrics-0-1-0.md +++ b/_releases/metrics-0-1-0.md @@ -12,6 +12,13 @@ ogImage: We are excited to announce the release of SMSWithoutBorders Metrics 0.1.0, now available in alpha release! You can access it from the [telemetry page](https://telemetry.smswithoutborders.com). +### **Changelog** + +**Added** + +- Visuals for reliable and resilient gateway clients. +- Visuals for gateway client reliability tests. + ### **Contributors** A big thank you to the following contributors for their valuable contributions to this release: @@ -22,10 +29,3 @@ A big thank you to the following contributors for their valuable contributions t ### **Feedback** Your feedback is crucial to us! If you encounter any bugs or have suggestions on how we can improve this release, please [let us know](mailto:support@smswithoutborders.com). - -### **Changelog** - -**Added** - -- Visuals for reliable and resilient gateway clients. -- Visuals for gateway client reliability tests. diff --git a/docker-compose.yml b/docker-compose.yml index fdfb017..bd20bf6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,8 +13,6 @@ services: - ${PORT:-80}:80 - ${SSL_PORT:-443}:443 environment: - - PORT=${PORT:-80} - - SSL_PORT=${SSL_PORT:-443} - SERVER_NAME=${SERVER_NAME:-localhost} volumes: - ${SSL_CERTIFICATE_PATH:?err}:/etc/nginx/ssl/cert.pem diff --git a/package.json b/package.json index 00e2484..bce8361 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "dev": "next", "build": "next build", "start": "next start", - "prepare": "husky install" + "prepare": "husky" }, "dependencies": { "classnames": "^2.5.1", diff --git a/src/lib/api.ts b/src/lib/api.ts index 76b6813..796be6b 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -6,8 +6,8 @@ import { join } from "path"; const postsDirectory = join(process.cwd(), "_posts"); const releasesDirectory = join(process.cwd(), "_releases"); -export function getPostSlugs() { - return fs.readdirSync(postsDirectory); +export function getSlugs(directory: fs.PathLike) { + return fs.readdirSync(directory); } export function getPostBySlug(slug: string) { @@ -16,6 +16,10 @@ export function getPostBySlug(slug: string) { const fileContents = fs.readFileSync(fullPath, "utf8"); const { data, content } = matter(fileContents); + if (data.draft === true) { + return null; + } + return { ...data, slug: realSlug, content } as Post; } @@ -25,31 +29,28 @@ export function getReleaseBySlug(slug: string) { const fileContents = fs.readFileSync(fullPath, "utf8"); const { data, content } = matter(fileContents); - return { ...data, slug: realSlug, content } as Post; -} - -export function getReleaseSlugs() { - if (!fs.existsSync(releasesDirectory)) { - console.error(`Directory ${releasesDirectory} does not exist.`); - return []; + if (data.draft === true) { + return null; } - return fs.readdirSync(releasesDirectory); + + return { ...data, slug: realSlug, content } as Post; } export function getAllPosts(): Post[] { - const slugs = getPostSlugs(); + const slugs = getSlugs(postsDirectory); const posts = slugs .map((slug) => getPostBySlug(slug)) - // sort posts by date in descending order + .filter((post): post is Post => post !== null) .sort((post1, post2) => (post1.date > post2.date ? -1 : 1)); return posts; } export function getAllReleases(): Post[] { - const slugs = getReleaseSlugs(); + const slugs = getSlugs(releasesDirectory); const releases = slugs .map((slug) => getReleaseBySlug(slug)) - .sort((post1, post2) => (post1.date > post2.date ? -1 : 1)); + .filter((release): release is Post => release !== null) + .sort((release1, release2) => (release1.date > release2.date ? -1 : 1)); return releases; }