μ λ Prismic.io λ₯Ό CMSλ‘ μ¬μ©νκ³ μμΌλ©° getInitialProps()
μμ μ΄ λ°μ΄ν°λ₯Ό κ°μ Έμ€κ³ μμ΅λλ€. μ½ν
μΈ λ HTMLλ‘ λ―Έλ¦¬ νμμ΄ μ§μ λμ΄ μμΌλ―λ‘ dangerouslySetInnerHTML
μμ΅λλ€.
render()
μ μΆλ ₯μ μλ²μ ν΄λΌμ΄μΈνΈμμ μ€νλ λ λμΌν©λλ€.
μλ²μμ render()
μ μΆλ ₯μ΄ μλͺ»λμμΌλ©° ν΄λΌμ΄μΈνΈμ μΌμΉνμ§ μμ΅λλ€.
μ°¨μ΄μ μ DOM λ Έλκ° μ λλ‘ μ€μ²©λμ§ μμκΈ° λλ¬Έμ μ½ν μΈ κ° μλ²μμ μ μ ν μ€νμΌμ κ°μ§ μλλ€λ κ²μ λλ€.
const htmlFor = (type) => ({__html: this.props[type]})
<Article heading="Devotional" html={true} >
{htmlFor('devotional')}
</Article>
그리κ³
const Article = ({heading, children, date, link, style, html}) => (
<article
className="mv3 mv4-m mv5-l measure"
style={style}
>
<header>
<h1 className="f3 f2-ns mt0 lh-title i garamond bb bw3 b--gold">
{heading}
</h1>
</header>
{ html
? <p className="lh-copy" dangerouslySetInnerHTML={children} />
: <p className="lh-copy" >{children}</p>
}
<footer>
{ date
? <p className="f6 i">{date}</p>
: null
}
{link
? <a href="#" className='link dim mid-gray bb b--gold'>
{link}
</a>
: null
}
</footer>
</article>
)
μ΄ λ°°ν¬ λ° /_src
λ μ¬κΈ°μμ 곡κ°λ©λλ€: https://thefaithnet-ynikfpghwu.now.sh/
@flybayer λ³΄κ³ μ€λ₯κ° λ°μν©λλ€.https://validator.w3.org/nu/?doc=https%3A%2F%2Fthefaithnet-ynikfpghwu.now.sh%2F HTML μ€μ²© p
νκ·Έλ μ ν¨νμ§ μμ΅λλ€. μΈλΆ p
λμ divλ₯Ό μ¬μ©ν΄ λ³Ό μ μμ΅λκΉ?
@impronuncible μ,
μ μ‘μμ΅λλ€. λμμ£Όμ μ μ λ§ κ°μ¬ν©λλ€!
λ€νμ΄λ€!
2016λ
11μ 6μΌ μΌμμΌ μ€μ 11:57 Brandon Bayer [email protected]
μΌλ€:
@impronunciable https://github.com/imronunciable μμ°, κ·Έλ¬κ΅°μ !
μ μ‘μμ΅λλ€. λμμ£Όμ μ μ λ§ κ°μ¬ν©λλ€!
β
λΉμ μ΄ μΈκΈλμκΈ° λλ¬Έμ μ΄κ²μ λ°λ κ²μ λλ€.μ΄ μ΄λ©μΌμ μ§μ λ΅μ₯νκ³ GitHubμμ νμΈνμΈμ.
https://github.com/zeit/next.js/issues/213#issuecomment -258693902 λλ μμκ±°
μ€λ λ
https://github.com/notifications/unsubscribe-auth/AAKHp5EvRuw2GOjOViKL0MjKr0Vrt65sks5q7gbtgaJpZM4KqaPT
.
κ°μ₯ μ μ©ν λκΈ
@flybayer λ³΄κ³ μ€λ₯κ° λ°μν©λλ€.https://validator.w3.org/nu/?doc=https%3A%2F%2Fthefaithnet-ynikfpghwu.now.sh%2F HTML μ€μ²©
p
νκ·Έλ μ ν¨νμ§ μμ΅λλ€. μΈλΆp
λμ divλ₯Ό μ¬μ©ν΄ λ³Ό μ μμ΅λκΉ?