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

Custom templates #3

Closed
fxnn opened this issue Dec 8, 2015 · 3 comments
Closed

Custom templates #3

fxnn opened this issue Dec 8, 2015 · 3 comments
Assignees
Milestone

Comments

@fxnn
Copy link
Owner

fxnn commented Dec 8, 2015

The webmaster wants to use custom templates with Gone.
The webmaster wants to extract the standard templates delivered with Gone into a given directory.

Background

Gone uses templates for several pages. Those are at the moment:

  • Create form
  • Edit form
  • Basic layout for markdown rendered pages

These templates are included in the Gone binary. It should be possible to write them into separate files, so that the webmaster can modify them and use his modified versions instead of the default ones.

Convention

In the course of this enhancement, we also need a convention for where templates are stored. I propose to always use a directory .templates inside the content root, until we introduce a configuration mechanism.

Exporting templates creates this directory, and as soon as the directory exists, it will be used as template source.

@fxnn
Copy link
Owner Author

fxnn commented Dec 31, 2015

A problem might arise when people want to test their HTML templates in-browser while using linked CSS and JS files. While the templates reside in the .templates-folder, the CSS and JS files must be placed inside the content root, which won't work. Effectively, the relative path from HTML file and referenced (CSS/JS/Image/...) file changes.

However, this is not such a big deal, because viewing Go templates in-browser isn't that nice, and just in case anyone wants to do this, he might set symlinks.

@fxnn fxnn self-assigned this Dec 31, 2015
@fxnn
Copy link
Owner Author

fxnn commented Dec 31, 2015

Commit efd27a8 gives us a means of running different commands than just "listen on that port" -- ideal for writing templates to a location.

fxnn added a commit that referenced this issue Dec 31, 2015
@fxnn fxnn closed this as completed in 8185f57 Dec 31, 2015
fxnn added a commit that referenced this issue Dec 31, 2015
@fxnn
Copy link
Owner Author

fxnn commented Dec 31, 2015

Hugh, not closed yet. I forgot the export mechanism.

@fxnn fxnn reopened this Dec 31, 2015
@fxnn fxnn closed this as completed in 2a0410f Dec 31, 2015
fxnn added a commit that referenced this issue Dec 31, 2015
@fxnn fxnn modified the milestone: 1.0.0 Apr 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant