molly / static-timeline-generator

Create static timeline webpages.
https://molly.github.io/static-timeline-generator/
MIT License
444 stars 58 forks source link
static-site timeline

Static timeline generator

Easily create a static timeline webpage like my Wikimedia timeline. Check out a preview of this sample site, deployed with GitHub Pages: https://molly.github.io/static-timeline-generator/.

Contents

Screenshot of a timeline page with dummy content

Install

Clone this repository, then run npm install from the directory.

npm run-script serve will build the project and serve the static files locally at http://localhost:8080. npm run-script build just runs the build step without starting the development server.

Customize

Almost all of the content you need to change is in src/_data/content.js.

Primary content

Meta

Additional customization

If you would like to add more color options for the circles on the timeline, you can edit the src/css/custom.css file to add your own. You can use this tool to pick colors and get their hex color codes. They are defined like so:

.timeline-icon.yourcolorhere {
  background-color: #hexcolorcode;
}

You would then use color: yourcolorhere in the content.js file.

Replace the images in the src/img folder to customize the page favicon and OpenGraph image.

Deploy

Once you run npm run-script buld, you will see a _site directory containing static HTML/CSS/JS files with your site content. You can now use any static site hosting to deploy these files!

GitHub pages

To deploy your static site on GitHub pages (free), create a branch containing the static files in the root directory by running git subtree push --prefix _site origin gh-pages. Then you can go to your repository's Settings > Pages options and choose "Deploy from a branch", then select gh-pages as the branch.

Github Pages config settings. Under 'Build and deployment', Source is set to 'Deploy from a branch', branch is set to 'gh-pages', and the folder is set to '/ (root)'.

Other services

There are some good tutorials out there for deploying a static site on various other free services. A few are listed below.

You can also look for tutorials on how to deploy a site built with eleventy, since that's what's powering this project. Some webhosting services like Vercel specifically support eleventy in some really handy ways.

Responsiveness

Timelines will render well on tablets:

Screenshot rendered on a tablet device

or mobile devices:

Screenshot rendered on a phone

Browser compatibility

This should work well on all modern browsers. IE <9 is not supported.

Without JavaScript enabled, the page degrades gracefully. However, posts will show in a single-column timeline and filters will not show.

Under the hood

This project uses

It is released under the MIT license.