Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Serve Static Pages at Scale
Search
mouafa ahmed
November 21, 2017
Technology
0
61
Serve Static Pages at Scale
Serve Static Pages at Scale presentation from Static-Sites Meetup Berlin by Mouafa Ahmed
mouafa ahmed
November 21, 2017
Tweet
Share
More Decks by mouafa ahmed
See All by mouafa ahmed
User Experience 101
mouafa
0
120
Other Decks in Technology
See All in Technology
日本の AI 開発と世界の潮流 / GenAI Development in Japan
hariby
1
390
Knowledge Work の AI Backend
kworkdev
PRO
0
230
アラフォーおじさん、はじめてre:Inventに行く / A 40-Something Guy’s First re:Invent Adventure
kaminashi
0
140
2025-12-27 Claude CodeでPRレビュー対応を効率化する@機械学習社会実装勉強会第54回
nakamasato
2
220
マイクロサービスへの5年間 ぶっちゃけ何をしてどうなったか
joker1007
19
7.6k
_第4回__AIxIoTビジネス共創ラボ紹介資料_20251203.pdf
iotcomjpadmin
0
130
Agent Skillsがハーネスの垣根を超える日
gotalab555
6
4.2k
株式会社ビザスク_AI__Engineering_Summit_Tokyo_2025_登壇資料.pdf
eikohashiba
1
110
Strands AgentsとNova 2 SonicでS2Sを実践してみた
yama3133
1
1.8k
TED_modeki_共創ラボ_20251203.pdf
iotcomjpadmin
0
150
Amazon Bedrock Knowledge Bases × メタデータ活用で実現する検証可能な RAG 設計
tomoaki25
6
2.3k
なぜ あなたはそんなに re:Invent に行くのか?
miu_crescent
PRO
0
200
Featured
See All Featured
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.4k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
28
Being A Developer After 40
akosma
91
590k
Writing Fast Ruby
sferik
630
62k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Discover your Explorer Soul
emna__ayadi
2
1k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
210
A Tale of Four Properties
chriscoyier
162
23k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.1k
Highjacked: Video Game Concept Design
rkendrick25
PRO
0
250
Transcript
Serve static pages at scale Mouafa Ahmed
About me Mouafa Ahmed FE Tech Lead at Smartfrog @mouafa
2
3
The Challenge Imagine that your marketing team came to you
asking for: • A fast way to publish hundreds of landing pages. • Support of different languages. • The ability to change the content of those landing pages without your intervention. 4
5
6
A History of solutions • Python script that generate static
pages with all the available localisation. • Node.js script that basically do the same thing. 7
What we did right • Ability to handle many languages
• Putting content in Contentful • The ability to change the content without touching the code 8
What we missed • The ability to change the content
without redeploying • Mixing template with content in Contentful • A better Developer eXperience 9
10 Mixing template with content
Landing Pages Examples 11
12
13
14
15
What is Motor “MOTOR is a lightweight engine aimed to
rapidly build static pages” 16
17
section1 section2 section3 Template 18 Content
meta.json { "template": "ebook", "relations": [ { "contentfulID": "57tKmI41k4WQsUS28ckG0", "sectionID":
"section1" }, { "contentfulID": "1R3Eo49Ez6MeQYsUcoYCm", "sectionID": "section2" }, { "contentfulID": "59zeHjZ9QAcKyESsu4Iue", "sectionID": "section3" } ] } 19
Routing 20 lang-country FS path
meta path Motor Engine lang, country rendered page prerender render
Parse meta 21
Get Entries relations Motor Prerender Parse Entries Link Content Linked
Content 22
Prepare the local context (content + i18n + linker) content
Motor Render Resolve template Pug render With the prepared context rendered page template Lang, country 23
24
Environment variables NODE_ENV = development MOTOR_PORT = 4000 SPACE_ID =
contentful_SPACE_ID ACCESS_TOKEN = contentful_ACCESS_TOKEN 25
Configuration const motor = require('motor') const path = require('path') const
config = { path: { env: path.resolve(__dirname, '.env'), views: path.resolve(__dirname, 'views'), templates: path.resolve(__dirname, 'templates'), i18n: path.resolve(__dirname, 'i18n') }, static: [ { directory: 'static', path: path.resolve(__dirname, 'static') } ], supportedLangs: ['en', 'de'] } motor(config) 26
27
28 Thank You @mouafa