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
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
We Built for Predictability; The Workloads Didn’t Care
stahnma
0
140
FinTech SREのAWSサービス活用/Leveraging AWS Services in FinTech SRE
maaaato
0
130
顧客の言葉を、そのまま信じない勇気
yamatai1212
1
350
Agile Leadership Summit Keynote 2026
m_seki
1
620
今日から始めるAmazon Bedrock AgentCore
har1101
4
410
M&A 後の統合をどう進めるか ─ ナレッジワーク × Poetics が実践した組織とシステムの融合
kworkdev
PRO
1
450
プロポーザルに込める段取り八分
shoheimitani
1
280
小さく始めるBCP ― 多プロダクト環境で始める最初の一歩
kekke_n
1
420
GitLab Duo Agent Platform × AGENTS.md で実現するSpec-Driven Development / GitLab Duo Agent Platform × AGENTS.md
n11sh1
0
140
Cosmos World Foundation Model Platform for Physical AI
takmin
0
900
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.3k
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
180
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
450
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
67
It's Worth the Effort
3n
188
29k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.7k
My Coaching Mixtape
mlcsv
0
48
Art, The Web, and Tiny UX
lynnandtonic
304
21k
The SEO Collaboration Effect
kristinabergwall1
0
350
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
140
The Cult of Friendly URLs
andyhume
79
6.8k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
120
Designing Experiences People Love
moore
144
24k
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