Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt blog to new website #5

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
overview/
/de/
/en/
pubdates.json
.*.swp
98 changes: 98 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Repository for OpenRailwayMap blog entries and styling

This repository contains the entries, templates and styling of the OpenRailwayMap blog.

## Setup

It is recommended to clone this Git repository to a location (called `$GIT_DIR`) outside the
document root (called `$DOCUMENT_ROOT` in this readme file) of the blog website.

* Add a symlink in the document root pointing to the `img/` directory of this Git repostory. Repeat
this for the directories containing the style sheets and JavaScript files.

```sh
cd $DOCUMENT_ROOT
ln -s $GIT_DIR/img img
ln -s $GIT_DIR/js js
ln -s $GIT_DIR/css css
ln -s de.atom de.rss
ln -s en.atom en.rss
```

* Add following to the configuration of your Apache web server:

```Apache
# permit access to /img, /js and /css because they point to locations outside of your document root
<Location /img>
Require all granted
</Location>
<Location /js>
Require all granted
</Location>
<Location /css>
Require all granted
</Location>

Option +FollowSymLinks
```

* Clone the repository of the
[blog generation tool](https://github.com/Nakaner/static-blog-generator) to any location of your
choice and run it:

```sh
python3 $PATH_TO_TOOL/generate-pages.py -t templates/ -s src -o $DOCUMENT_ROOT config.json
```

## Adding a new blog entry

* Write the text, save it the German text at `src/de/ENTRY_ID.html.source` and the English text at
`src/en/ENTRY_ID.html.source`. `ENTRY_ID` is the ID of this blog entry (not used for public links).
* Add it to `config.json`:

```json
[
{
"id": "ENTRY_ID",
"languages": {
"en": {
"authors": "Joe Awesome",
"destination_path": "great-news-about-openrailwaymap",
"subtitle": "",
"title": "Great news about OpenRailwayMap"
},
"de": {
"authors": "Joe Awesome",
"destination_path": "tolle-neuigkeiten-ueber-die-openrailwaymap",
"subtitle": "",
"title": "Tolle Neuigkeiten über die OpenRailwayMap"
}
}
},
{
"id": "https-support",
"languages": {
"de": {
"authors": "Alexander Matheisen",
"destination_path": "unterstuetzung-fuer-https",
"subtitle": "",
"title": "Unterstützung für HTTPS"
},
"en": {
"authors": "Alexander Matheisen",
"destination_path": "enabling-https",
"subtitle": "",
"title": "Enabling HTTPS"
}
}
}
]
```

`id` is the ID of an entry. `title` is the title, `destination_path` will be part of the final
public URL of this entry (the pattern is `https://HOST/LANGUAGE/DESTINATION_PATH.html`). It is
recommended to choose a destination path which is similar to the title.

The date of first publication will be added automatically at the next run of the blog generation
tool. If you later modify it, these changes will be detected (except if your changes don't change
the MD5 hash :-)). If you have to set the date of publication manually, edit `pubdates.json`.
62 changes: 62 additions & 0 deletions blog.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

<title>OpenRailwayMap – Blog</title>

<meta name="description" content="OpenRailwayMap - An OpenStreetMap-based project for creating a map of the world&#39;s railway infrastructure." />
<meta name="keywords" content="openstreetmap, openrailwaymap, alexander matheisen, rurseekatze, osm, matheisen, orm, eisenbahnkarte, bahnkarte, railmap, railway, railways, eisenbahn, streckenkarte">
<meta name="title" content="OpenRailwayMap" />
<meta name="author" content="Alexander Matheisen" />
<meta name="publisher" content="Alexander Matheisen" />
<meta name="page-topic" content="OpenRailwayMap" />
<meta name="robots" content="index,follow" />
<meta name="application-name" content="OpenRailwayMap" />

<link rel="icon" href="img/openrailwaymap-16.png" type="image/png" />

<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="OpenRailwayMap">
<link rel="manifest" href="manifest.json">

<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@openrailwaymap" />
<meta name="twitter:title" content="OpenRailwayMap" />
<meta name="twitter:description" content="OpenRailwayMap - An OpenStreetMap-based project for creating a map of the world&amp;#39;s railway infrastructure." />
<meta name="twitter:url" content="http://www.openrailwaymap.org/">
<meta name="twitter:image" content="img/openrailwaymap-310.png" />

<meta property="og:site_name" content="OpenRailwayMap" />
<meta property="og:type" content="website" />
<meta property="og:image" content="img/openrailwaymap-600.png" />
<meta property="og:title" content="OpenRailwayMap" />
<meta property="og:url" content="http://www.openrailwaymap.org/" />
<meta property="og:description" content="OpenRailwayMap - An OpenStreetMap-based project for creating a map of the world&#39;s railway infrastructure." />

<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-tooltip" content="OpenRailwayMap">
<meta name="msapplication-starturl" content="http://www.openrailwaymap.org/">
<meta name="msapplication-square70x70logo" content="img/openrailwaymap-70.png">
<meta name="msapplication-square150x150logo" content="img/openrailwaymap-150.png">
<meta name="msapplication-wide310x150logo" content="img/openrailwaymap-310.png">
<meta name="msapplication-square310x310logo" content="img/openrailwaymap-310.png">

<script type="text/javascript">
window.onload = function()
{
var lang = (navigator.language.indexOf("de") > -1) ? 'de' : 'en';
if (window.location.href.substr(-1, 1) == '/')
window.location = window.location.href+'blog-'+lang+'.html';
else
window.location = window.location.href.substr(0, window.location.href.length-5)+'-'+lang+'.html';
}
</script>
</head>
<body>
</body>
</html>
Loading