GithubHelp home page GithubHelp logo

srid / zulip-archive Goto Github PK

View Code? Open in Web Editor NEW
13.0 5.0 1.0 8.99 MB

Zulip Archive viewer (statically generated HTML)

Home Page: https://funprog.srid.ca

Haskell 77.36% Nix 21.50% Dhall 0.93% Shell 0.21%
zulip static-site functional-programming

zulip-archive's Introduction

zulip-archive

Zulip archive viewer written in Haskell, using the rib static site generator.

Demo

Prerequisites

First, install the Nix package manager:

bash <(curl https://nixos.org/nix/install)

Optionally, enable the Nix cache if you would like to speed up local builds:

# If you do not already have cachix, install it:
nix-env -iA cachix -f https://cachix.org/api/v1/install
# Enable nix cache for rib
cachix use srid

Zulip API Key

Get your API key for zulip (instructions here). Note: you are looking for your API key, and not a bot's API key.

Running

First, create a configuration file, adding your Zulip site settings (including the API key):

cp config/config.example.dhall config/config.dhall
vim config/config.dhall

NOTE: You can also pass the contents of the config file in the environment variable ZULIP_ARCHIVE_CONFIG which takes precedence over the config file. This can be used to setup GitHub Pages workflow (see ./.github/workflows).

To build and run the site:

bin/run

Go to http://localhost:7004 to view your generated site.

Manual update

User uploaded files are unavailable via the API. They must be manually exported (needs admin rights), and copied to ./site/user_uploads.

zulip-archive's People

Contributors

prikhi avatar srid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

prikhi

zulip-archive's Issues

Support custom instance logos

Not sure if it is possible to get via Zulip API, but it would be nice to be able to show instance logo on top of archive page, together with custom favicon in tab card.

Support user_uploads

For example, images are uploaded in this topic: /haskell/selective-functor-paper-example.html

And it currently renders as:

image

Add Structured Markup to Pages

This would help display posts as rich results in search result pages:
https://developers.google.com/search/docs/guides/intro-structured-data
https://schema.org/docs/schemas.html

The few relevant types I can think of:

Stream blacklist

Allow some streams to be blacklisted. Which means they should not have their HTML generated, and be excluded from the main index.

For eg., #haskell-beginners (because it is now locked and unused).

Add Sitemap File

A sitemap of all the threads would help crawlers and improve search engine discovery. You can point crawlers to the sitemap using the Sitemap: <full-url> directive in a robots.txt file, or by sending them a ping. A sitemap can have a maximum of 50,000 URLs. Beyond that, you need to generate a sitemap index file that points to the different sitemaps.

Not sure if this is a rib issue or a zulip-archive issue, but you could leverage this package I published recently to build the sitemaps and sitemap index: https://hackage.haskell.org/package/sitemap-gen

OGP - "description" should be plain text

The description field is currently set to a HTML value, as such it doesn't seem to appear in link preview.

Zulip API can return the original Markdown format. Setting apply_markdown to true in /api/get-messages will get the original format. But we need the HTML as well, so maybe this API should be invoked twice.

Once both the formats are stored in the Message object (and consequently messages.json) we can use the markdown format in OGP description.

GitHub Pages support

Create a Actions workflow that automatically deploys generated .html files to GitHub Pages (in a separate repo).

Should probably use docker image of zulip-archive (built via nix).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.