a static sites generator with search functionality
sudo snap install sites115
sitename
run sites115 cs sitename
.sites115 rs sitename
to render a site called sitename
sites115.sites115d /path/to/sitename/out
. Replace /path/to/sitename/out with the actual dir.out/
contains the generated sitestatic/
contains the assets that would not be rendered but returned as is.stuffs/
contains the html and markdown files that would be rendered.templates/
contains the templates that is used to render html and markdown files contained in stuffs
site.zconf
which is the configuration file.Dockerfile
which is the docker file needed for deployment.stuffs
Every sub-folder of stuffs
must contain a toc.txt.
Sample of a toc.txt is as follows:
how_to_blog.md
on_css_frameworks.md
long_running_tasks.md
Every html or markdown file must begin with a variables part. It must begin with ---
and end with ---
. Sample contents include
template: base.html
title: Saenuma - A beautiful programs website
meta: Saenuma homepage. Saenuma delivers beautiful programs.
keywords: programs, database, program, forms, git, stories
it must contain the variables: template, title, meta and keywords. You can include your own variables.
Include a ‘404.html’ in your stuffs
folder for not found pages.
Include a ‘search_results.html’ in your stuffs
folder for results of a search
A markdown file must have the template
and the md_template
variables.
templates
html/template
.Which is of type map[string]string
that would contain your page variables.
This is passed to all html pages and markdown pages.
Which is declared as
type PaginatorStruct struct {
Page int
PaginationCount int
Pages []map[string]string
TotalPages int
PreviousPage int
PreviousPagePath string
NextPage int
NextPagePath string
TotalPagesArr []int
}
Where Pages
is a list of Page
variables declared above. This Page
variables would also contain a url
field
Paginator object is passed to the ‘index.html’ and the ‘search_results.html’ pages.
Contains the query for example. s=bank+account
This is passed to the ‘search_results.html’ pages.
Contains a HTML generated from markdown.
This is passed to the markdown pages.
ToLower func(string) string
ToUpper func(string) string
ToLongDate func(string) string
Modulo func(int, int) int
Plus func(int, int) int
/search_results
/search_results?s=bank+account
Sitemaps makes the work easier for search engines.
A sitemap is always generated and can be found at /static/sitemap.xml
The projects ships with its own alternative in the folder sites115d
.
This is the only way to enable search functionality.
The sites115d
expects the path to a folder. This folder must be the the out
folder described above.