Skip to content

Commit

Permalink
refactor: tags as enum
Browse files Browse the repository at this point in the history
  • Loading branch information
barrenechea committed May 31, 2024
1 parent 0741e6b commit 807656a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
22 changes: 21 additions & 1 deletion src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,27 @@ const postsSchema = blogBaseSchema.extend({
});
const projectsSchema = blogBaseSchema.extend({
link: z.string().optional(),
tags: z.array(z.string()),
tags: z.array(
z.enum([
'CSharp',
'DotNet6',
'Xcode',
'Containers',
'Architecture',
'Pipelines',
'TailwindCSS',
'TypeScript',
'WebScraping',
'Blog',
'JavaScript',
'AstroJS',
'React',
'ReverseEngineering',
'Hardware',
'Android',
'Embedded',
])
),
});

const postsCollection = defineCollection({
Expand Down
2 changes: 1 addition & 1 deletion src/content/projects/ru/textual.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ link: https://github.com/barrenechea/Textual
img: ~/assets/images/project-textual.svg
imgAlt: Логотип приложения Textual
tags:
- Пайплайны
- Pipelines
- Xcode
translatedBy: gpt-4-1106-preview
checksum: e6a75557647c0a08034a8711aa498f98840360f35ea417b5421e3e5baa533c37
Expand Down
1 change: 1 addition & 0 deletions src/i18n/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const es = {
'tags.Blog': 'Blog',
'tags.JavaScript': 'JavaScript',
'tags.AstroJS': 'Astro.js',
'tags.React': 'React',
'tags.ReverseEngineering': 'Ingeniería Inversa',
'tags.Hardware': 'Hardware',
'tags.Android': 'Android',
Expand Down
3 changes: 2 additions & 1 deletion src/partials/RecentProjects.astro
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ const tagColors = {
Containers: 'ROSE',
Architecture: 'ORANGE',
Pipelines: 'LIME',
TailwindCSS: 'SKY',
TailwindCSS: 'TEAL',
TypeScript: 'BLUE',
WebScraping: 'VIOLET',
Blog: 'EMERALD',
JavaScript: 'YELLOW',
AstroJS: 'INDIGO',
React: 'SKY',
ReverseEngineering: 'STONE',
Hardware: 'AMBER',
Android: 'EMERALD',
Expand Down

0 comments on commit 807656a

Please sign in to comment.