Coder Social home page Coder Social logo

Comments (2)

otoyo avatar otoyo commented on July 27, 2024 1

easy-notion-blog では Notion の見出しレベルに +3 した h タグを使用しています。

const tag = `h${level + 3}`

そのため Notion の Heading と h タグの関係は下記のようになります。

Notion easy-notion-blog h tags
Heading 1 h4
Heading 2 h5
Heading 3 h6

この理由は h タグの意味を考慮してのことです。
h1 はページのトップレベルの見出しで、通常はページのタイトルに相当します。

Notion では Heading 1 であっても、Notion Blog ではページ内の1コンテンツ(個別記事ページの本文内の見出しの1つ)に過ぎません。
Heading 1 を都度 h1 としてしまうと、ページのタイトル相当の見出しが複数存在することになってしまいます。

h1 タグの使用については MDN に下記の記載があります。

<h1> はページまたはビューにつき1つだけ使用してください。内容の全体的な目的を簡潔に記載しなければなりません。
複数の <h1> を使用してもエラーにはなりませんが、これは最善の方法とは見なされていません。これは読み上げソフトや SEO で有利です。

ただし考え方によっては色々な捉え方ができると思いますので、お好みでカスタマイズしていただければと思います。

from easy-notion-blog.

herohoro avatar herohoro commented on July 27, 2024

ありがとうございますm(_ _)m

見出し装飾をカスタマイズする際、他のブログの検証画面を拝見したことがありました。
本文の見出しはh2から始めている方が多いことを知り、
h2・h3を本文見出しに。h1は本文タイトルの装飾としてカスタム後、
実際使用してみると「h2とh3だけでは収まらない・・・」といった悩みが続いていました。

notion-blockの記述に+3して調整してくださっていることを知れて、
これからはNotion上でh1からh3まで使用できる = 使いやすい!見やすい!
ということになったんだなということを理解できました⭐

ありがとうございます〜

from easy-notion-blog.

Related Issues (20)

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.