Giter VIP home page Giter VIP logo

frog's Introduction

Frog

Happy Green frog

Frog image by @Goug8888, used under Creative Commons license Attribution-NonCommercial-ShareAlike 2.0 Generic.

CI raco pkg install frog MIT License Documentation

Frog is a static web site generator written in Racket.

You write content in Markdown or Scribble. You generate files. To deploy, you push them to a GitHub Pages repo (or copy them to Amazon S3, or whatever).

Posts get a variety of automatic blog features.

You can also create non-post pages.

Pygments handles syntax highlighting for code blocks.

The generated site uses Bootstrap, which is responsive, automatically adapting to various screen sizes.

Full documentation.

What to expect in the future

TL;DR: This project is in low-maintenance mode.

I have enjoyed working on Frog for many years. In the beginning, it was intended to be a "just-works", "any color you want, so long as it's black" simple application.

I envisioned it as an application that happened to be written in Racket -- which some people might use even if they weren't Racket programmers. That didn't happen. At the same time, it evolved to be more configurable. And finally to use a #lang for configuration. At which point it felt more like what is really was: A tool for Racket programmers to do a static blog.

Eventually I felt even that was too complicated, and my own blog should simply be a Makefile driving a few pieces of code inherited from Frog. In other words, I no longer use Frog for my own blog.

As a result, although you're welcome to open issues about new features or off-label uses, please don't expect much. I expect I will still try to fix bugs, at least as/when I have time and I believe a fix would not result in more and/or worse bugs.

As I write this in July 2019, I think the situation has already been clear from the repo activity for a long time. Even so, I want to be super up-front about where the project is headed, or not. That way people can make an informed choice how to spend their limited time and energy.

Finally a big thank you to people who contributed things over the years.

frog's People

Contributors

avelino avatar bmastenbrook avatar dedbox avatar eeide avatar gasche avatar gerdint avatar greghendershott avatar jaor avatar jbclements avatar jeff66ruan avatar k4rtik avatar khinsen avatar leifandersen avatar nprescott avatar offby1 avatar olleolleolle avatar pb82 avatar phaer avatar renaissancebug avatar rfindler avatar royallthefourth avatar sleibrock avatar soegaard avatar sorawee avatar sstrickl avatar tfeb avatar wilbowma avatar winny- avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

frog's Issues

Missing body text

I noticed that as of my latest pull, the first two posts does not display the text before the marker, nor does it display any body of the text. It only shows the title of the post.

I was able to confirm this with my own posts, and with the included example directory.

No build after most recent pull.

The following is what I get when I run frog -b:

Frog 0.7
Using configuration /home/rmm/tmp/.frogrc
meta-data: A post must have Title/Date/Tags meta-data

Error on raco frog -bp

Running mac osx Mavericks and Racket 5.3.6 raco frog -bp generates the following error:

list->string: contract violation
expected: (listof char?)
given: '((# # #`) #\newline)

any help would be gratefully received. A Racket newbie!

pygments existence

How exactly does frog determine the existence of pygments? I read in pygments.rkt, under the procedure start-pygments-process, that it does something to determine the availability of pygments.

Running frog, yields the following:

...
Pygments not installed. Using plain `pre` blocks.
...

Add verbosity levels

Currently it's extremely verbose. Replace the eprintf calls with two or three levels of verbosity.

"don't know how to render value: #<procedure:date>"

@shriphani reports: https://gist.github.com/shriphani/7590361

output: don't know how to render value: #<procedure:date>
  context...:
   /Applications/Racket/collects/scribble/text/output.rkt:125:2: loop
   /Applications/Racket/collects/scribble/text/output.rkt:119:6: for-loop
   /Applications/Racket/collects/scribble/text/output.rkt:113:2: output-block
   /Applications/Racket/collects/scribble/text/output.rkt:37:0: output4
   /Applications/Racket/collects/racket/port.rkt:125:0: with-output-to-string
   /Users/shriphani/Library/Racket/5.3.6/pkgs/installed/frog/frog/frog.rkt:168:0: write-post-page
   /Users/shriphani/Library/Racket/5.3.6/pkgs/installed/frog/frog/frog.rkt:611:0: build
   /Applications/Racket/collects/racket/cmdline.rkt:462:12: loop
   /Users/shriphani/Library/Racket/5.3.6/pkgs/installed/frog/frog/frog.rkt: [running body]
   /Applications/Racket/collects/raco/raco.rkt: [running body]
   /Applications/Racket/collects/raco/main.rkt: [running body]

However I can't reproduce: https://gist.github.com/greghendershott/7591917

In the process of building his blog I did see and fix two other issues:

But I can't repo this issue. I did try this: 2449f9b but @shriphani reported it didn't resolve the issue.

Configurable summary or full post for Atom feeds

Currently the Atom feeds show only the portion of the post above the <!-- more --> marker (if any) with a "Continue reading..." link. Make this configurable to allow the option of including the full posts.

@codeblock text is not using the correct font face

While using Scribble files, instead of Markdown, I noticed that text using @codeblock does not correctly used fixed-width fonts. I tried that, too, with the sample file included and I get the same behavior.

Use ARIA roles

Make sure the generated HTML uses ARIA roles for accessibility.

While the hood is open: Also look for any HTML5 semantic elements that could be used, e.g. <main> for the main content div.

Browser fails to launch on a non-Debian *nix

The procedure preview uses "sensible-browser", presumably to run the web browser. This works quite well on Debian and Debian-based systems. However, it is not universal -- some systems do not use that convention.

Footnote links don't work in feeds

Links to and from footnotes don't work in feeds (neither Atom nor RSS).

I need to think about it more to understand if this even could work satisfactorily.

If not--or in the meantime--two obvious options:

  1. Change the links from relative to absolute. As a result, clicking one would take you away from the feed reader to the original web site page.
  2. Disable the links entirely:
    • Show the footnote numbers, but they're not links.
    • Show the footnote definitions, but without any ↩ return links.

Test on Windows

The main area I'd expect any problems is path names. It's possible that converting from local file system paths to URI will result in \ instead of / in the URI paths.

This should be localized in the abs->rel/www function. Although not rocket science, it's probably not quite as simple as that. Just need time, and dust off my Windows laptop. If anyone else wants to take a crack at this, first, a pull request would be welcome.

Navbar item might not get "active" class

For example if an item in navbar.md is:

- <a href="/index.html" class="brand">My _Awesome_ Blog</a>

Our match fails two ways:

  1. Assuming the a element will only have an href attribute.
  2. Assuming the contents of the a element is a single element (one string).

Make it more flexible in matching and preserving the attributes and elements.

λ not rendered by Pygments?

@dherman reports that λ isn't being rendered by Pygments; he's using Pygments 1.6 in case that matters.

I can't repro this myself (at least not with Pygments 1.5).

In markdown like this:

Here is a lambda: λ.

Here is a lambda: `λ`.

And here:

    (λ () #t)

And here:

```racket
(λ () #t)
```

And here:

```scheme
(λ () #t)
```

I get the λ in every case in the HTML output.

Provide a way to specify title for non-post pages

For starters, use the first h1 header in the markdown, such as # I am a heading as the page title.

For the future, consider adding "front matter" indented code block like that used for post pages:

    Title: The Page Title

Although for non-post pages it would be optional.

Allow the post permalink pattern to be configurable

This way, people migrating from an existing blog don't need to 301 redirect everything.

See for example: http://jekyllrb.com/docs/permalinks/

Requested by @dherman, who at a minimum would like the Octopress default style, which IIUC is /blog/YYYY/MM/DD/filename-without-md-extension/. (Note: This actually means /blog/YYYY/MM/DD/filename-without-md-extension/index.html -- every post is an index.html file alone its own directory -- and, any links we create should be to that /blog/YYYY/MM/DD/filename-without-md-extension/ directory, not to the index.html file. Also, note the extra blog directory below the site root.)

allow favicons of multiple image type

I believe frog is hard-coded to require favicon.ico, but favicons can use other image types like .png. It'd be great to make this configurable in .frogrc.

Allow a configurable top nav bar.

Currently it's hardcoded to show Home and About.html.

Support a _src/navbar.md file that allows defining the navbar. Since it's Markdown, this could simply be a list of links. For example:

- [Home](/index.html)
- [Products](/Products/index.html)
  - [Hot Product A](/Products/HotA.html)
  - [Hot Product b](/Products/HotB.html)
- [Support](/Support.html)
- [About](/About.html)

That gets translated into Bootstrap nav menu bar.

smart quotes

This might be hard, but it'd be awesome to support automatic smart quotes.

Add post tags to meta keywords

For post pages, should take the tags and put them in meta keywords for the generated page.

Racket:

`(meta ([name "keywords"][content ,post-tags]))

HTML:

<meta name="keywords" content=",foo,bar,baz">

Note that non post pages don't have any meta-data. Hmmm, maybe they should (or optionally could) have it. The Title: and Tags: would be usable (if not necessarily Date:). But this would be a separate feature issue.

Configurable summary or full post for index pages

Currently the index pages show only the portion of the post above the <!-- more --> marker (if any) with a "Continue reading..." link. Make this configurable to allow the option of including the full posts.

Include Racket HEAD in Travis CI build matrix

As suggested by @samth. A particularly good idea when close to another release of Racket (as now).

Preferably use a nightly build (so that this doesn't become a Travis CI test of building Racket, too). For example:

http://www.cs.utah.edu/plt/snapshots/current/installers/racket-5.90.0.9-x86_64-linux-precise.sh

Only hitch is that the version number -- in this case 5.90.0.9 -- is embedded in the URL. In other words AFIK there is no URL meaning "the latest nightly build". In that case I'd have to keep updating .travis.yml, which would bite.

Distinct `date` and `tags` variables for post-template.html

The date+tags variable is handy if you like it preformatted that way. But also supply separate date and tags vars. Probably date should be the date string (as Frog stores it anyway), but tags should be a (listof string?), to make it easier for people to do as they like.

Specifically requested by @dherman

Ordered collections of pages that aren't blog posts

It might be tempting to use Frog for an ordered collection of pages that aren't blog posts. Example applications:

  • A presentation (instead of PPT)
  • A series of instructional pages on a how-to web site.
  • A little photo gallery whizzy-whatcha.

If you're tempted to try, it's a kludgy mess. Sure you could create each slide or page as a blog post. But to order them, you have to give them "dates" ... and in reverse order. Meh.

Also, you probably prefer to have just one .md source file for the whole series of pages. (I think this is certainly true for the presentation use-case, and probably true for the others.)

Non-post pages

  • Create a .md (or .scrbl) file anywhere under _src.

  • Although non-post pages don't have meta-data (a.k.a. front matter), now they optionally could:

    Title: title
    Date: date
    Multi-page:
    

    Note that Tags is N/A for non-postpages. The key is the Multi-page item, which means to process it into multiple pages. Let's say the file is foo.md.

    • It becomes one or more pages in a subdirectory of the file's base name, foo/. So, foo/1.html, foo/2.html, and so on. Better: Slug the title of each one. So, foo/slug-of-page-1-title.html, and so on.
    • Within the source file, some directive indicates a page break. Some ideas:
      • Level 1 headings. Benefits:
        • Fits an "outline" model.
        • Provides the title for each page.
      • An HTML comment such as <-- page -->. (precedent: <-- more -->).
    • The resulting pages have previous / next buttons to nave among them. Also an up button.
    • A foo.html is generated at the same level as foo.md. It's a little index file with TOC or whatever. Perhaps it's everything up to the first page directive. Details, details.

Works with blog posts, too?

Although the original motivation was non-blog-post pages, I suppose that's orthogonal. Such a file could be a blog post (under _src/posts). The post page would be the index page with TOC and a little content. The prev/next at that top level would still be among other blog posts. The only difference from a single-page blog post is that most of the content would be spread among the sub-pages. Of course those sub-pages would prev/next among themselves.

In this case the Multi-page: flag would be an optional extension to the existing meta-data (Title, Date, Tags).

Scribble equity?

Scribble already knows how to create multiple HTML pages from a single .scrbl source. If a Multi: field is added to metadata for .md sources, probably we should try to honor that .scrbl sources, too. This would mean running Scribble once to get at the metadata, and (possibly) re-running it if a Multi field is found. But, so what.

Use some form of magic to avoid or minimize shelling out to Pygments

Shelling out to Pygments for each code block takes some non-trivial amount of time. Another approach would be better (although at this point I think it would be more of a nice-to-have than a must-have -- the performance isn't that bad).

It's been interesting to watch pygments.rb (used by GitHub) deal with similar. Originally they shelled out like we're doing now. Then they used a Python embedded in Ruby. Then they switched to keeping Pygments running and piping to it. I imagine the last approach would be the way to go -- if we actually need to be much faster.

directory watching

Modern web generation tools (like SASS, less, CoffeeScript, Octopress, etc) usually offer some sort of "directory watching" functionality, where you can run the generator in an active mode that automatically detects file changes and regenerates the site. It'd also be great for this to work in conjunction with Issue #26 to only regenerate the changed pages.

No build happens when there are no non-DRAFT items in _src/posts/

When no items are found in the directory _src/posts/, without the tag DRAFT, Frog halts the build process, then displays the message below. That means, at the moment, it becomes mandatory to have a least one "post" page, than can be built, whether it will be used, or not.

drop: index is too large for list
  index: 1
  list: '()
...

Not degrading gracefully when Pygments not installed

EDIT The original bug report was resolved by getting latest sources. In the discussion it turned out there was another bug, that Frog wasn't handling absence of Pygments. I'm editing the title of the bug so it makes sense when I close it. -- Greg

After pulling the latest changes, then running frog -w, I noticed that the link to Home is now gone, and instead replaced on the right with the text /index.html &active-uri-path. An example is shown here.

Get Bootstrap responsive mode working, and make it a configurable option

Currently the responsive? parameter (which selects alternative Bootstrap CSS and JS files, and uses "fluid" container and row classes) is hardcoded to #f and not loaded from .frogrc.

The reason why: When it's #t, the browser acts like it can't find the CSS file at all.

I had this working before with a hand-coded version of my site. It's probably some stupid little bug.

It would be good to get it working, because the responsive grid and fluid elements smartly reflow for smaller screens including tablets and phones. Although not the only reason for using Bootstrap, it's one of the major ones.

Paginate indexes

Index pages currently show all posts in one page. Add ability to paginate to N per page, with older/newer navigation.

meta-data: Missing meta-data

Relative to commit a4c39d9

The introduction of new match rules breaks existing markdown "post" files.

Prior to that commit, a post file would look something like this:

    Title: The Y Combinator in Six Easy Steps
    Date: 2013-05-09T12:43:11
    Tags: scheme, racket, lisp, programming

Blah Blah Blah

But the new match rules, in frog.rkt can't properly match it, thus raising the error.

Specify page location for "all posts" index page

I would like to generate a site that includes a blog, rather then a site that is a blog. So I would like to have full control over the top level index page, and then have the blog or "all posts" index page at a different url, like /blog/index.html

I think the change would mean a new configuration option in .frogrc,

Default to index.html to keep the existing behavior

all-posts-index = index.html

and then use the setting in frog.rkt around line 641.

Great job BTW.

scripts at the bottom

I'm not sure how much it matters in practice for frog's included JS, which is written by Google and Twitter and probably runs quickly, but it's best practice to put scripts at the bottom of a page body:

http://stevesouders.com/examples/rule-js-bottom.php

Not sure if it works to include boostrap's JS at the bottom (I had trouble finding anything about it from Googling), but I'm pretty sure you can put the Google Analytics script at the bottom.

Unintended buleting

If a line starts with with two stars (heavy emphasis), it becomes a bullet instead.

This issue may or may not be posted to the markdown parser, instead.

avoid recompilation based on timestamps

It'd be great to avoid regenerating files when their dependencies haven't changed. For each markdown file source, this would probably need to be based on something like:

max({ lastmodified(file) | file in JS, CSS, { source } })

as compared with the generated HTML file.

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.