/share.typ

A template to create awesome short writings to share in social media thanks to Typst simple yet powerful syntax

MIT LicenseMIT

share.typ

MIT License

A template to create awesome short writings to share in social media thanks to Typst simple yet powerful syntax.

Demo

Example Post

Usage

share.typ is intended to be used by importing share.typ file from a "content" file (example.typ as example). This content file is used to call the functions which apply document style & show post components and load post data from a YAML file (example.yml as example). Inside the content file you can modify several style variables and even override existing function implementations to your heart's content.

With Typst CLI (Recommended)

The recommended usage with Typst CLI is by adding this share.typ repository as a git submodule. This way, upstream changes can be pulled easily.

<your-post-repo>/
├── share.typ/ // git submodule 
|   └── share.typ
├── post/ // post YAML directory
|   ├── 01-post-one.yml
|   ├── 02-post-two.yml
|   └── ...
└── <your-post-content>.typ // #import "share.typ/share.typ": *
  1. Add mangkoran/share.typ as git submodule into your repo.
git submodule add https://github.com/mangkoran/share.typ
  1. Copy and rename example.typ and example.yml to your repo root directory. For post YAML file you can create a new directory (post or else) for better organization. Don't forget to update the YAML import to reflect this. Use these files as template/starting point for your post.
  2. Compile content file. Typst compiles to PDF by default. To compile Typst to PNG, use the following command.
typst compile <your-post-content>.typ <output>.png

# or you can use `watch` command to auto recompile on change 
# (a bit buggy tho especially with vi/vim/nvim)
typst watch <your-post-content>.typ <output>.png
  1. Upload the share.typ, example.typ and example.yml files to your Typst project. You may rename example.typ and example.yml. For post YAML file you can create a new directory (post or else) for better organization. Don't forget to update the YAML import to reflect this.
  2. Use example.typ and example.yml (or whatever the names after you rename it) as template/starting point for your post.