php 13๊ฐ~20๊ฐ
https://github.com/manyrice/php_ssg_2021
(SSG์ ์๋ฏธ : Static Site Generator)
- ๋ธ๋ก๊ทธ ๋ฆฌํฌ์งํฐ๋ฆฌ ์์ฑํ๋ ๋ฐฉ๋ฒ
๋ธ๋ก๊ทธ ํด๋ ์์ฑ
ํด๋ ์์์ command์ฐฝ ์ด๊ธฐ
git init
git config.name ""
git config.email ""
git remote add origin ์ฃผ์
code .
'docs'๋ผ๋ ํด๋ ์์ฑ (github์์๋ docsํด๋ ์์ ๋ฃ๋ ๊ฒ์ด ๊ด๋ก์ด๊ธฐ ๋๋ฌธ)
๊ทธ ์์์๋ง ์์ (index.html, common.css, common.js ๋ฑ...)
์์ ์๋ฃ ํ
git add .
git commit -m "๋ฉ์์ง๋ด์ฉ"
git push origin master
- ์ ์ฅ์๋ฅผ ๊นํ๋ธํ์ด์ง๋ก ์ค์ ํ๋ ๋ฐฉ๋ฒ
๋ฆฌํฌ์งํฐ๋ฆฌ > settings์ ๊ฐ์ฅ ํ๋จ > Github Pages "Check it out here!"์ ํด๋ฆญ
branch : master > folder : /docs > save๋ฒํผ ํด๋ฆญ
>>> ์์ ๋ธ๋ก๊ทธ ๋งํฌ ์์ฑ๋จ
โป ์ฌ์ดํธ์ ๋ฐ์๋์ง ์๋ ์ค๋ฅ ํด๊ฒฐ๋ฐฉ๋ฒ
1. ctrl + shift + R
2. ์ฃผ์ ๋ค์ ' /?r=์ซ์ ' ์ฐ๊ธฐ
โป ์๋ฌด๋ฆฌ ํด๋ ์ ๋ ๋
window > ์๊ฒฉ ์ฆ๋ช ๊ด๋ฆฌ์ > windows ์๊ฒฉ ์ฆ๋ช ๊ด๋ฆฌ
> ์ผ๋ฐ ์๊ฒฉ ์ฆ๋ช ๋ด๋ถ์ github๊ด๋ จ ์ฃผ์ ์ญ์ ํ๊ธฐ
( ์ ๋๋ ์ด์ : ๊ธฐ์กด์ ๋ก๊ทธ์ธํ ์ฌ๋์ด ์์ด์ )
< ์๋ก์ด ๊ด๋ก >
* site-wrap
: body ํ๊ทธ ์์ ํ๋ ๋๊ธฐ
site-wrap { display : flex; flex-direction : column; min-height : 100vh; }
site-wrap > * { flex-shrink : 0; }
site-wrap > main { flex-grow : 1; }
< PHP >
- PHP ์ฌ์ฉ์ด์
HTML ์ฌ์ดํธ๊ฐ ์ฌ๋ฌ ๊ฐ์ธ ์ํฉ์์, ๊ณตํต์ ์ธ ์์(header, footer ๋ฑ)์ ๊ฐ์ ๋ณ๊ฒฝ ์๊ตฌ๋ฅผ ๋ฐ์์ ๋!
์ฐ๋ฆฌ๋ ์ฌ๋ฌ ๊ฐ์ html์ ๋ชจ๋ ์์ ํด์ค์ผ ํ๋ค.
ํ์ง๋ง PHP๋ฅผ ์ฌ์ฉํ๋ค๋ฉด ์ด๋ฌํ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์ ์๋ค.
- header๊ณผ footer ๋ถ๋ฆฌํ๊ธฐ
html ์ฌ์ดํธ ๋ชจ๋ ํ์ฅ๋ช php๋ก ๋ณ๊ฒฝํ๊ธฐ ( ex. index.php )
header.php ์์ฑ
footer.php ์์ฑ
index.php์์ ํด๋น ๋ถ๋ถ ์๋ผ๋ด์ ๋ถ์ฌ๋ฃ๊ธฐ
<php ๋ถ๋ฌ์ค๊ธฐ>
index.php ์๋จ → <?php require_once "header.php"; ?>
index.php ํ๋จ → <?php require_once "footer.php"; ?>
โป ์ผ๋ฐ์ ์ธ ์น์๋ฒ๋ก php๋ฅผ ์คํ์ํฌ ์ ์๋ค. (open with live server ์ฌ์ฉ ๋ถ๊ฐ๋ฅ)
- PHP ์น์๋ฒ๋ฅผ ์คํํ๋ ๋ฐฉ๋ฒ
: php -S localhost:87021 -r ./docs
'๐ UIUX ์นํผ๋ธ๋ฆฌ์ ๊ณผ์ (6๊ฐ์)' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
2021-07-15 (94์ผ์ฐจ) ๊นํ๋ธ(github)ํ์ ๋ฐฉ๋ฒ (0) | 2021.07.15 |
---|---|
2021-07-14 (93์ผ์ฐจ) php ๋ณ์, phpํ๋ผ๋ฏธํฐ, $_GET[''], echo (0) | 2021.07.15 |
2021-07-12 (91์ผ์ฐจ)GITHUB ์ ๋ก๋ ๋ฐฉ๋ฒ (0) | 2021.07.14 |
2021-07-11 (90์ผ์ฐจ) ๋์ฐ์ฐ๊ฐ์ฌ๋ผ์ด๋ ๋ณต์ต (0) | 2021.07.12 |
2021-07-10 (89์ผ์ฐจ) ์กฐ๋ณ๊ณผ์ , ๋ค์ด๋ก๋, ๊นํ๋ธ ์ฐ๊ฒฐ ์์ (0) | 2021.07.12 |
๋๊ธ