Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Static Site Generators - Developing Websites in Low-resource Condition

142 views

Published on

Slides for talk on "Static Site Generators - Developing Websites in Low-resource Condition"

Published in: Education
  • Be the first to comment

  • Be the first to like this

Static Site Generators - Developing Websites in Low-resource Condition

  1. 1. Paul Walk Founder and Director, Antleaf Dublin Core Metadata Initiative (DCMI) Web: http://www.paulwalk.net Email: paul@paulwalk.net www.antleaf.com www.dublincore.org Static Site Generators - Developing Websites in Low-resource Conditions
  2. 2. How to publish a website... in 1999 Credit: Photo by Brett Jordan on Unsplash
  3. 3. 1999: when life was simpler....
  4. 4. How to publish a website... in 2009 Credit: Photo by History in HD on Unsplash
  5. 5. 2009: the rise of the CMS
  6. 6. One way (of many) to publish a website... in 2019 Credit: Photo by Alejandro Escamilla on Unsplash
  7. 7. 2019: easy websites for projects
  8. 8. What are Static Site Generators? Credit: Photo by Fatos Bytyqi on Unsplash
  9. 9. Three technologies which make the difference 1. Git • stable, sophisticated, free version control technology which is ubiquitously supported • github: global scale infrastructure providing git as a service • allowing distributed contributions by 'pull request’ 2. Markdown • simple, parseable but easily readable plain text format 3. Static Site Generators • a new class of tool to manage content locally and compile it into webpages which are then uploaded to a server (kinda like we used to do it in the early 90s!)
  10. 10. General characteristics • a desktop application which assembles content from simple text files and publishes it as static content to a bog-standard web-server. • content is processed during the publishing operation, rather than when the user requests content (although client-side Javascript still supported) • simple command-line application to generate content and serve pages locally (replaces the need for a staging server) • no database - content in semi-structured text files
  11. 11. Components - standard to most systems 1. content-model • folder hierarchy, text files 2. content pages • (markdown, front-matter) • blog type content is also often supported 3. templates (& themes) • (with some level of basic scripting) 4. generator software • typically a command-line script or application 5. configuration file 6. other non-core features • 'shortcodes' • data as content (i.e. data in structured files such as JSON or YAML) • plugins
  12. 12. https://staticsitegenerators.net
  13. 13. Under the hood - a case-study: the Dublin Core website and Hugo Credit: Photo by Hosea Georgeson on Unsplash
  14. 14. About the Dublin Core Website • in continuous operation for ~25 years • approx 2,500 web-pages with 3,000 other files • 18 month project to convert to Markdown • compiles with Hugo from sources in < 2 seconds • averages 100,000 page views / month • running on a web-server costing $5 per month
  15. 15. About Hugo • second most popular SSG after Jekyll • the fastest SSG (written in Go) • simple installation - just download and run (Windows, Mac, Linux etc) • very actively developed - improving all the time
  16. 16. Content-model • text files arranged in folder hierarchy • folder hierarchy relates to URL path structure • filename relates to URL
  17. 17. Content pages • "front-matter" metadata • often in YAML format like here • main body in Markdown, arbitrary HTML also accepted where necessary
  18. 18. Templates • can reference metadata (e.g. 'page title') from content page • can re-use 'partial' templates (e.g. a common 'header' & 'footer') • (example here is in Go's templating syntax)
  19. 19. Command-line software • used to generate new content: • also used to run a local sever to see how the site will look
  20. 20. Deployment options • SFTP • Rsync (over SSH) • git commit hooks (or GitHub webhooks) • requires the site to be built on the server, so a little more infrastructure required
  21. 21. workflow
  22. 22. Why not just use Wordpress?
  23. 23. Complexity, support, cost....
  24. 24. The sustainability headache • ~50% of WP installations are at least 3 versions behind the current, at the time of checking this (2019- 06-25) • to maintain a website, the software has to be kept up-to-date (web server, database software, PHP, Wordpress, themes, plugins....) • Funder now require project websites to be sustained for longer periods (10 years!) • backup and long-term preservation is very difficult • typically need to preserve complex software & a database https://wordpress.org/about/stats/
  25. 25. The security nightmare • WordPress is the most widely used CMS in the world, powering over 25% of websites with almost a 60% market share of traffic. • This attracts bad actors • 14034 vulnerabilities (3129 uniques) • 28 new ones added in the last month! • a whole industry for protecting just Wordpress! https://wpvulndb.com https://www.wordfence.com
  26. 26. So, why use a Static Site Generator? Credit: Photo by Fatos Bytyqi on Unspla
  27. 27. When to consider using a Static Site Generator • if you need to build & manage a website which: • will have one, or a small number, of users • will be relatively simple • won't have major 'dynamic' requirements • will need to be preserved, even after it is no longer a live site • a project website is a good candidate!
  28. 28. Simplifying curation and preservation • version control and redundancy • synchronised repositories & distributed version control via Git • active curation • ease of access and contribution to sources via Git • simple & readable plain text formats (Markdown) • "one click" deployment • minimal deployment infrastructure • standard web-server • text files, open formats, no database or server-side 'logic', static site generators fewer broken websites!
  29. 29. Facing off: CMS versus Static Site Generator Photo by Mariah Hewines on Unsplash
  30. 30. Summary: pros and cons • Pros • can manage many contributors, with different levels of access • (non-tech) user-friendly authoring env. • Cons • significant sysadmin burden • infrastructural reqs • plugins make this worse • content preservation challenge • harder to scale • challenging to keep secure • Pros • minimal infrastructural reqs • minimal sysadmin burden • easy to keep safe and secure • supports content preservation • very responsive websites • scaling is not really an issue • no need for staging server • developer-friendly authoring env • Cons • basic access control (e.g. git repo) • less user-friendly authoring env. Content Management System Static Site Generator
  31. 31. peace of mind! Credit: Photo by Jared Rice on Unsplash
  32. 32. Paul Walk Founder and Director, Antleaf Dublin Core Metadata Initiative (DCMI) Web: http://www.paulwalk.net Email: paul@paulwalk.net www.antleaf.com www.dublincore.org Thank you!

×