Skip to content
This repository was archived by the owner on Jul 17, 2018. It is now read-only.

Commit a0a6b79

Browse files
committed
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.
1 parent c6b0d07 commit a0a6b79

File tree

127 files changed

+2053
-4077
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+2053
-4077
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
/serif-*.gem
33
/coverage
44
/spec/*/_site
5-
/spec/*/_trash
65
/spec/examples.txt
76
/.rbx
87
/docs

.travis.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ cache:
66
language: ruby
77
cache: bundler
88
rvm:
9-
- 2.0.0
109
- 2.1
1110
- 2.2
1211
- ruby-head
1312
script:
1413
- bundle exec rspec
1514
- "bundle exec bundle-audit update && bundle exec bundle-audit check"
15+
env:
16+
- USE_SHELL=no
17+
- USE_SHELL=yes
1618
matrix:
1719
allow_failures:
1820
- rvm: ruby-head

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# next release
22

33
* Prevent /tmp from filling up over time. (#77)
4+
* Remove /tmp/_site snapshots altogether. (#82)
5+
* The admin interface is removed. (#82) When upgrading to this version, you should update your site. This includes:
6+
* Remove any deployment webserver configuration (e.g., mapping `/admin` to the correct port).
7+
* Update `_config.yml` since the entire `admin:` section is now unused.
8+
* Remove `css/admin/admin.css` since it's now unused.
49

510
# v0.6
611

Gemfile.lock

+5-37
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,10 @@ PATH
44
serif (0.6)
55
kramdown (>= 1.9.0)
66
liquid (~> 2.0)
7-
nokogiri
8-
rack
97
redhead
10-
reverse_markdown
118
rouge (>= 1.10.0)
129
rubypants
1310
sinatra
14-
timeout_cache
1511

1612
GEM
1713
remote: https://rubygems.org/
@@ -20,13 +16,6 @@ GEM
2016
bundler (~> 1.2)
2117
thor (~> 0.18)
2218
byebug (8.2.0)
23-
capybara (2.5.0)
24-
mime-types (>= 1.16)
25-
nokogiri (>= 1.3.3)
26-
rack (>= 1.0.0)
27-
rack-test (>= 0.5.4)
28-
xpath (~> 2.0)
29-
cliver (0.3.2)
3019
coderay (1.1.0)
3120
coveralls (0.8.9)
3221
json (~> 1.8)
@@ -39,8 +28,6 @@ GEM
3928
docile (1.1.5)
4029
domain_name (0.5.25)
4130
unf (>= 0.0.5, < 1.0.0)
42-
gherkin (2.12.2)
43-
multi_json (~> 1.3)
4431
http-cookie (1.0.2)
4532
domain_name (~> 0.5)
4633
json (1.8.3)
@@ -49,15 +36,9 @@ GEM
4936
method_source (0.8.2)
5037
mime-types (2.6.2)
5138
mini_portile (0.6.2)
52-
multi_json (1.11.2)
5339
netrc (0.11.0)
5440
nokogiri (1.6.6.3)
5541
mini_portile (~> 0.6.0)
56-
poltergeist (1.8.0)
57-
capybara (~> 2.1)
58-
cliver (~> 0.3.1)
59-
multi_json (~> 1.0)
60-
websocket-driver (>= 0.2.0)
6142
pry (0.10.3)
6243
coderay (~> 1.1.0)
6344
method_source (~> 0.8.1)
@@ -68,17 +49,12 @@ GEM
6849
rack (1.6.4)
6950
rack-protection (1.5.3)
7051
rack
71-
rack-test (0.6.3)
72-
rack (>= 1.0)
7352
rake (10.4.2)
74-
rdoc (4.2.0)
7553
redhead (0.0.9)
7654
rest-client (1.8.0)
7755
http-cookie (>= 1.0.2, < 2.0)
7856
mime-types (>= 1.16, < 3.0)
7957
netrc (~> 0.7)
80-
reverse_markdown (1.0.0)
81-
nokogiri
8258
rouge (1.10.1)
8359
rspec (3.4.0)
8460
rspec-core (~> 3.4.0)
@@ -89,6 +65,9 @@ GEM
8965
rspec-expectations (3.4.0)
9066
diff-lcs (>= 1.2.0, < 2.0)
9167
rspec-support (~> 3.4.0)
68+
rspec-its (1.2.0)
69+
rspec-core (>= 3.0.0)
70+
rspec-expectations (>= 3.0.0)
9271
rspec-mocks (3.4.0)
9372
diff-lcs (>= 1.2.0, < 2.0)
9473
rspec-support (~> 3.4.0)
@@ -109,36 +88,25 @@ GEM
10988
thor (0.19.1)
11089
tilt (2.0.1)
11190
timecop (0.8.0)
112-
timeout_cache (0.0.2)
11391
tins (1.6.0)
114-
turnip (1.3.1)
115-
gherkin (>= 2.5)
116-
rspec (>= 2.14.0, < 4.0)
11792
unf (0.1.4)
11893
unf_ext
11994
unf_ext (0.0.7.1)
120-
websocket-driver (0.6.3)
121-
websocket-extensions (>= 0.1.0)
122-
websocket-extensions (0.1.2)
123-
xpath (2.0.0)
124-
nokogiri (~> 1.3)
12595

12696
PLATFORMS
12797
ruby
12898

12999
DEPENDENCIES
130100
bundler-audit
131-
capybara
132101
coveralls
133-
poltergeist
102+
nokogiri
134103
pry-byebug
135104
rake
136-
rdoc
137105
rspec
106+
rspec-its
138107
serif!
139108
simplecov
140109
timecop
141-
turnip
142110

143111
BUNDLED WITH
144112
1.10.6

README.md

+19-96
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22

33
[![Build Status](https://travis-ci.org/aprescott/serif.png?branch=master)](https://travis-ci.org/aprescott/serif) [![Code Climate](https://codeclimate.com/github/aprescott/serif.png)](https://codeclimate.com/github/aprescott/serif) [![Coverage Status](https://coveralls.io/repos/aprescott/serif/badge.png?branch=master)](https://coveralls.io/r/aprescott/serif)
44

5-
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.
106

117
## First time use
128

@@ -36,12 +32,10 @@ Now visit <http://localhost:8000/> to view the site.
3632
* [Archive pages](#archive-pages)
3733
* [Configuration](#configuration)
3834
* [Deploying](#deploying)
39-
* [Customising the admin interface](#customising-the-admin-interface)
4035
* [Custom tags and filters](#custom-tags-and-filters)
4136
* [Template variables](#template-variables)
4237
* [Developing Serif](#developing-serif)
4338
* [Changes and what's new](#changes-and-whats-new)
44-
* [Planned features](#planned-features)
4539

4640
# Intro
4741

@@ -82,17 +76,6 @@ $ cd path/to/site/directory
8276
$ serif generate
8377
```
8478

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-
9679
## Serving up the site for development
9780

9881
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.
216199
Here's a sample configuration:
217200

218201
```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
224206
```
225207
226208
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
234216

235217
<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.
236218

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
248-
`:timestamp`| Unix timestamp, e.g., "1361057832685"
249-
250-
Any slashes in `image_upload_path` are converted to directories.
251-
252219
## Other files
253220

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.
259222

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`.
262224

263225
For example, this would work as an `about.html`:
264226

@@ -270,24 +232,24 @@ For example, this would work as an `about.html`:
270232
And so would this:
271233

272234
```html
273-
title: My about page
235+
x: y
274236
275237
<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>
277239
```
278240

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:
280242

281243
```html
282-
<h1>All about me</h1>
283-
<p>Where do I begin? Well...</p>
284-
```
244+
layout: none
285245
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+
```
287249

288250
# Publishing drafts
289251

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:
291253

292254
```
293255
title: A draft that will be published
@@ -316,8 +278,6 @@ Created: 2013-01-01T12:01:30+00:00
316278
Updated: 2013-03-18T19:03:30+00:00
317279
```
318280

319-
Admin users: this is all done for you.
320-
321281
# Archive pages
322282

323283
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
330290

331291
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:
332292

333-
```
293+
```ruby
334294
{
335295
"posts" => [...],
336296
"years" => [
@@ -353,18 +313,13 @@ Using `site.archive`, you can iterate over `years`, then iterate over `months` a
353313

354314
Configuration goes in `_config.yml` and must be valid YAML. Here's a sample configuration with available options:
355315

356-
```
357-
admin:
358-
username: myusername
359-
password: mypassword
316+
```yaml
360317
permalink: /posts/:title
361318
archive:
362319
enabled: yes
363320
url_format: /archive/:year/:month
364321
```
365322

366-
`admin` contains the credentials used when accessing the admin interface. This information is private, of course.
367-
368323
`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.
369324

370325
`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 {
393348

394349
Use `ENV=production serif generate` to regenerate the site for production.
395350

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-
413351
# Custom tags and filters
414352

415353
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
424362

425363
## List of filters
426364

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-
432365
* `markdown`
433366

434367
e.g., `{{ post.content | markdown }}`.
@@ -527,9 +460,8 @@ Variable | Value
527460

528461
## Broad outline
529462

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.
533465
* `rake docs` will generate HTML documentation in `docs/`. Open `docs/index.html` in a browser to start.
534466

535467
## Directory structure
@@ -540,12 +472,3 @@ Variable | Value
540472
# Changes and what's new
541473

542474
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.
551-
4. Adding custom Liquid filters and tags.

0 commit comments

Comments
 (0)