Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: quick start without pregeneration #34

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ https://map.ekaterinburg.design/api/map

## Development

1. Add `.env.local` with Notion keys
```sh
NOTION_TOKEN=
NOTION_DATABASE=
```

2. Install [Node.js](https://nodejs.org/en/download/) and [pnpm](https://www.npmjs.com/package/pnpm#user-content-install)

3. Install dependencies
Expand Down
9 changes: 0 additions & 9 deletions build-scripts/prepare-static/constants.js

This file was deleted.

83 changes: 0 additions & 83 deletions build-scripts/prepare-static/getNotionData.js

This file was deleted.

126 changes: 0 additions & 126 deletions build-scripts/prepare-static/index.js

This file was deleted.

38 changes: 0 additions & 38 deletions build-scripts/prepare-static/prepareImages.js

This file was deleted.

21 changes: 0 additions & 21 deletions build-scripts/prepare-static/typographText.js

This file was deleted.

9 changes: 0 additions & 9 deletions build-scripts/prepare-static/utils.js

This file was deleted.

2 changes: 1 addition & 1 deletion components/Map/Marker/Marker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function Placemark({

if (preview) {
return `<img
src="${preview}"
src="https://map.ekaterinburg.design${preview}"
class="${className}"
style="${style}"
alt="${name}"
Expand Down
8 changes: 4 additions & 4 deletions components/Map/Popup/PopupContent.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @next/next/no-img-element */
import React from 'react';
import classNames from 'classnames';
import Image from 'next/image';
import { useCopyHref } from 'components/helpers/useCopyHref';
import { MapItem } from 'common/types/map-item';
import styles from './Popup.module.css';
Expand Down Expand Up @@ -45,10 +45,10 @@ export function PopupContent({ placemark }: Props) {
</div>
<div className={styles.popup__images}>
{placemark.images.map((src) => (
<a href={src.m.src} target="_blank" rel="noreferrer">
<Image
<a href={`https://map.ekaterinburg.design/${src.m.src}`} target="_blank" rel="noreferrer">
<img
key={src.id}
src={src.m.src}
src={`https://map.ekaterinburg.design/${src.m.src}`}
width={src.m.width}
height={src.m.height}
className={styles.popup__image}
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"preload-static": "node ./build-scripts/prepare-static/index.js",
"lint": "next lint",
"postinstall": "pnpm preload-static",
"devPreinstall": "husky install"
},
"dependencies": {
Expand Down
13 changes: 5 additions & 8 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/* eslint-disable @next/next/no-title-in-document-head */
import React from 'react';
import {
Html,
Head,
Main,
NextScript,
Html, Head, Main, NextScript,
} from 'next/document';

export default function Document() {
Expand Down Expand Up @@ -40,18 +37,18 @@ export default function Document() {

<link rel="dns-prefetch" href="https://mc.yandex.ru/" />
<link rel="dns-prefetch" href="https://tile.osmand.net/" />
<meta name="yandex-verification" content="94c725a9e4228358" />
<meta name="facebook-domain-verification" content="l85smr2ck81ubuv1qof1bylyds521p" />
{/* <meta name="yandex-verification" content="94c725a9e4228358" />
<meta name="facebook-domain-verification" content="l85smr2ck81ubuv1qof1bylyds521p" /> */}
</Head>
<body>
<Main />
<NextScript />
<div
{/* <div
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
__html: '<script>(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");ym(57112834, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true });</script><noscript><div><img src="https://mc.yandex.ru/watch/57112834" style="position:absolute; left:-9999px;" alt="" /></div></noscript>',
}}
/>
/> */}
</body>
</Html>
);
Expand Down
3 changes: 1 addition & 2 deletions pages/api/map.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { NextApiRequest, NextApiResponse } from 'next';
import placemarks from 'public/notion-static/placemarks.json';

export default function handler(_: NextApiRequest, res: NextApiResponse) {
res.status(200).json(placemarks);
res.status(200).json({ hello: 'world' });
}
Loading