All Projects → icidasset → shikensu

icidasset / shikensu

Licence: MIT license
Run a sequence of functions on in-memory representations of files.

Programming Languages

haskell
3896 projects

Projects that are alternatives of or similar to shikensu

Gatsby Docker
Develop & Build GatsbyJS static sites within Docker.
Stars: ✭ 184 (+1315.38%)
Mutual labels:  static-site
Docs
Repository of Twilio SendGrid's product documentation.
Stars: ✭ 221 (+1600%)
Mutual labels:  static-site
Statiq.framework
A flexible and extensible static content generation framework for .NET.
Stars: ✭ 251 (+1830.77%)
Mutual labels:  static-site
Moerail
铁路车站代码查询 × 动车组交路查询
Stars: ✭ 186 (+1330.77%)
Mutual labels:  static-site
Openlivewriter
An open source fork of Windows Live Writer
Stars: ✭ 2,398 (+18346.15%)
Mutual labels:  static-site
Serve
a static http server anywhere you need one.
Stars: ✭ 233 (+1692.31%)
Mutual labels:  static-site
Startup Landing
Collection of free top of the line startup landing templates built using react/nextjs/gatsby. Free to download, simply edit and deploy! Updated weekly!
Stars: ✭ 176 (+1253.85%)
Mutual labels:  static-site
asws
Another static web server, plus JSON REST API for exposing specified directory listings. Useful for download pages or listings asset for web applications.
Stars: ✭ 21 (+61.54%)
Mutual labels:  static-site
Peco
nothing here, move on..
Stars: ✭ 213 (+1538.46%)
Mutual labels:  static-site
Suri
Your own link shortener that's easily deployed as a static site (for free)
Stars: ✭ 249 (+1815.38%)
Mutual labels:  static-site
Eleventy Starter Ghost
A starter template to build websites with Ghost & Eleventy
Stars: ✭ 187 (+1338.46%)
Mutual labels:  static-site
Jekyll Doc Theme
Jekyll theme for creating project documentation websites
Stars: ✭ 203 (+1461.54%)
Mutual labels:  static-site
Fullstackpython.com
Full Stack Python source with Pelican, Bootstrap and Markdown.
Stars: ✭ 2,667 (+20415.38%)
Mutual labels:  static-site
Nuxt Netlify Cms Starter Template
⚡ Build server-less, static websites with Vue.js and Netlify CMS.
Stars: ✭ 186 (+1330.77%)
Mutual labels:  static-site
microstat
A self-hosted Micropub endpoint for statically-generated microblogs. 📝⚡️
Stars: ✭ 52 (+300%)
Mutual labels:  static-site
Nikola
A static website and blog generator
Stars: ✭ 2,221 (+16984.62%)
Mutual labels:  static-site
Learn To Send Email Via Google Script Html No Server
📧 An Example of using an HTML form (e.g: "Contact Us" on a website) to send Email without a Backend Server (using a Google Script) perfect for static websites that need to collect data.
Stars: ✭ 2,718 (+20807.69%)
Mutual labels:  static-site
jodd-site
Jodd site and documentation in plain markdown.
Stars: ✭ 16 (+23.08%)
Mutual labels:  static-site
jasper2
Full-featured Jekyll port of Ghost's default theme Casper v2 👻
Stars: ✭ 725 (+5476.92%)
Mutual labels:  static-site
Elegant
Best theme for Pelican Static Blog Generator
Stars: ✭ 241 (+1753.85%)
Mutual labels:  static-site

Shīkensu

シーケンス
Sequence

Run a sequence of functions on in-memory representations of files.
Build static websites with ease, without conforming to a specific structure.

Markdown example

import Shikensu
import Shikensu.Contrib (clone, copyPropsToMetadata, permalink, renameExt, renderContent)
import Shikensu.Contrib.IO (read, write)

import Data.ByteString (ByteString)
import Flow
import Prelude hiding (read)
import qualified Data.Text.Encoding as Text (decodeUtf8, encodeUtf8)


main :: IO Dictionary
main =
  -- This IO operation will read the files matching the glob pattern `src/**/*.md`,
  -- transform them (see the `flow` function) and then write them to the `build` directory.
  dictionary_io


dictionary_io :: IO Dictionary
dictionary_io =
    Shikensu.listRelative ["src/**/*.md"] "./"
        >>= read
        >>= flow
        >>= write "./build"


flow :: Dictionary -> IO Dictionary
flow =
       renameExt ".md" ".html"
    .> permalink "index"
    .> clone "index.html" "200.html"
    .> copyPropsToMetadata
    .> renderContent markdownRenderer
    .> return


markdownRenderer :: Definition -> Maybe ByteString
markdownRenderer def =
    content def
        |> fmap Text.decodeUtf8
        |> fmap Markdown.render
        |> fmap Text.encodeUtf8

This lists all the markdown files in the ./src directory
and then does the following in this exact order:

  1. Change the extension of each matched file to .html.
  2. Change the path of each matched file to %matched_path/%file_basename/index.%file_extension.
  3. Make an in-memory copy of the file that has the index.html path.
  4. Copy the information of each definition (aka. file) to its metadata "object" (so we can use that information in our content renderer).
  5. Map the content property of each definition (in this case we are rendering markdown).
  6. {post-flow} Write to the ./build directory.

Why?

Because this allows me to easily define a workflow for building a static website, and more specifically:

  • Have a clear overview of what's happening.
  • Do a bunch of actions in memory and then write it to disk in one go.
  • Have a list of information about the other files in the project which can then be shared with, for example, templates.

Usage examples

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].