Skip to content

Commit

Permalink
Prepare the blog
Browse files Browse the repository at this point in the history
  • Loading branch information
Kleidukos committed Aug 15, 2024
0 parents commit b24c17b
Show file tree
Hide file tree
Showing 52 changed files with 2,020 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
steps:
- name: 'Checkout'
uses: actions/checkout@main
with:
submodules: "recursive"
- uses: actions/setup-node@v4
with:
node-version: 20
- run: |
sudo apt-get update && sudo apt-get install -y wget git
- run: |
wget -q -O - \
"https://github.com/getzola/zola/releases/download/v0.19.1/zola-v0.19.1-x86_64-unknown-linux-gnu.tar.gz" \
| sudo tar xzf - -C /usr/local/bin
- run: npm install
- run: npm run abridge
- name: 'Build only'
uses: shalzz/[email protected]
env:
BUILD_DIR: .
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_ONLY: true

build_and_deploy:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: 'Checkout'
uses: actions/checkout@main
with:
submodules: "recursive"
- uses: actions/setup-node@v4
with:
node-version: 20
- run: |
sudo apt-get update && sudo apt-get install -y wget git
- run: |
wget -q -O - \
"https://github.com/getzola/zola/releases/download/v0.19.1/zola-v0.19.1-x86_64-unknown-linux-gnu.tar.gz" \
| sudo tar xzf - -C /usr/local/bin
- run: npm install
- run: npm run abridge
- name: 'Build and deploy'
uses: shalzz/[email protected]
env:
PAGES_BRANCH: gh-pages
BUILD_DIR: .
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.env
public
build
storage
node_modules
package-lock.json
static/demo.html
static/tinysearch_engine.js
static/tinysearch_engine.d.ts
static/tinysearch_engine_bg.wasm.d.ts
static/package.json
static/js/pagefind.*.pf_meta
static/js/index
static/js/fragment
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "themes/abridge"]
path = themes/abridge
url = https://github.com/jieiku/abridge.git
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blog.haskell.org
66 changes: 66 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Haskell Blog

## Local installation

The blog is made with [Zola], based on the [Abridge theme].

You will need:
* The `zola` binary v0.19.1 or higher
* `npm`

Once you have cloned this repository, run `npm install` and `npm run abridge` to initialise the front-end features like full-text search.

## Contribute content

### Blog post structure

#### Name

Blog posts are located in the `content` directory, as markdown files. The files themselves contain
their title in a "slug" format (alphanumeric characters, words separated by a hyphen, all lowercase):

```
documentation-best-practices.md
```

#### Front-matter

The file itself must contain a front-matter in TOML format that has the following properties:

```
+++
title = "Title of the post"
date = YYYY-MM-DD
[taxonomies]
authors = ["Author's Name"] # The author's name. Will be indexed.
categories = ["Haddock"] # A minima should be the name of the team ("Haddock", "HLS", "Cabal"). Will be indexed.
tags = ["Practices"] # Something more precise like "Release", "Practice", "JavaScript", can be aded. Will be indexed.
+++
```

#### Summary

The eye-catcher that you wish to show on the front-page of the blog is the first paragraph.
You can manually delimit where it ends by inserting `<!-- more -->` on a newline between this paragraph and the rest of the content.

Otherwise, in the absence of this comment, the first 150 characters will be used by Zola

#### Images and other files

If you want to add images to your blog post, create a folder named after the blog post, and write the content of the post to an `index.md`
file within it. Put your associated files in the same directory.

For instance:

```
documentation-best-practices
├── flow-of-documentation.png
└── index.md
```

### Local preview

Run `zola serve --drafts` in order to serve the website and automatically render it when files change.

[Zola]: https://www.getzola.org/
[Abridge theme]: https://abridge.pages.dev/overview-abridge/
Loading

0 comments on commit b24c17b

Please sign in to comment.