Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pages #27

Closed
stuartskelton opened this issue Oct 3, 2014 · 5 comments

Comments

@stuartskelton
Copy link
Contributor

commented Oct 3, 2014

A bit of a departure to the core need of a static blog engine , but a it may be useful.

So we have entries, how about pages. You may want a static page like an about page or contact page but obviously you wouldn't need the extra blog specific stuff such as tags and publish dates. Previously I was using templer in conjuction with chronicle 4.6 to do this sort of thing then marrying the outputs.

Obviously we could pre-create the pages and have them copied into the output directory using the "post-build" feature, however I think Chronicle should be up to the task.

The proposed page would be have a simpler structure than a post:

title: About
format: markdown (optional)
type: page

This page is about me a
However much there is of it.

It may require a bit of a logic rewrite, or looking at the code touch of sleight of hand.

@stuartskelton

This comment has been minimized.

Copy link
Contributor Author

commented Oct 3, 2014

I will have think about this a little more when I read over the source code later.

@skx

This comment has been minimized.

Copy link
Owner

commented Oct 3, 2014

It seems to me there are two key things you want to achieve here:

  • Avoid the post using the blog-template / being included in the tags/archive page.
  • Explicitly setting an output-filename. e.g. "$output/about/index.html", "$output/contact/index.html", etc.

I have a suspicion this could even be done in a plugin. (I did something pretty complex by adding a plugin which ran at db-init time to create a "related tags" page, then ran at generation time to output lists of related tags which seems related.)

I think you could do something similar:

  1. Write a module which hooked on_db_create to create a new DB-table "pages".
  2. In that same module write an on_generate function to iterate over the entries in the pages table.
  3. Finally you'd want to ensure that the pages weren't added as blog-posts. That could be done by hooking on_insert and just returning undef if you found a type == post header.

So a pretty "big" plugin, implementing three methods, but I don't think it would be complex to write.

(I'd be happy to hack a demo if that would be useful?)

@skx

This comment has been minimized.

Copy link
Owner

commented Oct 3, 2014

Proof of concept - I'll let you complete, experiment, think things over:

That seems to have the core features, and I can't see any obvious reason why it wouldn't work for you. But I won't commit because I'm in a hurry.

@stuartskelton

This comment has been minimized.

Copy link
Contributor Author

commented Oct 3, 2014

Much appreciated. I will sitck in a StaticPages branch, so I can be sure, as I may need to reach out and use the format modules (Markdown and such), saving me to write the HTML.

@skx

This comment has been minimized.

Copy link
Owner

commented Oct 3, 2014

No problem, I don't want to write it for you but I did want to reassure myself that it should be possible without changing the chronicle-core :)

The markdown/multimarkdown should be possible without too much effort too - either hardwired, along with a suitable template, or via a format: header. etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.