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
63
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Serve Static Pages at Scale
Serve Static Pages at Scale presentation from Static-Sites Meetup Berlin by Mouafa Ahmed
mouafa ahmed
November 21, 2017
More Decks by mouafa ahmed
See All by mouafa ahmed
User Experience 101
mouafa
0
120
Other Decks in Technology
See All in Technology
コミュニティの有益性 ~JAWS Days 2026 での体験を通して~ / The Benefits of a Community ~Through My Experience at JAWS Days 2026~
seike460
PRO
0
120
2026TECHFRESH畢業分享會 - AI 時代的人生存檔點
line_developers_tw
PRO
0
1.3k
Kiro Ambassador を目指す話
k_adachi_01
0
110
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
6
2k
【Snowflake Summit 2026 Recap!!】Snowflake Summit Deep Dive: Security & Governance
civitaspo
1
260
AIチャット検索改善の3週間
kworkdev
PRO
2
130
Kubernetesにおける学習基盤とLLMOpsの概要
ry
1
320
人材育成分科会.pdf
_awache
4
300
SONiCで構築・運用する生成AI向けパブリッククラウドネットワーク ~実装編~
sonic
0
270
生成 AI 実践ガイド (概略版) AIガバナンス編
asei
0
110
Android の公式 Skill / Android skills
yanzm
0
160
LayerX コーポレートエンジニアリング室におけるサプライチェーンセキュリティへの取り組み / Supply Chain Security at LayerX Corporate Engineering
yuyatakeyama
2
660
Featured
See All Featured
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.1k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Balancing Empowerment & Direction
lara
6
1.2k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
180
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
140
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Building Adaptive Systems
keathley
44
3.1k
We Have a Design System, Now What?
morganepeng
55
8.2k
The agentic SEO stack - context over prompts
schlessera
0
820
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