Skip to content

Commit

Permalink
chore(deps): update dependency lts to v23.2
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored and unused committed Jan 4, 2025
0 parents commit b7ef17c
Show file tree
Hide file tree
Showing 80 changed files with 3,215 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig, see http://EditorConfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true

[*.hs]
indent_style = space
indent_size = 4
57 changes: 57 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: CI
on:
push:
branches:
- 'main'
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install system dependencies
run: sudo ./install-deps
- name: Build and test
uses: freckle/stack-action@v5
with:
stack-build-arguments: --fast --lock-file error-on-write
- name: Build executable
run: stack --no-terminal build --fast --copy-bins --local-bin-path .
- name: Store executable
uses: actions/upload-artifact@v4
with:
name: executable
path: multiblog

publish:
needs:
- build
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Download executable
uses: actions/download-artifact@v4
with:
name: executable
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_REGISTRY_USER: ${{ github.actor }}
DOCKER_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: |
npx \
--package @codedependant/semantic-release-docker@4 \
--package semantic-release@18 \
semantic-release
31 changes: 31 additions & 0 deletions .github/workflows/renovate-lockfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Renovate Lockfile Update

on:
push:
branches:
- renovate/**

jobs:
update-stack-lockfile:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build and test
uses: freckle/stack-action@v5
with:
stack-build-arguments: --dry-run
- name: Update lockfile
run: |
if git diff --name-only | grep -q 'stack.yaml.lock'; then
git config user.name "unused"
git config user.email "[email protected]"
git add stack.yaml.lock
git commit --amend --no-edit
git push -f
fi
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/content
/dist
/.ghci
/.HTF
/.stack-work
/multiblog.cabal
1 change: 1 addition & 0 deletions .hindent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
indent-size: 4
1 change: 1 addition & 0 deletions .hlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- ignore: {name: "Replace case with maybe"}
16 changes: 16 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@codedependant/semantic-release-docker",
{
"dockerRegistry": "ghcr.io",
"dockerProject": "koterpillar",
"dockerImage": "multiblog"
}
],
"@semantic-release/github"
]
}
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM ubuntu:24.04

ADD install-deps /
RUN /install-deps

ADD multiblog /bin
RUN chmod +x /bin/multiblog

RUN mkdir /content
WORKDIR /content

ENTRYPOINT /bin/multiblog
123 changes: 123 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Multiblog

This is a quasi-static blog engine supporting rendering in multiple languages
based on the user agent language.

It is currently not generic enough to be used for anything other than a
personal blog, but the goal is to fully separate the appearance control from
the engine.

## Usage

Running `multiblog` will start an HTTP server for the content found under the
current directory. The following environment variables can be given:

- `PORT` - the port to listen on, default 8000.
- `SITE_URL` - the site URL used for the links, default `http://localhost:8000`.
- `CONTENT_DIRECTORY` - the directory to look for content in instead.

### Content

There are two types of content to display: articles and metas. Articles have a
publication date, and form the main stream of the blog. Metas are pages which
don't have a date, and are typically acessible from the header/footer menu.

All content is written in Markdown and is converted into HTML when rendering.
Both articles and metas have multiple language versions in separate Markdown
files in the same directory.

Articles directories are named `yyyy-mm-dd-slug`, where `yyyy-mm-dd` is the
publication date of the article and `slug` is unique, within a day, article
identifier that will be used in the URL.

Metas are stored in `meta` directory, and their directory names are taken
directly to be their slugs.

Individual Markdown files inside the directories are named after their content
language code, for example, `en.md`.

Metas support rendering as slideshows via [remark](https://remarkjs.com/). To
switch a meta to presentation mode, add `layout: presentation` to `options.yaml`
in the meta directory.

Metas can be exported as PDF or DOCX by adding `.pdf` or `.docx` to the URL. To
control the exported file name, add `exportSlug: AnotherName` to `options.yaml`
in the meta directory.

Some elements of the blog other than content itself must also be translated. The
translations use the file `strings.yaml` which must contain hashes of the
following structure: string - language - translation.

The sidebar links are specified in `links.yaml`. They can point either to metas
or to any external address.

## Examples

All the examples assume `https://blog.example.com/` to be the root address of
the blog.

### Articles

This article spread across two files for two languages will be displayed under
the URL `https://blog.example.com/2015/01/03/myarticle`:

`2015-01-03-myarticle/en.md`:

```markdown
# My article

This is the article content in English.
```

`2015-01-03-myarticle/zh.md`:

```markdown
# 我的文章

这是该文章的中文内容。
```

### Metas

This is an example of a meta that will be displayed under
`https://blog.example.com/about`:

`meta/about/en.md`

```markdown
# About the blog

This is the site introduction in English.
```

`meta/about/zh.md`

```markdown
# 关于博客

这是该网站的中文介绍。
```

### Strings

This is an example of string translation file, `strings.yaml`:

```yaml
home:
en: Home
zh: 首页
```
### Links
An example of links file, `links.yaml`:

```yaml
- page: about
- url: https://www.yandex.ru
text:
en: Yandex
ru: Яндекс
- url: https://www.github.com
text: GitHub
```
6 changes: 6 additions & 0 deletions app/Main.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Main where

import AppMain

main :: IO ()
main = multiblog
9 changes: 9 additions & 0 deletions install-deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

apt update
apt install --yes xvfb wget

TMP_DEB=$(mktemp --suffix .deb)
trap 'rm -f $TMP_DEB' EXIT INT TERM HUP
wget -O "$TMP_DEB" https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.jammy_amd64.deb
apt install --yes "$TMP_DEB"
81 changes: 81 additions & 0 deletions package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: multiblog
version: '0.1'
synopsis: Blog engine for koterpillar.com
description: Static blog engine with multilingual support
category: Web
author: Alexey Kotlyarov
maintainer: [email protected]
license: MIT
language: GHC2021
default-extensions:
- FunctionalDependencies
- OverloadedStrings
- QuasiQuotes
- RecordWildCards
dependencies:
- base >=4.7 && <5
- blaze-html
- blaze-markup
- bytestring
- containers
- data-default-class
- feed
- happstack-server
- iso639
- mtl
- pandoc
- pandoc-types
- resourcet
- text
- time
- xml-conduit
- xml-types
- yaml
library:
source-dirs: src
dependencies:
- aeson
- directory
- filepath
- here
- http-conduit
- lens
- lifted-base
- network
- process
- process-extras
- shakespeare
- split
- tagsoup
- transformers
- unix
executables:
multiblog:
main: Main.hs
source-dirs: app
dependencies:
- multiblog
ghc-options:
- -Wall
- -Werror
- -threaded
- -rtsopts
- -with-rtsopts=-N
tests:
tests:
main: TestMain.hs
source-dirs:
- testsuite
dependencies:
- generic-arbitrary
- hspec
- hspec-expectations
- HUnit
- multiblog
- tasty
- tasty-hunit
- tasty-discover
- tasty-quickcheck
- QuickCheck
- quickcheck-instances
stability: Experimental
13 changes: 13 additions & 0 deletions renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
$schema: "https://docs.renovatebot.com/renovate-schema.json",
extends: [
"config:recommended",
"github>koterpillar/renovate-haskell:default.json5",
],
packageRules: [
{
matchFileNames: ["Dockerfile"],
semanticCommitType: "fix",
},
],
}
Loading

0 comments on commit b7ef17c

Please sign in to comment.