GithubHelp home page GithubHelp logo

xionwcfm / devxion-blog Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 4.43 MB

fullpage 기능을 직접 구현한 블로그입니다. 현재는 유지보수하고 있지 않습니다

Home Page: https://devxion-blog.vercel.app

CSS 0.95% TypeScript 75.40% JavaScript 2.81% MDX 20.76% Shell 0.09%
blog contentlayer fullpage nextjs tailwindcss typescript

devxion-blog's Introduction

devxion blog

😁 blog 바로 방문해보기!

next.js 13의 app dir을 이용하여 만든 개인 블로그입니다.

배포는 vercel을 이용했으며

실제 포스트는 contentlayer 라이브러리를 이용해

mdx로 작성한 포스트 글을 보여주는 형태로 구현했습니다.

로컬 환경에서는

clone 후 로컬에서 실행을 할 수 있습니다.

프로젝트는 패키지매니저 npm을 이용하여 만들어져있습니다.

git clone https://github.com/XionWCFM/devxion-blog.git
npm i
npm run dev

를 통해 실행해볼 수 있습니다.

npm run cl

추가해둔 스크립트를 통하여 contentlayer build를 간편하게 진행할 수 있습니다.


사용된 폰트

import { Noto_Sans_KR } from 'next/font/google';

const notosanskr = Noto_Sans_KR({
  weight: '400',
  subsets: ['latin'],
  display: 'swap',
});

next/font에서 제공해주는 기능을 통하여

Noto_Sans_KR을 사용했습니다.

font를 외부에서 그때그때 로드하는 방식은 로드 과정에서 layout shift가 발생할 수 있습니다.

next.js는 이렇듯 폰트로인한 layout shift를 최소화하는 방안으로

빌드타임에 미리 로컬에 폰트를 저장해두는 기능을 지원합니다.

이러한 방식으로 구현하는 경우 로컬에서 바로 폰트를 가져올 수 있기 때문에

layout shift가 최소화되는 장점을 얻을 수 있습니다.


google-search-console 등록방법

  verification: {
    google: '9NnnQfV-i-vmJVWpSMD99dmCxRKDwljQMqr5CQGUmN8',
  },

기존 head 태그내부에 작성하던 방식에서

metadata 객체를 이용한 방식으로 큰 변화가 있었습니다.

하지만 이에 대한 레퍼런스를 찾기가 어려운 부분도 컸습니다.

대부분 Head 태그를 이용한 방식으로 구현이 되어있었고

Next.js 공식문서에서도 자세한 레퍼런스가 존재하지 않은 상태였습니다.

혹시 힌트가 있을까 싶어

next.js에서 제공하는 MetaData 태그의 타입 정의 부분을 찾아보기로 했습니다.

twitter?: null | Twitter;
    /**
     * The common verification tokens for the document.
     * @example
     * ```tsx
     * { verification: { google: "1234567890", yandex: "1234567890", "me": "1234567890" } }
     * <meta name="google-site-verification" content="1234567890" />
     * <meta name="yandex-verification" content="1234567890" />
     * <meta name="me" content="@me" />
     * ```
     */
    verification?: Verification;
    /**
     * The Apple web app metadata for the document.
     *
     * @see https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html
     * @example
     * ```tsx
     * { capable: true, title: "My Website", statusBarStyle: "black-translucent" }
     * <meta name="apple-mobile-web-app-capable" content="yes" />
     * <meta name="apple-mobile-web-app-title" content="My Website" />
     * <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
     * ```
     *
     */

주석 처리 된 부분을 자세히 읽어보면

verification key에 google 프로퍼티를 전달하면

google-search-console에서 요구하는 대로

name이 google-site-verification인 meta 태그에 값을 전달해줄 수 있다는 것을 알 수 있습니다.


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.