| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
We assume that SCRIPT_NAME does not end in a slash or is empty and thus
PATH_INFO _must_ start with a slash.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
New struct template_data is passed to all template functions, allowing
to e. g. reflect the current entry in template_header and to unify
template_single_entry, template_index_entry, template_error into
template_main which switches behavior depending on data.page_type.
BREAKING CHANGES:
* remove template_single_entry, template_index_entry,
template_error; replaced by template_main
* template_header, template_footer: type change
refactor(templates/simple): use xml_escape where applicable
feat(templates/simple): navigate using header / entry titles
feat(templates/simple): change <title> depending on subpage
|
|
|
|
| |
These assert runtime assumptions
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* entry
* add entry_unget_text: implements unmmaping
* free_entry: now expects pointer
* index: adjust for entry changes
* main
* adjust for entry changes
* use on demand mmaping in blog_atom and blog_rss
* shell.nix
* add strace for mmap debugging
|
|
|
|
|
|
| |
* remove support for RSS <ttl> element, remove BLOG_RSS_TTL
* add BLOG_CACHE_MAX_AGE, send Cache-Control headers
* TODO: more sophisticated caching support? ETag support?
|
|
|
|
|
| |
feat(templates/simple.c): link to atom feed as well
refactor(templates/simple.c): replace make_link with catn_alloc
|
|
|
|
|
|
|
|
|
| |
* bitutil.{c,h} → stringutil.{c,h} (more appropriate)
* new function catn_alloc(size_t n, ...)
which concats `n` given strings into an dynamically allocated buffer,
mostly useful for building URLs which is done in blog_rss.
may be a possibility to use in entry.c, but code there might be too
specific.
|
|
|
|
|
|
|
| |
* add timeutil.{c,h}: utility for formatting timestamps
* wrap feed description in CDATA
* use xml_escaped where applicable
* use time of latest entry for lastBuildDate
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* xml_open_cdata and xml_close_cdata add convenient support for this
* tracked on stack using the newly introduced field type which is of
enum xml_tag_type which may either be XML_NORMAL_TAG or XML_CDATA.
* xml_close_all and xml_close_including also support closing CDATA
sections now
* xml_close_including now behaves like xml_close_all if NULL is given
as tag, xml_close_all newly aliased to xml_close_including(..., NULL)
|
|
|
|
|
|
|
| |
This should limit peak memory consumption to sizeof(struct entry) *
amount_of_entries + sizeof largest_file. Previously it was size of
the index plus size of all entries' files as they were all read into
memory first thing and only freed afterwards.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unfortunately, I got a bit carried away after realizing that the initial
change would be a breaking change anyways, so I am now left with a huge
diff which can't be really split up. Please excuse this.
The changes are as follows:
* Rename blogpost → entry (breaking): make_blogpost → make_entry,
blog_post → blog_entry etc.
* Rename blogdefs.h → core.h (breaking)
* Split functions from main.c into cgiutil and entry
* entry / make_entry:
* Use modification time instead of time in filename (breaking)
* Rename timestamp → time (breaking)
* Add field title (currently basename, breaking)
* Add field text and text_size which can be use to store the
contents of the associated file using mmap (fields default to
NULL and -1 respectively, breaking)
* Do PATH_INFO resolving and on disk path building in make_entry
instead of in blog_index / blog_rss / blog_entry
* entry_get_text: add function to mmap an entry's file into the
structure
* free_entry: also unmap file if present
* make_index: Add function to build an array of entries reverse sorted
by time
* blog_index / blog_rss:
* use make_index instead of scandir and make_blogpost_from_dirent
* (blog_rss) use entry_get_text to pass the template the text of
the entry.
* template:
* template_post_index_entry → template_index_entry (breaking)
* template_post_single_entry → template_single_entry (breaking)
* replace template_error_404() with generic template_error(status)
* templates/simple.c:
* Use xml library instead of printf
* Use entry.text instead of opening the file in the template
* include CSS if BLOG_CSS is set in config.h
* document internal and public interfaces using doxygen
* build process:
* build object files individually
* build process configuration in config.mk (breaking)
* support templates in arbitrary locations
* build default config.h if it's missing
* add install phase
* Rename target to sternenblog.cgi (breaking)
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|