You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 17, 2018. It is now read-only.
Remove the admin UI and clean up a ton of technical debt.
The admin UI had a bunch of problems and was never going to be the thing
I wanted it to be. It also caused more deployment headaches because now
you have to keep the admin app running. I'm cutting things down to focus
on just the simpler use case of ssh with rsync, etc.
Ordinarily I'd have kept all these commits logical and separate, but
there was so much to rip out that I got too far along. Didn't seem worth
it.
Serif is a static site generator and blogging system powered by markdown files and an optional admin interface complete with drag-and-drop image uploading. ([Check out the simple video demo](https://docs.google.com/open?id=0BxPQpxGSOOyKS1J4MmlnM3JIaXM).)
6
-
7
-
Serif releases you from managing a file system so you can focus on writing content.
8
-
9
-
Having problems with Serif? [Open an issue on GitHub](https://github.com/aprescott/serif/issues) or use the [Serif Google Group](https://groups.google.com/forum/#!forum/serif-rb).
5
+
Serif is a static site generator and blogging system powered by markdown files.
10
6
11
7
## First time use
12
8
@@ -36,12 +32,10 @@ Now visit <http://localhost:8000/> to view the site.
36
32
*[Archive pages](#archive-pages)
37
33
*[Configuration](#configuration)
38
34
*[Deploying](#deploying)
39
-
*[Customising the admin interface](#customising-the-admin-interface)
40
35
*[Custom tags and filters](#custom-tags-and-filters)
41
36
*[Template variables](#template-variables)
42
37
*[Developing Serif](#developing-serif)
43
38
*[Changes and what's new](#changes-and-whats-new)
44
-
*[Planned features](#planned-features)
45
39
46
40
# Intro
47
41
@@ -82,17 +76,6 @@ $ cd path/to/site/directory
82
76
$ serif generate
83
77
```
84
78
85
-
## Starting the admin server
86
-
87
-
```bash
88
-
$ cd path/to/site/directory
89
-
$ ENV=production serif admin
90
-
```
91
-
92
-
Once this is run, visit <http://localhost:4567/admin> and log in with whatever is in `_config.yml` as auth credentials.
93
-
94
-
Drop the `ENV=production` part if you're running it locally.
95
-
96
79
## Serving up the site for development
97
80
98
81
This runs a very simple web server that is mainly designed to test what the site will look like and let you make changes to stuff like CSS files without having to regenerate everything. Changes to post content will not be detected (yet).
@@ -216,11 +199,10 @@ Used for configuration settings.
216
199
Here's a sample configuration:
217
200
218
201
```yaml
219
-
admin:
220
-
username: username
221
-
password: password
222
-
permalink: /blog/:year/:month/:title
223
-
image_upload_path: /images/:timestamp_:name
202
+
permalink: /blog/:title
203
+
archive:
204
+
enabled: yes
205
+
url_format: /blog/:year/:month
224
206
```
225
207
226
208
If a permalink setting is not given in the configuration, the default is `/:title`. There are the following options available for permalinks:
@@ -234,31 +216,11 @@ Placeholder | Value
234
216
235
217
<b>NOTE</b>: if you change the permalink value, you will break existing URLs for published posts, in addition to, e.g., any feed ID values that depend on the post URL never changing.
236
218
237
-
### Admin drag-and-drop upload path
238
-
239
-
The `image_upload_path` configuration setting is an _absolute path_ and will be relative to the base directory of your site, used in the admin interface to control where files are sent. The default value is `/images/:timestamp_:name`. Similar to permalinks, the following placeholders are available:
240
-
241
-
Placeholder | Value
242
-
----------- |:-----
243
-
`:slug`| URL "slug" at the time of upload, e.g., "your-post-title"
244
-
`:year`| Year at the time of upload, e.g., "2013"
245
-
`:month`| Month at the time of upload, e.g., "02"
246
-
`:day`| Day at the time of upload, e.g., "16"
247
-
`:name`| Original filename string of the image being uploaded
Any slashes in `image_upload_path` are converted to directories.
251
-
252
219
## Other files
253
220
254
-
Any other file in the directory's root will be copied over exactly as-is, with two caveats.
255
-
256
-
First, `images/` (by default) is used for the drag-and-drop file uploads from the admin interface. Files are named with `<timestamp>_ <name>.<extension>`. This is configurable, see the section on configuration.
257
-
258
-
Second, for any file ending in `.html` or `.xml`:
221
+
Any other file in the directory's root will mostly be copied over exactly as-is.
259
222
260
-
1. These files are assumed to contain [Liquid markup](http://liquidmarkup.org/) and will be processed as such.
261
-
2. Any header data will not be included in the processed output.
223
+
An exception is any file ending in `.html` or `.xml`. These files are assumed to contain [Liquid markup](http://liquidmarkup.org/) and will be processed as such. Header values will be available on `page`.
262
224
263
225
For example, this would work as an `about.html`:
264
226
@@ -270,24 +232,24 @@ For example, this would work as an `about.html`:
270
232
And so would this:
271
233
272
234
```html
273
-
title: My about page
235
+
x: y
274
236
275
237
<h1>All about me</h1>
276
-
<p>Where do I begin? Well...</p>
238
+
<p>Where do I begin? Well... First, x is {{ page.x }}.</p>
277
239
```
278
240
279
-
In both cases, the output is, of course:
241
+
If you have a file like `feed.xml` that you wish to _not_ be contained within a layout, specify `layout: none` in the header for the file:
280
242
281
243
```html
282
-
<h1>All about me</h1>
283
-
<p>Where do I begin? Well...</p>
284
-
```
244
+
layout: none
285
245
286
-
If you have a file like `feed.xml` that you wish to _not_ be contained within a layout, specify `layout: none` in the header for the file.
246
+
<?xml version="1.0" encoding="utf-8"?>
247
+
<!-- ... -->
248
+
```
287
249
288
250
# Publishing drafts
289
251
290
-
To publish a draft, either do so through the admin interface available with `serif admin`, or add a `publish: now` header to the draft:
252
+
To automatically publish a draft, add a `publish: now` header to the draft:
By default, archive pages are made available at `/archive/:year/month`, e.g., `/archive/2012/11`. Individual archive pages can be customised by editing the `_templates/archive_page.html` file, which is used for each month.
@@ -330,7 +290,7 @@ To disable archive pages, or configure the URL format, see the section on config
330
290
331
291
To link to archive pages, there is a `site.archive` template variable available in all pages. The structure of `site.archive` is a nested map starting at years:
332
292
333
-
```
293
+
```ruby
334
294
{
335
295
"posts" => [...],
336
296
"years" => [
@@ -353,18 +313,13 @@ Using `site.archive`, you can iterate over `years`, then iterate over `months` a
353
313
354
314
Configuration goes in `_config.yml` and must be valid YAML. Here's a sample configuration with available options:
355
315
356
-
```
357
-
admin:
358
-
username: myusername
359
-
password: mypassword
316
+
```yaml
360
317
permalink: /posts/:title
361
318
archive:
362
319
enabled: yes
363
320
url_format: /archive/:year/:month
364
321
```
365
322
366
-
`admin`contains the credentials used when accessing the admin interface. This information is private, of course.
367
-
368
323
`permalink`is the URL format for individual post pages. The default permalink value is `/:title`. For an explanation of the format of permalinks, see above.
369
324
370
325
`archive`contains configuration options concerning archive pages. `enabled` can be used to toggle whether archive pages are generated. If set to `no` or `false`, no archive pages will be generated. By default, this value is `yes`.
@@ -393,23 +348,6 @@ location @not_found_page {
393
348
394
349
Use `ENV=production serif generate` to regenerate the site for production.
395
350
396
-
## Admin interface
397
-
398
-
The admin server can be started on the live server the same way it's started locally (with `ENV=production`). To access it from anywhere on the web, you will need to proxy/forward `/admin` HTTP requests to port 4567 to let the admin web server handle it. As an alternative, you could forward a local port with SSH --- you might use this if you didn't want to rely on just HTTP basic auth, which isn't very secure over non-HTTPS connections.
399
-
400
-
# Customising the admin interface
401
-
402
-
The admin interface is intended to be a minimal place to focus on writing content. You are free to customise the admin interface by creating a stylesheet at `$your_site_directory/css/admin/admin.css`. As an example, if your main site's stylesheet is `/css/style.css`, you can use an `@import` rule to inherit the look-and-feel of your main site editing content and looking at rendered previews.
403
-
404
-
405
-
```css
406
-
/* Import the main site's CSS to provide a similar look-and-feel for the admin interface */
407
-
408
-
@import url("/css/style.css");
409
-
410
-
/* more customisation below */
411
-
```
412
-
413
351
# Custom tags and filters
414
352
415
353
These tags can be used in templates, in addition to the [standard Liquid filters and tags](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers). For example:
@@ -424,11 +362,6 @@ These tags can be used in templates, in addition to the [standard Liquid filters
424
362
425
363
## List of filters
426
364
427
-
* `date` with `'now'`
428
-
429
-
This is a standard filter, but there is a [workaround](https://github.com/Shopify/liquid/pull/117) for
430
-
`{{ 'now' | date: "%Y"}}` to work, so you can use this in templates.
431
-
432
365
* `markdown`
433
366
434
367
e.g., `{{ post.content | markdown }}`.
@@ -527,9 +460,8 @@ Variable | Value
527
460
528
461
## Broad outline
529
462
530
-
* `./bin/serif {dev,admin,generate}` to run Serif commands.
531
-
* `rake test` to run the tests.
532
-
* Unit tests are written in RSpec.
463
+
* `./bin/serif {dev,generate}` to run Serif commands.
464
+
* `rspec` to run the tests.
533
465
* `rake docs` will generate HTML documentation in `docs/`. Open `docs/index.html` in a browser to start.
534
466
535
467
## Directory structure
@@ -540,12 +472,3 @@ Variable | Value
540
472
# Changes and what's new
541
473
542
474
See `CHANGELOG`.
543
-
544
-
# Planned features
545
-
546
-
Some things I'm hoping to implement one day:
547
-
548
-
1. Custom hooks to fire after particular events, such as minifying CSS after publish, or committing changes and pushing to a git repository.
549
-
2. Simple Markdown pages instead of plain HTML for non-post content.
550
-
3. Automatically detecting file changes and regenerating the site.
0 commit comments