Code Monkey home page Code Monkey logo

generate-roam-site-action's Introduction

Generate Roam Site Action

A GitHub action for generating a static site from a Roam Graph.

Inputs

roam-username

Required Your Roam username

roam-password

Required Your Roam password

roam-graph

Required Your Roam Graph

Usage

uses: dvargas92495/[email protected]
with:
    roam_username: [email protected]
    roam_password: ${{ secrets.ROAM_PASSWORD }}
    roam_graph: dvargas92495

Most other configuration happens from your Roam DB, on a page called roam/js/public-garden. The following configuration options are supported:

  • Index - The page name that will serve as the entry point of the site. Could be raw text or a page link.
  • Filter - A set of rules that specifies which pages to build. If a page matches any child rule, it will be built into the site. The following rules are supported:
    • Starts With - If a page starts with the given text, it will be included in the site. Useful for namespacing, e.g. Article/Article.
    • Tagged With - If a page contains a tag with the given text, it will be included in the site. Includes pages with any form of tags or attributes. Could be raw text or a page link.
  • Template - An HTML Code block that will be used as the template for every generated HTML file.
    • It supports a few variables that can be interpolated:
      • PAGE_NAME - The name of the page
      • PAGE_CONTENT - The content of the page
    • The default template looks like
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>${PAGE_NAME}</title>
</head>
<body>
<div id="content">
${PAGE_CONTENT}
</div>
</body>
</html>

Here's an example configuration, that uses the Personal Website page as the entry point and includes all pages that start with a P:

  • Index
    • Personal Website
  • Filter
    • Starts With
      • P

Here's an example configuration, that uses the Blog Post page as the entry point and includes all pages that are Tagged with Blog Post:

  • Index
    • Blog Post
  • Filter
    • Tagged With
      • Blog Post

You could ignore specific blocks in pages that are included. Nest everything that you would like to keep on the page but have filtered out of the static site under a block that just says [[roam/js/public-garden/ignore]].

I have an example repository showcasing this action. The resulting site is reachable at https://garden.davidvargas.me.

generate-roam-site-action's People

Contributors

dvargas92495 avatar mschrader15 avatar

Watchers

 avatar

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.