An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 9.0% on proxy.golang.org

proxy.golang.org : github.com/ancientlore/whisper

whisper implements a simple web server aimed at small websites. In general, whisper serves static content from the location it's found - making it easy to structure your site how you want. There is special handling for certain content like Markdown files. See the example folder for a sample site layout. In general, whisper uses conventions instead of configuration files. Conventions used by this server include: * The template folder holds HTML templates, using Go's html/template package. These templates are used for rendering content but never served directly. * A sitemap.txt can be created as a template. See the example for details. * The default page for a folder is a Markdown file called index.md. * An optional whisper.cfg file holds settings should you want to preserve them. * Files 404.md and 500.md can be provided for custom errors. Web pages are generally written in Markdown and use HTML templates to render into the site. The default template to use is called "default"; you must have a "default" template and an "image" template. Templates are stored in the "template" folder. NOTE: If no "template" folder is found, then default templates are loaded named "default" and "image". You probably don't want these because they are extremely basic, but it's okay for just messing around and viewing Markdown locally. Markdown may contain front matter which is in TOML format. The front matter is delimited by "+++"" at the start and end. For example: Front matter may include: Front matter is used for sorting and constructing lists of articles. whisper uses standard Go templates from the "html/template" package. Templates are passed the following data: Page is information about the current page, and FrontMatter is the front-matter from the current Markdown file. Content contains the HTML version of the Markdown file. Functions are added to the template for your convenience. File is defined as: If File is not a Markdown file, then FrontMatter.Title is set to the file name and FrontMatter.Date is set to the modification time. The array is sorted by reverse date (most recent items first). Note that FrontMatter.OriginalFile is very useful because, for image templates, it will hold the name of the image file. You probably want to use it in the template. Folders named "photos", "images", "pictures", "cartoons", "toons", "sketches", "artwork", or "drawings" use a special handler that can serve images using an HTML template called "image". It's not a goal to make templates reusable. I expect templates need editing for new sites. It's not a goal to automate creation of the menu. It's not a goal to be a fully-featured server. I run https://caddyserver.com/ in front of it. For more information take a look at the virtual package, which implements a virtual filesystem that handles rendering markdown into HTML.

Registry - Source - Documentation - JSON - codemeta.json
purl: pkg:golang/github.com/ancientlore/whisper
License: Apache-2.0
Latest release: 4 months ago
First release: over 4 years ago
Namespace: github.com/ancientlore
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 14 days ago

    Loading...
    Readme
    Loading...