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 Pages を Web API として使う
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Kite
June 11, 2016
Programming
2
3.6k
GitHub Pages を Web API として使う
GitHub の API ではなく、GitHub のサービスの一つである GitHub Pagesを使って、サーバなしで Web API を提供
Kite
June 11, 2016
Tweet
Share
More Decks by Kite
See All by Kite
個人からチームまで、情報・タスク管理の一元化はNotionにお任せ!
ixkaito
12
74k
WordPress でも大丈夫!実例で見るウェブパフォーマンス改善
ixkaito
7
5.4k
WordPress でも大丈夫!実例で見るウェブパフォーマンス改善
ixkaito
22
7.8k
タイポグラフィベーシック (+ デザインアイデア)
ixkaito
13
4.1k
WordPress の今とこれから
ixkaito
1
1.9k
世界で一人しかできない WordPress コアを写経する話 ― 修行の先に見たものとは?
ixkaito
5
15k
WordPress の今とこれから
ixkaito
4
2.6k
Let's Think about Right Answers of Design and UI/UX
ixkaito
0
450
ブラウザのデフォルトスタイルを見てみよう
ixkaito
3
1.6k
Other Decks in Programming
See All in Programming
AI活用のコスパを最大化する方法
ochtum
0
110
AI巻き込み型コードレビューのススメ
nealle
2
2.4k
CSC307 Lecture 12
javiergs
PRO
0
450
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
22
8.1k
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
180
Railsの気持ちを考えながらコントローラとビューを整頓する/tidying-rails-controllers-and-views-as-rails-think
moro
4
350
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
340
The Ralph Wiggum Loop: First Principles of Autonomous Development
sembayui
0
3.7k
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
200
株式会社 Sun terras カンパニーデック
sunterras
0
1.9k
DSPy入門 Pythonで実現する自動プロンプト最適化 〜人手によるプロンプト調整からの卒業〜
seaturt1e
1
370
エージェント開発初心者の僕がエージェントを作った話と今後やりたいこと
thasu0123
0
210
Featured
See All Featured
Designing Powerful Visuals for Engaging Learning
tmiket
0
250
The World Runs on Bad Software
bkeepers
PRO
72
12k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Everyday Curiosity
cassininazir
0
140
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
320
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
How Software Deployment tools have changed in the past 20 years
geshan
0
32k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
130
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
95
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
420
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4k
Transcript
Use GitHub Pages as a Web API GitHub Pages Λ
Web API ͱͯ͠͏ Kansai Front-end users group 2016.06.11 ϑϩϯτΤϯυͷਓ͕Web APIΛޠΔձ
WordPress core contributor Ruby on Rails contributor Wocker developer Bathe
developer Frasco developer Web & graphic designer Programmer Kite KITERETZ inc. CEO & Funder ! kite.koga " ixkaito # ixkaito WHO AM I?
ຊͷςʔϚ GitHub API Ͱͳ͘ɺ Jekyll Pages API Λ͍ GitHub Pages
Ͱ Web API Λ ఏڙ͢Δ͜ͱͰ͋Δɻ
Jekyll Pages API ͱ • Jekyll ͷϓϥάΠϯ • Jekyll αΠτͷͯ͢ͷϖʔδɺߘɺυΩϡϝϯτɺ੩త
ϑΝΠϧͷσʔλΛجʹ JSON ϑΝΠϧΛੜ͢Δ • API http://example.com/api/v1/pages.json ͷΑ͏ͳURL ͰऔಘՄೳ
GitHub Pages Jekyll Λ͏ ϝϦοτ • GitHub Pages Λ͏͜ͱͰɺΠϯϑϥͷϝϯςφϯε͕ෆཁ
• Git ʹΑΔιʔεཧ • API ͷΧελϚΠζ͕ࣗ༝ • ελςΟοΫͳϑΝΠϧͷ৴ͳͷͰɺηΩϡϦςΟϦεΫ͕͍ • ύϒϦοΫϦϙδτϦͰ͔ͭಠࣗυϝΠϯΛ༻͠ͳ͍߹ແ ྉ • ଞͷαʔϏεͷҠߦ༰қ
GitHub Pages GitHub Pages dependencies ʹ͋Δ ϓϥάΠϯҎ֎αϙʔτ͍ͯ͠ͳ͍
ͦͷ·· gh-pages ϒϥϯνͳͲʹϓογϡͯ͠ɺJSON ϑΝ Πϧੜ͞Εͳ͍
ղܾํ๏ • ϩʔΧϧͰੜ͠ɺखಈͰ gh-pages ϒϥϯνͳͲʹϓογϡ ͢Δ • Travis CI ͳͲͷ֎෦αʔϏεΛͬͯࣗಈԽ͢Δ
• Rakefile ͳͲͰσϓϩΠΛ؆୯ʹ͢Δ
खಈσϓϩΠ ϝϦοτ • ֶशίετ͕͍ • ͙͢ʹެ։͞ΕΔ σϝϦοτ • ໘͍͘͞
Travis CI ͳͲʹΑΔσϓϩΠ ϝϦοτ • ௨ৗͷ GitHub Pages/Jekyll ͷӡ༻ͱશ͘ಉ͡ σϝϦοτ
• Travis CI ͳͲͷֶशίετ͕͔͔Δ • GitHub Pages ʹެ։͞ΕΔ·Ͱ͕͔͔࣌ؒΔ
Travis CI ʹΑΔσϓϩΠͷࣄྫ IUUQTHJUIVCDPNDXEJTBTUFSJOGPSNBUJPO
Rakefile ͳͲʹΑΔσϓϩΠ ϝϦοτ • ֎෦αʔϏεʹཔΔඞཁ͕ͳ͘ɺσϓϩΠͷख͔͔ؒΒͳ͍ • GitHub Pages ʹ͙͢ʹެ։͞ΕΔ •
Travis CI ͳͲΑΓֶशίετ͕͍ σϝϦοτ • Rakefile Λ࡞Δඞཁ͕͋Δ • `git push` Ҏ֎ʹɺσϓϩΠ༻ͷίϚϯυΛ࣮ߦ͢Δඞཁ͕͋Δ
Rakefile ͷϘΠϥʔϓϨʔτ IUUQTHJUIVCDPNJYLBJUPKFLZMMBQJCPJMFSQMBUF
͍ํ 1. Jekyll API Boilerplate ΛϑΥʔΫ 2. ϑΥʔΫͨ͠ϦϙδτϦΛΫϩʔϯ 3. Ϋϩʔϯͨ͠σΟϨΫτϦͰԼهΛ࣮ߦ
$ bundle install --path vendor/bundle $ bundle exec jekyll serve --baseurl /jekyll-api-boilerplate 4. http://localhost:4000/jekyll-api-boilerplate/api/v1/ pages.json ʹΞΫηε͢Δ͜ͱͰ JSON API Λ֬ೝͰ͖Δ
GitHub Pages ʹσϓϩΠ 1. `_config.yml` ͷ `url` Λࣗ͝ͷͷʹมߋ 2. σΟϨΫτϦͰԼهΛ࣮ߦ
$ bundle exec rake deploy 3. http://username.github.io/jekyll-api-boilerplate/api/v1/ pages.json ͷΑ͏ͳ URL ʹɺJSON API ͕ެ։͞Ε·͢
Thank You!