unisonweb / unisonweb-org

Source for the unisonweb.org website
https://unisonweb.org
Other
40 stars 61 forks source link

:warning: This repository is no longer active! https://unisonweb.org redirects to https://unison-lang.org which hosts https://github.com/unisonweb/website.


Local Development Environment Setup

  1. Install node 8.13.0

    brew install n && n 8.13.0
  2. Install yarn

    npm install -g yarn
  3. Clone this repository

    git clone https://github.com/unisonweb/unisonweb-org.git
  4. Install dependencies

    cd unisonweb-org && yarn install
  5. Create .env file

    cp .env.example .env
  6. Update .env variables

    ALGOLIA_INDEX_NAME=
    ALGOLIA_APP_ID=
    ALGOLIA_SEARCH_ONLY_KEY=
    ALGOLIA_ADMIN_KEY=

    These variables can be found in the following locations:

  7. Install gridsome

    yarn global add @gridsome/cli
  8. Start local webserver

    gridsome develop

Netlify Hosting

Adding New Members

New members may be added to Netlify on the "Members" tab of the Unison Computing team.

Snippet Injection

Script analytics may be added to the site on the "Post processing" section of Settings > Build & Deploy in the Netlify Dashboard.

Documentation: https://www.netlify.com/docs/inject-analytics-snippets

Deploy Contexts

Form processing

Flipping DNS

  1. Add a custom domain.
  2. In your DNS settings, add a CNAME record with a name of "www" and a value of "unisoncomputing-com.netlify.com".
  3. Wait for DNS to propogate (usually < 5 mins).
  4. Website is live.

Content Editing

All editable content is located in src/data/.

Website Colors

The names and hex values for all colors used across the site are located in src/data/colors.yml. To change a color, simply call the palette() function with the name the color you'd like to reference.

.element {
  color: palette(purple);
}

By default, the palette() function will return the base hex value (defined the src/data/colors.yml). Optionally, you may pass a second argument to return the value of the related tone.

.element {
  color: palette(blue, dark);
}

All available tones are defined in src/assets/styles/config/_palettes.scss, and are listed below for your convenience:

Codeblocks

Codeblocks may include (optional) frontmatter for altering their appearance:

```unison
---
title: output
filename: filename
---
42, 9.7, 1e100, "hello", +99, -42, true, false -- various literals

`title` can be any value with eight (8) characters or less. If the value of the `title` is set to `output` or `ucm`, the codeblock will be rendered with an alternate icon.

`filename` can be any value with fifty (50) characters or less.

By default, codeblocks are rendered with line numbers. Line numbers may optionally be changed to carets with `show-carets: true`, or hidden altogether with `show-numbers: false`.

Colors for syntax highlighting in codeblocks are defined in `src/assets/styles/common/codeblock/_tokens.scss`:

```scss
.token {

  @at-root .un-codeblock & {

    &.comment { color: palette(gray, light); }
    &.char {}
    &.string { color: palette(black); }
    &.keyword { color: palette(green); }
    &.import_statement {}
    &.builtin { color: palette(blue); }
    &.number { color: palette(green); }
    &.operator { color: palette(green); }
    &.hvariable { color: palette(gray, xx-dark); }
    &.constant { color: palette(purple); }
    &.punctuation { color: palette(pink); }

  }
}

Regex patterns to identify tokens are defined here: https://github.com/unisonweb/prism/blob/master/components/prism-unison.js.

Eventually, the regex patterns need to be updated to match the Unison language. Once complete, a PR should be submitted to include Unison syntax highlighting in the main repository.