Skip to content

Commit

Permalink
chore: Remove old /about endpoint / Sanity schema
Browse files Browse the repository at this point in the history
  • Loading branch information
kiosion committed Jan 17, 2024
1 parent 30fb8f2 commit f3f4913
Show file tree
Hide file tree
Showing 20 changed files with 49 additions and 306 deletions.
3 changes: 1 addition & 2 deletions elixir-api/lib/routes/api/v1.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ defmodule Router.Api.V1 do
"/project" => Router.Api.V1.Project,
"/projects" => Router.Api.V1.Projects,
"/tag" => Router.Api.V1.Tag,
"/tags" => Router.Api.V1.Tags,
"/about" => Router.Api.V1.About
"/tags" => Router.Api.V1.Tags
}

for {path, handler} <- @routes do
Expand Down
85 changes: 0 additions & 85 deletions elixir-api/lib/routes/api/v1/about.ex

This file was deleted.

9 changes: 0 additions & 9 deletions elixir-api/lib/routes/api/v1/post.ex
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@ defmodule Router.Api.V1.Post do
"_type",
"title",
"views",
%{
"'author'" => [
["'_id'", ["author", "_id", :follow]],
["'_type'", ["author", "_type", :follow]],
["'name'", ["author", "name", :follow]],
["'slug'", ["author", "slug", :follow]],
["'image'", ["author", "image", :follow]]
]
},
%{
"tags[]" => [
"_id",
Expand Down
9 changes: 0 additions & 9 deletions elixir-api/lib/routes/api/v1/posts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,6 @@ defmodule Router.Api.V1.Posts do
"_type",
"title",
"views",
%{
"'author'" => [
["'_id'", ["author", "_id", :follow]],
["'_type'", ["author", "_type", :follow]],
["'name'", ["author", "name", :follow]],
["'slug'", ["author", "slug", :follow]],
["'image'", ["author", "image", :follow]]
]
},
%{
"tags[]" => [
"_id",
Expand Down
9 changes: 0 additions & 9 deletions elixir-api/lib/routes/api/v1/project.ex
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@ defmodule Router.Api.V1.Project do
"_id",
"_type",
"_rev",
%{
"'author'" => [
["'_id'", ["author", "_id", :follow]],
["'_type'", ["author", "_type", :follow]],
["'name'", ["author", "name", :follow]],
["'slug'", ["author", "slug", :follow]],
["'image'", ["author", "image", :follow]]
]
},
"views",
"body",
"desc",
Expand Down
9 changes: 0 additions & 9 deletions elixir-api/lib/routes/api/v1/projects.ex
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,6 @@ defmodule Router.Api.V1.Projects do
"_id",
"_type",
"_rev",
%{
"'author'" => [
["'_id'", ["author", "_id", :follow]],
["'_type'", ["author", "_type", :follow]],
["'name'", ["author", "name", :follow]],
["'slug'", ["author", "slug", :follow]],
["'image'", ["author", "image", :follow]]
]
},
"body",
"desc",
"date",
Expand Down
9 changes: 0 additions & 9 deletions elixir-api/lib/routes/api/v1/tag.ex
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,6 @@ defmodule Router.Api.V1.Tag do
"_type",
"title",
"publishedAt",
%{
"'author'" => [
["'_id'", ["author", "_id", :follow]],
["'_type'", ["author", "_type", :follow]],
["'name'", ["author", "name", :follow]],
["'slug'", ["author", "slug", :follow]],
["'image'", ["author", "image", :follow]]
]
},
%{
"tags[]" => [
"_id",
Expand Down
2 changes: 0 additions & 2 deletions sanity-cms/sanity.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ export default defineConfig({
return `${baseUrl}/blog/${slug.current}`;
case 'project':
return `${baseUrl}/work/${slug.current}`;
case 'author':
return `${baseUrl}/`;
}
return prev;
}
Expand Down
Empty file removed sanity-cms/schemas/artwork.ts
Empty file.
96 changes: 0 additions & 96 deletions sanity-cms/schemas/author.ts

This file was deleted.

8 changes: 1 addition & 7 deletions sanity-cms/schemas/base-document.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Body from './objects/body';
import Body from '$objects/body';
import type { Rule } from 'sanity';

export default [
Expand Down Expand Up @@ -38,12 +38,6 @@ export default [
type: 'number',
initialValue: () => 0
},
{
name: 'author',
title: 'Author',
type: 'reference',
to: { type: 'author' }
},
Body,
{
name: 'tags',
Expand Down
10 changes: 5 additions & 5 deletions sanity-cms/schemas/objects/body.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import HightlightRenderer from '../renderers/highlight';
import NoTranslateRenderer from '../renderers/notranslate';
import FootnoteRenderer from '../renderers/footnote';
import LinkRenderer from '../renderers/link';
import Code from '../fields/code';
import HightlightRenderer from '$renderers/highlight';
import NoTranslateRenderer from '$renderers/notranslate';
import FootnoteRenderer from '$renderers/footnote';
import LinkRenderer from '$renderers/link';
import Code from '$fields/code';

import { BsLink45Deg } from 'react-icons/bs';
import { BiHighlight, BiNote } from 'react-icons/bi';
Expand Down
2 changes: 1 addition & 1 deletion sanity-cms/schemas/post.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import BaseDocument from './base-document';
import BaseDocument from '$schema/base-document';
import type { PreviewConfig, PreviewValue } from 'sanity';

export default {
Expand Down
10 changes: 2 additions & 8 deletions sanity-cms/schemas/project.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
import BaseDocument from './base-document';
import BaseDocument from '$schema/base-document';
import type { PreviewConfig, Rule, PreviewValue } from 'sanity';

export default {
name: 'project',
title: 'Projects',
type: 'document',
fields: [
...BaseDocument.filter((field) => field.name !== 'author'),
{
name: 'author',
title: 'Author',
type: 'reference',
to: { type: 'author' }
},
...BaseDocument,
{
name: 'images',
title: 'Project Images',
Expand Down
23 changes: 7 additions & 16 deletions sanity-cms/schemas/schema.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
import divider from './objects/divider';
import header from './objects/header';
import divider from '$objects/divider';
import header from '$objects/header';

import author from './author';
import post from './post';
import project from './project';
import tag from './tag';
import siteSettings from './settings';
import post from '$schema/post';
import project from '$schema/project';
import tag from '$schema/tag';
import siteSettings from '$schema/settings';

export const schemaTypes = [
author,
divider,
header,
post,
project,
tag,
siteSettings
];
export const schemaTypes = [divider, header, post, project, tag, siteSettings];
Loading

0 comments on commit f3f4913

Please sign in to comment.