Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
github.ioでブログを 公開しよう
Search
taniko
July 16, 2016
3.5k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
github.ioでブログを 公開しよう
PHPを使った静的サイトジェネレータのお話です
taniko
July 16, 2016
More Decks by taniko
See All by taniko
どうぶつと学ぶGitの考え方
hrgruri
0
35
SLOを考える
hrgruri
0
39
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
The untapped power of vector embeddings
frankvandijk
2
1.8k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.3k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
Technical Leadership for Architectural Decision Making
baasie
3
440
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.4k
Agile that works and the tools we love
rasmusluckow
331
22k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
330
A Modern Web Designer's Workflow
chriscoyier
698
190k
Ruling the World: When Life Gets Gamed
codingconduct
0
280
BBQ
matthewcrist
89
10k
Transcript
github.ioͰϒϩάΛ ެ։͠Α͏ ߥ୩༏ @hrgruri
ࣗݾհ ߥ୩ ༏ @hrgruri ໋ཱؗେֶ ใཧֶ෦ B4 (M0) ITܥͷΠϕϯτॳࢀՃ (LTॳ)
Έͳ͞ΜϒϩάΛ ͍ͬͯ·͔͢?
ࢲgithub.ioͰ࢝Ί·ͨ͠
PHP ✕ github.io
github.io ? • ແྉͰ͡ΊΒΕΔ • GitHubʹpush͢Δͱެ։͞ΕΔ • username.github.io • PHPಈ͔ͳ͍!
(Ұൠతʹ)ϒϩάΛ࡞Δʹ ੩తαΠτδΣωϨʔλΛ༻
• Jekyll • Octopress • Pelican • Hexo • Hugo
੩తαΠτδΣωϨʔλ
• Jekyll • Octopress • Pelican • Hexo • Hugo
→ Ruby ੩తαΠτδΣωϨʔλ
• Jekyll • Octopress • Pelican • Hexo • Hugo
→ Ruby → Ruby ੩తαΠτδΣωϨʔλ
• Jekyll • Octopress • Pelican • Hexo • Hugo
→ Ruby → Ruby → Python ੩తαΠτδΣωϨʔλ
• Jekyll • Octopress • Pelican • Hexo • Hugo
→ Ruby → Ruby → Python → JavaScript ੩తαΠτδΣωϨʔλ
• Jekyll • Octopress • Pelican • Hexo • Hugo
→ Ruby → Ruby → Python → JavaScript → Go ੩తαΠτδΣωϨʔλ
PHP?
͋Δ͜ͱʹ͋Δ͕...
هࣄ͝ͱ(.php)ʹ @extends(), @section()Λهड़ @markdownͱ@endmarkdown ͷؒʹMarkdownΛຒΊࠐΉ
hrgruri/saori ͕࣌ؒ͋ΕσϞ͠·͢
PHPΛ4ߦॻ͚ͩ͘Ͱ (MarkdownͱJSONॻ͘) PHPΛͬͯ github.io༻ͷαΠτΛ ੜͰ͖Δ
main.php <?php require 'vendor/autoload.php'; $saori = new hrgruri\saori\Saori(__DIR__); $saori->run($argv);
hrgruri/saori • ComposerͰΠϯετʔϧͰ͖Δ • MarkdownͱJSONͰهड़͍ͯ͘͠ • λάػೳ, Atom৴ • ࣗ༝ʹ؆қϖʔδΛੜ
• config.jsonͰઃఆ, theme.jsonͰ৭ͳͲͷมߋ
JOJUͰॳظԽ QPTUͰϕʔεϑΝΠϧΛ ੜ BSUJDMFNE DPOpHKTPO Λฤू NBLFͰαΠτ )5.- Λੜ
ίϛοτϓογϡ جຊతͳྲྀΕ ϒϩάใΛهड़ DPOUFOUTDPOpHKTPO
contents/config.json { "id" : "hrgruri", "local" : "http://localhost:8000", "title" :
"blog\\hrgruri", "author" : "Yuya Aratani", "theme" : "saori", "lang" : "ja", "link" : { "github" : "https://github.com/hrgruri", "twitter" : "https://twitter.com/hrgruri", "ϦϙδτϦઆ໌": "/repository" }, "feed" : { "type" : "atom", "number": 30 }, "google-analytics" : "UA-xxxxxxx-x", "share" : [ "twitter" ] }
contents/theme.json { "saori": { "color": { "header" : "#A9EEE6", "title"
:"#F7FBFC", "body":"#FEFAEC", "page-contents": "#FFF1CF" } } }
saoriPHPͰͳͷͰ (ࢲͷΑ͏ͳPHP͔͠ಡΊͳ͍) PHPerͰίʔυΛಡΊΔ
هࣄΛߘ͢Δͨͼʹ GitHub͕ʹͳ͍ͬͯ͘
PHP࠷ߴ "
PHPΛ͔ͭͬͯ github.ioͰ ϒϩάΛΖ͏
DEMO
؆୯ͳ͍ํˣ https://hrgruri.github.io/ repository/saori/