Skip to content

Commit

Permalink
rename blog to writer.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ezzabuzaid committed Nov 13, 2023
1 parent ce0e58b commit b8e0192
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# TechText 📄
# Writer.sh 📄

Original fork - [astro-paper](https://github.com/satnaing/astro-paper)
2 changes: 1 addition & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { remarkReadingTime } from "./remark-reading-time.mjs";

// https://astro.build/config
export default defineConfig({
site: "https://techtext.dev/",
site: "https://writer.sh/",
integrations: [
prefetch(),
expressiveCode(),
Expand Down
12 changes: 6 additions & 6 deletions opensearch.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>TechText</ShortName>
<LongName>TechText: The developer home</LongName>
<Description>Search for articles on TechText</Description>
<Image height="16" width="16" type="image/svg+xml">https://techtext.dev/favicon.svg</Image>
<Url type="text/html" template="https://techtext.dev/search/?q={searchTerms}"/>
<ShortName>Writer.sh</ShortName>
<LongName>Writer.sh: The developer home</LongName>
<Description>Search for articles on Writer.sh</Description>
<Image height="16" width="16" type="image/svg+xml">https://writer.sh/favicon.svg</Image>
<Url type="text/html" template="https://writer.sh/search/?q={searchTerms}"/>
<Contact>ezzabuzaid@hotmail.com</Contact>
<Query role="example" searchTerms="Build TypeAhead Using RxJS" />
<Developer>ezzabuzaid</Developer>
<Attribution>Powered by TechText</Attribution>
<Attribution>Powered by Writer.sh</Attribution>
<SyndicationRight>open</SyndicationRight>
<AdultContent>false</AdultContent>
</OpenSearchDescription>
2 changes: 1 addition & 1 deletion public/CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
techtext.dev
writer.sh
2 changes: 1 addition & 1 deletion public/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const activeNav = Astro.url.pathname.split("/")[1];
</a>
<a
target="_blank"
href="https://feeds.feedburner.com/techtextdev"
href="https://feeds.feedburner.com/writersh"
aria-label="rss feed"
title="RSS Feed"
>
Expand Down
4 changes: 2 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Site, SocialObjects } from "./types";

export const SITE: Site = {
website: "https://techtext.dev/",
website: "https://writer.sh/",
author: "Ezzabuzaid",
desc: "I'm Senior Software Engineer and a Technical Writer with a keen interest in merging technology and communication. Passionate about software development and committed to reading and lifelong learning.",
title: "Writer.sh - Software Engineering Blog",
Expand Down Expand Up @@ -44,7 +44,7 @@ export const SOCIALS: SocialObjects = [
// },
{
name: "RSSFeed",
href: "https://feeds.feedburner.com/techtextdev",
href: "https://feeds.feedburner.com/writersh",
linkTitle: `Subscribe to my RSS Feed`,
active: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,54 @@ Symbols let the type checker look up names and then check their declarations to

## Diagnostic

Diagnostics in TypeScript are objects that represent issues the compiler has identified in the code. These issues can range from syntax errors and type mismatches to more subtle semantic issues that might not be immediately apparent.

Here's a simple example of how you might encounter a diagnostic in TypeScript:

```ts
let greeting: string = 42;
```

The TypeScript compiler will generate a diagnostic message for the above code, indicating that the type 'number' is not assignable to the type 'string'.

---

When the TypeScript compiler runs, it performs several checks on the code. If it encounters something that doesn't align with the language rules or the project's configuration, it creates a diagnostic object. Each diagnostic object contains information about the nature of the problem, including:

- The file in which the issue was found.
- The start and end position of the relevant code.
- A message describing the issue.
- A diagnostic category (error, warning, suggestion, or message).
- A code that uniquely identifies the type of diagnostic.

You can access diagnostics programmatically using the TypeScript Compiler API. Here's a snippet that demonstrates how to retrieve and log all diagnostics for a given TypeScript program:

```ts
const emitResult = program.emit();

// Retrieve and concatenate all diagnostics
const allDiagnostics = ts
.getPreEmitDiagnostics(program)
.concat(emitResult.diagnostics);

// Iterate over diagnostics and log them
allDiagnostics.forEach(diagnostic => {
if (diagnostic.file) {
let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(
diagnostic.start!
);
let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
console.log(
`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`
);
} else {
console.log(ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"));
}
});
```

Diagnostics are not just for the compiler; they are also used by IDEs and editors to provide real-time feedback to developers. For example, when you see red squiggly lines under code in Visual Studio Code, that's the editor using TypeScript diagnostics to indicate an issue.

## Printer

```ts
Expand Down Expand Up @@ -896,7 +944,7 @@ While Binding and Type Checking are distinct processes, they are interdependent.

Using [ESLint](https://eslint.org/) is a better option if you want to enforce rules on your codebase due to the fact that it's specifically built for that purpose. However, if you want to build a tool that does something more complex, then the Typescript Compiler API is the way to go.

[I have wrote a guide for you](https://techtext.dev/posts/gentle-introduction-to-eslint-rules) to learn more.
[I have wrote a guide for you](https://writer.sh/posts/gentle-introduction-to-eslint-rules) to learn more.

## Conclusion

Expand Down
4 changes: 2 additions & 2 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const socialImageURL = new URL(ogImage, Astro.url.origin).href;
<link
rel="search"
type="application/opensearchdescription+xml"
title="TechText"
title="writer.sh"
href="/opensearch.xml"
/>

Expand All @@ -65,7 +65,7 @@ const socialImageURL = new URL(ogImage, Astro.url.origin).href;
<!-- Plausible Analytics -->
<script
defer
data-domain="techtext.dev"
data-domain="writer.sh"
src="https://plausible.io/js/script.js"></script>

<script>
Expand Down
1 change: 1 addition & 0 deletions src/pages/posts/[slug].astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
import PostDetails from "@layouts/PostDetails.astro";
import Posts from "@layouts/Posts.astro";
import getSortedPosts from "@utils/getSortedPosts";
import { type CollectionEntry } from "astro:content";
import { getPublishedPosts } from "../../utils/getPosts";
Expand Down

0 comments on commit b8e0192

Please sign in to comment.