3 min

Wren - Static blog generator

Mar 1, 2016

Thinking about this. I will base it upon my Article Preview app, created back in January and the test static page site, created with a command prompt script, created in February.

http://article.soupmode.com

http://article.soupmode.com/static

Need:

  • create and update markup.
  • when updating, a backup of the markup is created when the content is saved.
  • convert markup to html. a separate process or converted at the same time markup is saved, like i do with my database-backed web publishing apps?
  • maintain a master list of articles with title, slug, date, possibly in JSON format. this would be used to create the list of archives pages. index.html would not be a part of this. index.html will be created like a normal article page.
  • when is the list of archives pages created? at the time an article is created/updated or is it a separate step?
  • need a login mech and auth check, probably similar to my apps that only require an email address to log in. mailgun will be used to send the login session activation link. cookies will bet set and checked.
  • use google or duckduckgo to index the site for search.
  • maintain tag pages for tag search.

Things to include:

Add:

These commands would be used to override defaults. Normally, the slug would be taken from the post's title. Default directory location for html and txt files and the default post template would be listed in the yaml file.

  • slug=this-is-a-test (used for .html and .txt files)
  • dir=/2016/03/02 or /blog or /contact (create directory if it does not exist)
  • template=index-banner (.tmpl will be added by app.)

Formatting Commands

Used at Article Preview app at http://article.soupmode.com

Samples:
http://jothut.com/cgi-bin/junco.pl/blogpost/65125/Article-format-app

Can use either Markdown/Multimarkdown or Textile. The markup chose depends upon how the title line is created. The title line is the first line in the markup. If it begins with a pound sign, the markup uses Markdown. If the title line begins with h1. then the markup uses Textile.

Commands that can be used within the markup:

css.
(code)
css..

toc=yes|NO

using_css=YES|no

tint_image_header=yes|NO

title_over_image=yes|NO

publish_info_at_top=yes|NO

url_to_link=YES|no

hashtag_to_link=yes|NO

newline_to_br=YES|no

headings_as_links=yes|NO

aside=text

imageheader=url

largeimageheader=url

https://www.digitalocean.com/community/tutorials/understanding-nginx-server-and-location-block-selection-algorithms

https://www.digitalocean.com/community/tutorials/how-to-configure-the-nginx-web-server-on-a-virtual-private-server

http://nginxlibrary.com/enable-directory-listing/

http://stackoverflow.com/questions/10663248/how-to-configure-nginx-to-enable-kinda-file-browser-mode

https://www.nginx.com/resources/admin-guide/serving-static-content/

If want a fancier or customized index listing, need to recompile nginx with this module.
https://www.nginx.com/resources/wiki/modules/fancy_index/

lo-fi hack:
http://www.linickx.com/css-styling-nginx-directory-listings

http://nginx.org/en/docs/http/ngx_http_autoindex_module.html#autoindex_format

Directories

I could use it as a simple blog or as a mini CMS.

Possible folders with index.html files:

  • /blog (like bradfrost.com) possible URIs:
    • /blog/article/this-is-a-test.html
    • /blog/note/this-is-a-test.html
    • /blog/this-is-a-test.html
    • /blog/this-is-a-test
    • /blog/2016/03/02/this-is-a-test
    • /blog/article/2016/03/02/this-is-a-test
    • [X] /2016/03/this-is-a-test
    • or do away with all of the directories and use:
      • /this-is-a-test
  • /contact - could be a post instead of a folder with index.html
  • /about - could be a post instead of a folder with index.html
  • /wren (an article, detailing the app) - could be a post instead of a folder with index.html
  • /tags (index.html contains list of links for design.html, bird.html, etc.) - could be a post instead of a folder with index.html
  • /tag (/tag/design.html or /tag/design and /tag/bird.html or /tag/bird) - "/tag" would definitely be a folder with no index.html in order to see a directory listing

Create and Update

  • /wren/create
    • (will only create in the directory if the file does not exist)
  • /wren/update/this-is-a-test
  • /wren/archives
    • (will create the stream of pages that contain links to the posts)

Perl

http://perlmeme.org/faqs/file_io/directory_listing.html

#wren #blogging

From JR's : articles
570 words - 4947 chars - 3 min read
created on
updated on - #
source - versions

Related articles
Installing Wren - Apr 05, 2016
Having search engines index a website - Mar 19, 2016



A     A     A     A     A

© 2013-2017 JotHut - Online notebook

current date: Nov 14, 2024 - 12:39 p.m. EST