Skip to content

Commit d054f06

Browse files
committed
First
1 parent 9982426 commit d054f06

9 files changed

Lines changed: 1580 additions & 221 deletions

File tree

.github/workflows/build.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Build the website
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: false
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Setup Node.js environment
25+
uses: actions/setup-node@v4
26+
- name: Install packages
27+
run: npm ci
28+
working-directory: src
29+
- name: Build
30+
run: npm run build
31+
working-directory: src
32+
- name: Upload artifact
33+
uses: actions/upload-pages-artifact@v3
34+
deploy:
35+
environment:
36+
name: github-pages
37+
url: ${{ steps.deployment.outputs.page_url }}
38+
runs-on: ubuntu-latest
39+
needs: build
40+
steps:
41+
- name: Deploy to GitHub Pages
42+
id: deployment
43+
uses: actions/deploy-pages@v5

README.md

Lines changed: 1 addition & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1,124 +1 @@
1-
# Static timeline generator
2-
3-
Easily create a static timeline webpage like my [Wikimedia timeline](https://www.mollywhite.net/wikimedia-timeline/). Check out a preview of this sample site, deployed with GitHub Pages: https://molly.github.io/static-timeline-generator/.
4-
5-
**Contents**
6-
7-
- [Install](#install)
8-
- [Customize](#customize)
9-
- [Primary content](#primary-content)
10-
- [Meta](#meta)
11-
- [Additional customization](#additional-customization)
12-
- [Deploy](#deploy)
13-
- [GitHub Pages](#github-pages)
14-
- [Other services](#other-services)
15-
- [Responsiveness](#responsiveness)
16-
- [Browser compatibility](#browser-compatibility)
17-
- [Under the hood](#under-the-hood)
18-
19-
![Screenshot of a timeline page with dummy content](docs/browser.png)
20-
21-
## Install
22-
23-
Clone this repository, then run `npm install` from the directory.
24-
25-
`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.
26-
27-
## Customize
28-
29-
Almost all of the content you need to change is in `src/_data/content.js`.
30-
31-
### Primary content
32-
33-
- `header` (HTML, optional): The content to display in the header at the top of the page.
34-
- `footer` (HTML, optional): The content to display in the footer at the bottom of the page.
35-
- `entries` (array of objects, **required**): The list of entries to display on the timeline, in the order they should display.
36-
- `id` (string, **required**): A unique ID for this timeline entry.
37-
- `categories` (array of strings, optional): A list of categories that apply to this entry. These will show up as checkboxes at the top of the page, and allow readers to filter the timeline. They may not contain commas. They can be hyphen or space separated (`sample category` or `sample-category` will both display on the page as `Sample category`). Entries without any categories will always display.
38-
- `color` (string, optional): The color of the circle that displays on the timeline line. The options already defined are `green`, `red`, and `grey`. You can define additional colors in `css/custom.css` (see below).
39-
- `faicon` (string, optional): The name of a Font Awesome icon to use in the circle on the timeline line. [Explore the options](https://fontawesome.com/v5.15/icons?d=gallery&p=2&s=solid&m=free). This is just the icon name (without the `fa-` prefix). For example: `anchor`.
40-
- `datetime` (string, either `datetime` or `date` must be present): A date and time specifier for the item. This can be in [any format that `moment.js` recognizes](https://momentjs.com/docs/#/parsing/string/). I normally do "YYYY-MM-DD HH-SS". If there is no time, only a date, use the `date` parameter instead of `datetime`.
41-
- `date` (string, either `datetime` or `date` must be present): A date specifier for the item. "YYYY-MM-DD".
42-
- `title` (HTML, **required**): The title of the timeline entry.
43-
- `image` (optional): An image to display in the entry
44-
- `src` (string, required): A direct URL to the image file to be embedded on the page, or a relative link to an image in this directory (for example `img/filename.png`).
45-
- `link` (string, optional): A hyperlink to the page containing the image, if you'd like people to be able to click it to see a larger version, etc.
46-
- `alt` (string, optional): [Alt text](https://supercooldesign.co.uk/blog/how-to-write-good-alt-text) describing the image.
47-
- `caption` (HTML, optional): A caption describing the image.
48-
- `body` (HTML, **required**): The text of the timeline entry. If you want multiple paragraphs, you have to include `<p>` tags yourself; otherwise, it will be added.
49-
- `links` (array of objects, optional): An array of links to display at the bottom of the entry.
50-
- `href` (string, **required**): The target of the link.
51-
- `linkText` (HTML, **required**): Link text.
52-
- `extraText` (HTML, optional): Extra HTML to display at the end of the link.
53-
54-
### Meta
55-
56-
- `pageTitle` (string, **required**): The text to go in the `<title>` tag, to set the title of the page in the browser.
57-
- `pageDescription` (string, optional): Page description to go into [meta](https://www.w3schools.com/tags/tag_meta.asp) tags.
58-
- `pageAuthor` (string, optinal): Page author to go into [meta](https://www.w3schools.com/tags/tag_meta.asp) tags.
59-
60-
## Additional customization
61-
62-
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](https://htmlcolorcodes.com/) to pick colors and get their hex color codes. They are defined like so:
63-
64-
```css
65-
.timeline-icon.yourcolorhere {
66-
background-color: #hexcolorcode;
67-
}
68-
```
69-
70-
You would then use `color: yourcolorhere` in the content.js file.
71-
72-
Replace the images in the `src/img` folder to customize the page [favicon](https://blog.hubspot.com/website/what-is-a-favicon) and [OpenGraph image](https://blog.hubspot.com/marketing/open-graph-tags-facebook-twitter-linkedin).
73-
74-
## Deploy
75-
76-
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!
77-
78-
### GitHub pages
79-
80-
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.
81-
82-
<img src="docs/gh-pages-config.png" alt="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)'." width="500"/>
83-
84-
### Other services
85-
86-
There are some good tutorials out there for deploying a static site on various other free services. A few are listed below.
87-
88-
You can also look for tutorials on how to deploy a site built with [eleventy](https://www.11ty.dev/), since that's what's powering this project. Some webhosting services like Vercel specifically support eleventy in some really handy ways.
89-
90-
- [Netlify](https://www.netlify.com/blog/2016/10/27/a-step-by-step-guide-deploying-a-static-site-or-single-page-app/)
91-
- [Vercel](https://vercel.com/guides/deploying-eleventy-with-vercel)
92-
- [Render](https://render.com/)
93-
- Create a new Static Site on Render
94-
- Set "build command" to `npm run-script build`
95-
- Set "publish directory" to `_site`
96-
97-
## Responsiveness
98-
99-
Timelines will render well on tablets:
100-
101-
<img src="docs/tablet.png" alt="Screenshot rendered on a tablet device" width="500"/>
102-
103-
or mobile devices:
104-
105-
<img src="docs/phone.png" alt="Screenshot rendered on a phone" width="400"/>
106-
107-
## Browser compatibility
108-
109-
This should work well on all modern browsers. IE <9 is not supported.
110-
111-
Without JavaScript enabled, the page degrades gracefully. However, posts will show in a single-column timeline and filters will not show.
112-
113-
## Under the hood
114-
115-
This project uses
116-
117-
- [11ty](https://www.11ty.dev)
118-
- [EJS](https://ejs.co/)
119-
- [moment.js](https://momentjs.com/)
120-
- [FontAwesome](https://fontawesome.com/)
121-
- [normalize.css](https://github.com/necolas/normalize.css)
122-
- [classlist-polyfill](https://github.com/eligrey/classList.js)
123-
124-
It is released under the [MIT license](https://github.com/molly/static-timeline-generator/blob/main/LICENSE).
1+
# [Anything but a web browser](https://anythingbutawebbrowser.com/)

_site/css/main.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_site/img/favicon.png

124 KB
Loading

0 commit comments

Comments
 (0)