dirv / pinaclj Goto Github PK
View Code? Open in Web Editor NEWA simple content system for the web
License: GNU General Public License v2.0
A simple content system for the web
License: GNU General Public License v2.0
Hi,
I noticed while reading your blog that the footer says 'This site is proudly generated by Pinaclj.' On the homepage Pinaclj links to this repo but on the individual post pages it links to 'http://www.pinalj.com/'. Just thought I'd point it out :)
If a category template file has been modified since last write, then all of its pages must be rewritten.
=> There are some words: “tag”, "category”, “uncategorized” that should be internationalized. This will require configuration.
=> “tag” and “category” will be part of URLs
=> “uncategorized” is created when setting :title in build-group-page
' to ‘ and ’ depending on placement
" to “ and ” depending on placement
In order to publish a page the user must write a timestamp in a the ISO_INSTANT format: 2014-10-31T10:05:00Z
Here are my ideas to make it easier:
2014-10-31
, 31-10-2014
, 31.10.2014
(rails like magic parsing)pinaclj publish drafts/post.md
. It would automatically add current date as a published-at header.Either this should be a function that limits depth, or there should be a summary
header that can be applied to posts.
If a summary
header doesn't exist, then the first x characters should be used followed by an ellipsis...
data-id="groups" data-type="category"
data-id="groups" data-type="tags"
should list out all values of categories and tags.
There could also be function aliases for "all-categories" and "all-tags" for those two particular use cases.
Tasks should be able to report back status of subtasks.
Currently it's storing strings everywhere for URLs, these should be keywordized.
Only the topmost page of the split gets regenerated, when in fact all of them should be
This may not be an issue, but it is pretty inconvenient. Index.md must be published before it can be processed.
User should be able to create directories in the markdown directory and the structure should be the same in the generated directory.
There should probably be a command to support this, and publication should error if it detects that a previously published page has been moved or deleted without using this command.
The reason for this is that pages linking to the moved page will need to be updated, and the current method of discovering updates only works for updated and new pages, not for deleted or moved pages.
Maybe there's a way this update mechanism can be changed to read its previous structure from the generated content.
Or the app needs to take control of the file system completely...
Category pages (the pages which list pages within a category) should category.html and tags (the pages which list pages within a tag) should use tag.html. If they don't exist, then index.html should be used.
I wonder if page types should have multiple page templates depending on their use.
For example, a post could have two templates: one for posts on a main page, and one for when they appear as related posts within other pages.
These might be post.html
and post_related.html
.
Authors might have a page to their own and also a page box for posts.
Another way to do this would be to specify the template parent type, so we might have post.html
and post_post.html
. Authors would have author.html
and author_post.html
.
Pages should have types. So far, the type will just determine the render template but could eventually determine default values for new post, the workflow that is applied, visibility etc.
type: post
type: author
The :path is used to determine the template used. For generated list pages, this means setting path to "/index.md". For these generated pages it would be better to have a :template :index.html to do the same thing but avoiding the template resolution step.
There are roughly 2.5x times as many calls to :destination as there should be. I think that's because page objects are regenerated within site when pages are divided. That should be cleaned up.
The example right now is authors:
<div data-func="include" data-page-type="author" data-page-id="daniel"></div>
There's an all-keys
function which is used to generate selectors that match each field in a page.
Pages can potentially have quite a large selection of headers, only a subset of which will be used. In addition, each page has a call to all-keys
when the template is run.
If instead Pinaclj builds a list of selectors based on the template, it can store this off when the template is first run and then simply call it back for each page that uses it.
Tasks should have a top-level exception handler which outputs a fatal task result.
There should be an exception pretifier which only shows exceptions from the pinaclj namespace.
Like page-link but it should return the link to the parent
Files should be re-created when being written, rather than opened and written to. I've noticed that the existing tail end of file contents will remain when a new version is written that's of shorter length than the original version.
For example, the publish
task should allow a *.md file specification to publish all un-published files.
This should happen even if there's no value for a given id within the page structure.
Also, for page-lists, it's important that all child nodes are cleared before cloning, as we want to support theme pages having multiple list items for display purposes.
<div data-id="published-at" data-format="mmm dd, yyyy" />
next
and prev
only set the href attribute
category-link
sets the href attribute and content.
I can see four uses cases:
It makes sense to put this exclusion functionality in the templates namespace itself, rather than on any individual transform function.
Validation errors e.g. pages which have the same URL set
Some of the posts I have on my blog are labelled part 1, part 2, part 3. It'd be great to have implicit support for this.
That way, for example, the main blog page would list only the first page in a series of articles.
This feature could also be thought of as page breaks. Inserting a break sequence into a post to break it up into multiple pages.
The index source page is where headers like blog-title
might be set. Other pages should be able to access these and override them as appropriate.
Perhaps pages should have a parent link, with index being the root. This might be useful for categories too.
Currently index.html is built from a page generated simply from a pages list.
There are two approaches:
Easy approach: when generating index.html, find the page for index.md and append onto it rather than use a blank page.
Harder approach: modify page-list to act on all-pages context passed into template, and then generating index.html will "just work" if an index.md file is present.
Published-at is used in two ways:
There is a default-format specified in the published-at transform but this is currently not used.
There should be a default format that gets applied if the transform is being called via Enlive. Right now I can't think of an elegant way to do this.
Use theme/single/index.html
as the main web page.
Is there a way that we can specify just one template file that includes `...'.
This could work for single (index/404) pages, and template files (post/author). Possibly by having some sort of template parent.
Delete an element in the tree if there is an empty or no value
<section data-id="if-exists" data-key="twitter">
<img src="twitter.png" />
</section>
A couple of my Markdown posts have the text "<leader>" within <code>
blocks.
When running Pinaclj, JLint (an Endophile dependency via Pegdown), outputs this to stdout:
line 1 column 8 - Error: <leader> is not recognized!
line 1 column 8 - Error: <leader> is not recognized!
My Markdown code uses < and > so I'm not sure what's going on here.
Let's say you have a style sheet at /style.css.
If you want your website to work locally, you need to fix the URLs to be relative depending on where your page lives. e.g. the link above should actually read ../../../../style.css.
So it'd be useful to relativize certain types of links, somehow.
Some way to include static images within pages
User should be able write and use their own themes for the site. Should there be a theme
directory which includes the templates and the stylesheets/javascripts?
<title data-id="title" />
doesn't seem to work with Enlive templating. I'm fairly sure using data-id
with title
is valid HTML5.
One way around this would be to always insert (or replace) the <title>
head element with the :title
value.
Re-render pages only if the post or template is newer than the generated page.
Currently, templates knows about specific nested selectors, like page-list, latest, etc.
I think a better approach would be to only process selectors that are one "data-id" level deep, in other words the selector would have a but (parents (has-attr? :data-id))
Non-template files (i.e. not HTML or XML files) should be copied to the target folder if they aren't already there, or if they have been modified since they were last copied.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.