Code Monkey home page Code Monkey logo

empress-blog's Introduction

empress-blog

Note: if you have come here wanting to use empress-blog for your own blog then skip down to the quick-start. You do not need to clone this repo to get started, you only need to clone this repo if you want to develop empress-blog ๐ŸŽ‰

This project is designed to be a fully-functional, static site implementation of a blog system that is mostly compatible with Ghost and is built on EmberJS with fully working out of the box SEO friendly output. It supports being hosted on AWS S3 or any other static site hosting solution.

This system supports the use of shallow forks of Ghost themes and currently supports

If you are interested in writing your own theme for empress-blog please check out create-empress-blog-template which allows you to run npm init empress-blog-template <name> right now to get started (without the need to install anything). Check out the readme for more information.

If you want an example of the this "in production" then check out the Chris Manson's Blog.

You do not need to be a web developer to be able to use this system. You just write markdown files and the rest of the work is performed by EmberJS' build system.

Super Quick Start

If you want to get your new empress-blog blog deployed on Netlify in less than a minute then you can just click this button:

Deploy to Netlify

If you want to instead work with your blog locally before deploying then you can continue reading

Quick Start

npx ember-cli@latest new super-blog

cd super-blog

# you can replace the template with the one you want to use
npx ember install empress-blog empress-blog-casper-template

It will ask you if you want to update the index.html file and you should say yes ๐Ÿ‘

If you want to see the blog system running on your local machine just run npm start and you will be able to navigate to http://localhost:4200 to see the blog in action.

Note: you need [email protected] or later to run this quick start. You can update with npm install -g npm@latest or check the official docs

To build the static output directory, run the standard build process for a production Ember application:

npm run build -- -prod

This will generate a fully static output of your site in the dist folder.

Usage

Creating Content

This addon comes with helpful blueprints to generate posts and authors for you in the structure it expects. The first thing you should do is generate an author as follows:

npx ember g author your-name

Then you should be able to edit the file author/your-name.md to update the details.

Next you will want to generate some posts. If you only have one author generated (in a single user blog) you can generate a post as simply as running:

npx ember g post "this is a post I want to write"

Configuring

If you have already generated some content (see above) you will know that you are able to configure certain details about your posts. If you want to edit the global configuration you will need to provide a section in the Environment config file for your host Ember app (located in config/environment.js). You will see a let ENV = { declaration near the top of the file, you will need to add a blog key to that object with your configuration. Here is an example of that blog config object:

let ENV = {

  // leave all the other config intact and add the following key

  blog: {
    title: "The Write Blog",
    description: "Here is where I lay my words",
    logo: "/images/logo-white.png",
    rssLogo: '/images/logo.png',
    coverImage: "/images/cover-image.jpg",
    twitter: "emberjs",
    navigation: [
      { label: 'Ember Consulting', link: 'https://simplabs.com' },
      { label: 'Blog Home', route: 'index' },
    ]
  },
}

This example config shows you how to set a title and general description for your blog, have a logo and a cover image, a link to your twitter account and how to add some navigation to your blog.

Note: the images like /images/logo.png will need to be in your public folder in your host app.

Configuring your host & enabling RSS

The above configuration allows you to make your blog look a lot better but there is one piece of configuration that will enable some awesome features like automatically creating an RSS feed for you ๐ŸŽ‰

Although, due to the nature of some RSS aggregators, you need to be very careful with this because it can mess up a cache that you have no control over. This is why it's dealt with differently than the above.

If you're not familiar with Ember configuration, you are able to specify some environment configs depending on what environment you are targeting. This allows you to have some configs only available in production (like Google Analytics for example).

If you go to the end of your config/environment.js file you will see something that is checking if the environment is production. You can add your host config to the blog config object as follows:

if (environment === 'production') {

  // ... any other production config you might have ...

  ENV.blog.host = 'https://chris.manson.ie';
}

When ember-casper-template sees that you have a host defined it will start generating the rss feed.

Custom Themes

If you are interested in writing your own theme for empress-blog you can get started using

npm init empress-blog-template <template-name>

This will create a brand new template addon in the folder empress-blog-template-name-template! This directory will contain a blank theme based on the official Ghost Starter Theme and is intended to be setup in such a way that anyone with HTML and CSS skills can start developing their own themes without needing much knowledge of Ember ๐ŸŽ‰

If you are new to ember and you feel like there is anything we can do to help you get started please reach out to me on Twitter and I'd be happy to help you. You can check out the documentation for create-empress-blog-template here.

If you do end up writing an empress-blog template please let us know so I can include your template in a list of existing templates.

Importing content

If you would like to import your blog content from another platform into empress-blog we have a beta import function that we would love for people to try out and give feedback. It requires that you create an export file from your respective blog platform and then run the following command from the command line:

npx ember empress-blog:import --type=[import_type] [dump_file]

Currently available import_types are:

Note: When exporting a Tumblr blog you will be downloading a zip file which you need to unpack. Once you unpack your export zip file you will find a posts.zip file which also needs to be unpacked. Your dump_file will be the resulting posts.xml file.

Upgrade notes

If you are upgrading from [email protected] and you start to get some errors along the lines of:

cannot find helper xyz

you will probably need to update your template if you're using one of the "official" empress-blog templates.

If you have a custom template and you get this error you might need to install empress-blog-ghost-helpers as a dependency.

This is because empress-blog originally started as a "shallow fork" of Ghost, and therefore it supported all the helpers that Ghost provided for templates by default. Now you can optionally add support for these helpers which is particularly useful if you are porting a template from Ghost.

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

empress-blog's People

Contributors

acorncom avatar amyrlam avatar bracke avatar elwayman02 avatar ember-tomster avatar jaredgalanis avatar jelhan avatar jenweber avatar leon0824 avatar mansona avatar nickschot avatar sbatson5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

empress-blog's Issues

SyntaxError: Unexpected token '.' on new blog

As title says. This is a brand new empress blog and it can't boot up:

โฏ npm init ember-app acluxace
...
โฏ cd acluxace
...
โฏ npx ember-cli install empress-blog empress-blog-casper-template
...
โฏ yarn start

The error in the console and on http://localhost:4200/

App is being served by FastBoot
/var/folders/8q/yrjx_8s115q43r8w5qd90_m00000gn/T/broccoli-29867Uz1ZZwXFtZq6/out-442-broccoli_merge_trees/assets/vendor.js:99690
      const description = this.currentRouteMeta?.description;
                                                ^

SyntaxError: Unexpected token '.'
    at new Script (vm.js:88:7)
    at VMSandbox.eval (/Users/michal/pudr.com/acluxace/node_modules/fastboot/src/vm-sandbox.js:13:22)
    at /Users/michal/pudr.com/acluxace/node_modules/fastboot/src/ember-app.js:190:15
    at Array.forEach (<anonymous>)
    at EmberApp.loadAppFiles (/Users/michal/pudr.com/acluxace/node_modules/fastboot/src/ember-app.js:187:21)
    at EmberApp.retrieveSandboxedApp (/Users/michal/pudr.com/acluxace/node_modules/fastboot/src/ember-app.js:235:10)
    at new EmberApp (/Users/michal/pudr.com/acluxace/node_modules/fastboot/src/ember-app.js:61:21)
    at FastBoot._buildEmberApp (/Users/michal/pudr.com/acluxace/node_modules/fastboot/src/index.js:114:17)
    at new FastBoot (/Users/michal/pudr.com/acluxace/node_modules/fastboot/src/index.js:52:10)
    at /Users/michal/pudr.com/acluxace/node_modules/ember-cli-fastboot/index.js:335:29

And what is the app made of:

โฏ grep 'ember-cli' package.json
    "ember-cli": "~3.23.0",
    "ember-cli-app-version": "^4.0.0",
    "ember-cli-babel": "^7.23.0",
    "ember-cli-dependency-checker": "^3.2.0",
    "ember-cli-fastboot": "^2.2.3",
    "ember-cli-htmlbars": "^5.3.1",
    "ember-cli-inject-live-reload": "^2.0.2",
    "ember-cli-sri": "^2.1.1",
    "ember-cli-terser": "^4.0.1",
...
โฏ grep 'empress' package.json
    "empress-blog": "^3.0.1",
    "empress-blog-casper-template": "^3.3.0",

Page Scrolls to top when navigating

While clicking any link, the page scrolls to the top waits for like one second and then navigates to the corresponding link.
Video:
Apr-13-2019 14-17-29

Would love if this could be made smoother, as of now something feels off.. when navigating.

Title not updating when traversing posts

Issue description

In some cases the <title> of the page is not updated.

How to reproduce

  1. GOTO https://acluxace.pudr.com/
  2. Click on random post. First one for example goes to: https://acluxace.pudr.com/den-365-rok-pot%C3%A9
  3. See that the page title has changed
  4. Scroll to the bottom
  5. Click on any post "ad" in the footer. Mine shows for example: https://acluxace.pudr.com/den-159-vynd%C3%A1n%C3%AD-steh%C5%AF
  6. See that even though currently active post has changed, the page title stayed the same as it was before

Request: change feature color independently from legend

It would be nice to be able to change the color of a specific feature (or metadata category) by clicking on the legend. This is already enabled in emperor and is very useful when trying to highlight a specific feature.

ember-lodash adds significant weight to production builds

I've noticed that empress-blog relies on ember-lodash to include the full lodash package in the build, but it's only actually making use of a few utilities.

Since this package already has dependencies on ember-auto-import and lodash directly, it should be possible to drop ember-lodash and rewrite the existing imports not to pull in the entire package, e.g. import pick from 'lodash/pick';.

Making that change locally knocked about 68K (nearly a quarter) off my gzipped production vendor.js size.

Raw Size Gzipped Size
Before 1.27 MB 313.44 KB
After 947.58 KB 245.62 KB
Difference -323 KB -67.82 KB

If you'd be open to the change, I'm happy to open a PR. One wrinkle is that empress-blog-casper-template seems to be implicitly relying on import _ from 'lodash' working without ever declaring a dependency that would enable that. I'm not using that template myself, but since this package's own dummy app is, a similar change would need to happen there first.

Infinite loop on new blog

Followed the basic installation. Created new user & post and got this infinite loop:

ember g user michal-bryxi
ember generate post "The fun with pounds" --author=michal-bryxi

Then the server spits following in the console:

There was an error running your app in fastboot. More info about the error:
 Error: Cannot find module 'moment' from '/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-67747c4ty67J6SLnb/out-391-broccoli_merge_trees'
    at Function.module.exports [as sync] (/Users/mbryxi/Projects/unicorn-misa-pudr-com-empress/node_modules/resolve/lib/sync.js:71:15)
    at Object.require (/Users/mbryxi/Projects/unicorn-misa-pudr-com-empress/node_modules/fastboot/src/ember-app.js:139:42)
    at Module.callback (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-67747c4ty67J6SLnb/out-391-broccoli_merge_trees/moment/fastboot-moment.js:4:34)
    at Module.exports (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-67747c4ty67J6SLnb/out-391-broccoli_merge_trees/assets/vendor/loader/loader.js:106:1)
    at Module._reify (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-67747c4ty67J6SLnb/out-391-broccoli_merge_trees/assets/vendor/loader/loader.js:143:1)
    at Module.reify (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-67747c4ty67J6SLnb/out-391-broccoli_merge_trees/assets/vendor/loader/loader.js:130:1)
    at Module.exports (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-67747c4ty67J6SLnb/out-391-broccoli_merge_trees/assets/vendor/loader/loader.js:104:1)
    at Module._reify (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-67747c4ty67J6SLnb/out-391-broccoli_merge_trees/assets/vendor/loader/loader.js:143:1)
    at Module.reify (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-67747c4ty67J6SLnb/out-391-broccoli_merge_trees/assets/vendor/loader/loader.js:130:1)
    at Module.exports (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-67747c4ty67J6SLnb/out-391-broccoli_merge_trees/assets/vendor/loader/loader.js:104:1)
2019-07-23T08:25:17.398Z 200 OK /

That might have been there before. The main problem is that the website in the browser will infinitely loop on following URL and try to fetch it over and over again. Did not really get more sensible data as it completely blocks my dev tools:

Screen of the post in the browser:
Screenshot 2019-07-23 at 09 25 39

Screen of the request in the network panel. There are thousands of those after few seconds:
Screenshot 2019-07-23 at 09 25 57

Missing ember-fetch?

  1. New blog
  2. Create new author
  3. Create new post under that author
  4. Run ember s
  5. Open browser on http://localhost:4200/
  6. See:
Error: cannot find the `fetch` module or the `fetch` global. Did you mean to install the `ember-fetch` addon?
    at Module.callback (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/addon-tree-output/@ember-data/adapter/-private.js:151:1)
    at Module.exports (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/vendor/loader/loader.js:106:1)
    at Module._reify (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/vendor/loader/loader.js:143:1)
    at Module.reify (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/vendor/loader/loader.js:130:1)
    at Module.exports (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/vendor/loader/loader.js:104:1)
    at Module._reify (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/vendor/loader/loader.js:143:1)
    at Module.reify (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/vendor/loader/loader.js:130:1)
    at Module.exports (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/vendor/loader/loader.js:104:1)
    at Module._reify (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/vendor/loader/loader.js:143:1)
    at Module.reify (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/vendor/loader/loader.js:130:1)
    at Module.exports (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/vendor/loader/loader.js:104:1)
    at Module._reify (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/vendor/loader/loader.js:143:1)
    at Module.reify (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/vendor/loader/loader.js:130:1)
    at Module.exports (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/vendor/loader/loader.js:104:1)
    at Module._reify (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/vendor/loader/loader.js:143:1)
    at Module.reify (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/vendor/loader/loader.js:130:1)
    at Module.exports (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/vendor/loader/loader.js:104:1)
    at requireModule (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/vendor/loader/loader.js:27:1)
    at resolveInitializer (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/addon-tree-output/ember-load-initializers/index.js:11:1)
    at registerInitializers (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/addon-tree-output/ember-load-initializers/index.js:28:1)
    at _default (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/addon-tree-output/ember-load-initializers/index.js:65:1)
    at Module.callback (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/unicorn-misa/app.js:13:1)
    at Module.exports (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/vendor/loader/loader.js:106:1)
    at Module._reify (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/vendor/loader/loader.js:143:1)
    at Module.reify (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/vendor/loader/loader.js:130:1)
    at Module.exports (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/vendor/loader/loader.js:104:1)
    at Object.requireModule (/var/folders/dw/bx1n948x7bgdmwdpxgns8q040000gn/T/broccoli-96526IRpvHI9WoTKO/out-388-broccoli_merge_trees/assets/vendor/loader/loader.js:27:1)
    at Object.<anonymous> (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/fastboot/src/ember-app.js:210:18)
    at VMSandbox.run (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/fastboot/src/vm-sandbox.js:18:15)
    at EmberApp.createEmberApp (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/fastboot/src/ember-app.js:209:30)
    at EmberApp.retrieveSandboxedApp (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/fastboot/src/ember-app.js:234:17)
    at new EmberApp (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/fastboot/src/ember-app.js:61:21)
    at FastBoot._buildEmberApp (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/fastboot/src/index.js:114:17)
    at new FastBoot (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/fastboot/src/index.js:52:10)
    at app.use (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/ember-cli-fastboot/index.js:318:29)
    at Layer.handle [as handle_request] (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/express/lib/router/index.js:317:13)
    at /Users/mbryxi/pudr.com/unicorn-misa/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/express/lib/router/index.js:335:12)
    at next (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/express/lib/router/index.js:275:10)
    at err (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/ember-cli/lib/tasks/server/middleware/broccoli-watcher/index.js:54:11)
    at watcher.then (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/broccoli-middleware/lib/watcher-middleware.js:35:7)
    at tryCatcher (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/ember-cli/node_modules/rsvp/dist/lib/rsvp/-internal.js:39:19)
    at invokeCallback (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/ember-cli/node_modules/rsvp/dist/lib/rsvp/-internal.js:211:31)
    at /Users/mbryxi/pudr.com/unicorn-misa/node_modules/ember-cli/node_modules/rsvp/dist/lib/rsvp/then.js:26:14
    at flush (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/ember-cli/node_modules/rsvp/dist/lib/rsvp/asap.js:80:5)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)

I created a repro repo for you: https://gitlab.com/michal.bryxi/unicorn-misa-pudr-com.git
You will want to switch to a branch: bug/43-ember-fetch

Code Highlighting Not Working

So I just created locally a new blog and trying to do some code formatting and all I am getting is a black box with white text. Am I doing something wrong or is that how its suppose to be?

image

Here is what I wrote in the markdown

import Model, { attr } from '@ember-data/model';

export default class PostModel extends Model {
  @attr title;
  @attr body;
}

generate custom command, warnings

just going to add this here for now

The option '--author' is not registered with the 'generate' command. Run ember generate --help for a list of supported options.

ideally commands don't show fake warnings :)

Configuration changes are reflected in live reload with delay

Changes to the configuration in config/environment.js are not picked up by live reload immediately after the change. But they are picked up by the next change.

This affects at least title, description and navigation configuration options. I have not tested with others.

It seems to be a caching issue. The cache seems to be updated after the reload happens and therefore reflect the live reload cycle before.

Steps to reproduce

  1. Start development server.
  2. Change the blog.title configuration option to "foo".
  3. Change the blog.title configuration option to "bar".

Actual behavior

Both changes of the configuration trigger a rebuild and reload of the application. After the first change the title seems to be unchanged. After the second change the title is shown as "foo".

Expected behavior

I would have expected to see the title "foo" after the first change and the title "bar" after the second change.

Question: Can I build my Own Ember Components

So I am excited that this blog is built using ember. I am curious, could I create something like a twitter component and call that component in one of my blog posts? Or would I need to create my own template that I could call those? Just curious if I can write and use some ember code?

How do I add content at arbitrary paths?

Creating a new post adds it to the root path. I have guessed at a few ways this might work, but failed.

I would like to structure my content so that /blog/post-slug-here/ would work for blog posts. Ideally, whatever folder structure I use would be reflected in the build.

I would like pages to appear without the /page/ prefix. I think it makes sense to keep pages separate from /content/ that would be used for post listings. Is there a way to configure this?

Can't build static pages

Hi, I was having trouble building static pages, so I've tried to re-create a project from scratch using the stepts suggested on readme:

$ npm install -g ember-cli
$ ember new super-blog
$ cd super-blog
$ ember install ember-ghost ember-ghost-casper-template
$ ember build -e production

but I get these errors (multiple times):

Error while processing route: tag The adapter operation was aborted Error: The adapter operation was aborted
    at r.t [as constructor] (/tmp/broccoli-1557eQmVQFT8lvoD/out-276-uglify_writer/assets/vendor.js:2507:13)
    at r.ie (/tmp/broccoli-1557eQmVQFT8lvoD/out-276-uglify_writer/assets/vendor.js:5090:96)
    at new r (/tmp/broccoli-1557eQmVQFT8lvoD/out-276-uglify_writer/assets/vendor.js:5091:56)
    at /tmp/broccoli-1557eQmVQFT8lvoD/out-276-uglify_writer/assets/vendor.js:5538:8
    at /tmp/broccoli-1557eQmVQFT8lvoD/out-276-uglify_writer/assets/vendor.js:5538:28
    at /tmp/broccoli-1557eQmVQFT8lvoD/out-276-uglify_writer/assets/vendor.js:5539:90
    at Object.u.error (/tmp/broccoli-1557eQmVQFT8lvoD/out-276-uglify_writer/assets/vendor.js:5539:100)
    at fire (/home/salvatore/Projects/super-blog/node_modules/jquery-deferred/lib/jquery-callbacks.js:78:30)
    at Object.fireWith (/home/salvatore/Projects/super-blog/node_modules/jquery-deferred/lib/jquery-callbacks.js:188:7)
    at Object.fire [as reject] (/home/salvatore/Projects/super-blog/node_modules/jquery-deferred/lib/jquery-callbacks.js:195:10)
    at ClientRequest.onError (/home/salvatore/Projects/super-blog/node_modules/najax/lib/najax.js:208:9)
    at ClientRequest.emit (events.js:182:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:182:13)
    at emitErrorNT (internal/streams/destroy.js:82:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
pre-render /tag/getting-started failed with exception: Error: The adapter operation was aborted
cleaning up...
Build Error (prember)

Some pre-rendered URLs had failures

I'm on a Xubuntu 18.10, Node.js v10.15.0, NPM v6.4.1.

Any suggestion is welcome ๐Ÿ˜„
thanks

Idea: Empress Editor UI

I think it would really drive adoption of Empress if there was an easy way to edit and manage publishing without having to be familiar with GitHub and Markdown. An admin page for Empress Blogs would be perfect for non-technical people to feel comfortable publishing, and it could be implemented without requiring a backend, I think.

  • Authenticate user through GitHub to ensure their account has access to the repository
  • Pull existing posts from GitHub API to show to user
  • Allow user to edit posts or create new ones, save posts by creating PRs (and automerging or presenting status in UI?)

Since Empress is entirely driven by the creation of files for its four content types (authors, pages, posts, tags), the entire thing could be driven by the GitHub API. This way, users would not have to even understand how GitHub works. They could hit the Netlify deploy button to get a new project, then our documentation could direct them to the URL for the admin dashboard, where they would authenticate with GitHub and be able to fully manage the Empress site.

I really believe this would be a gamechanger for Empress to be able to compare itself to more popular platforms that are entirely designed for non-technical users.

Can't embed local images in markdown

Even though the guides say you can drop images in the public folder and then reference them using ![alt text](/path/to/img.jpg), that doesn't actually work. The examples in your own dummy app only link to externally-hosted images rather than demonstrating how to use an image from the public/ directory. When I tried to reference the path the same way we reference them in the frontmatter section (e.g. /images/foo.jpg), the image is not found. I also tried to reference it as a responsive image, since that's where the frontmatter images end up being processed to (e.g. /responsive-images/foo2000w.jpg). Neither approach worked, so can you explain how to embed images from public/ in our markdown and/or update the guides accordingly?

Compilation fails when there is a subfolder in `public/images`

Build error

Input file contains unsupported image format
Input file contains unsupported image format
        at ImageResizer
-~- created here: -~-
    at ImageResizer.Plugin (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/broccoli-plugin/index.js:7:31)
    at new CachingWriter (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/broccoli-caching-writer/index.js:18:10)
    at new ImageResizer (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/ember-responsive-image/broccoli-image-writer.js:16:5)
    at Class.resizeImages (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/ember-responsive-image/index.js:170:12)
    at addonOptions.forEach (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/ember-responsive-image/index.js:192:30)
    at Array.forEach (<anonymous>)
    at Class.postprocessTree (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/ember-responsive-image/index.js:191:25)
    at projectOrAddon.addons.reduce (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/ember-cli/lib/utilities/addon-process-tree.js:6:25)
    at Array.reduce (<anonymous>)
    at addonProcessTree (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/ember-cli/lib/utilities/addon-process-tree.js:4:32)
-~- (end) -~-
                Error: Input file contains unsupported image format
              
                    at ImageResizer.Plugin (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/broccoli-plugin/index.js:7:31)
    at new CachingWriter (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/broccoli-caching-writer/index.js:18:10)
    at new ImageResizer (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/ember-responsive-image/broccoli-image-writer.js:16:5)
    at Class.resizeImages (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/ember-responsive-image/index.js:170:12)
    at addonOptions.forEach (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/ember-responsive-image/index.js:192:30)
    at Array.forEach (<anonymous>)
    at Class.postprocessTree (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/ember-responsive-image/index.js:191:25)
    at projectOrAddon.addons.reduce (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/ember-cli/lib/utilities/addon-process-tree.js:6:25)
    at Array.reduce (<anonymous>)
    at addonProcessTree (/Users/mbryxi/pudr.com/unicorn-misa/node_modules/ember-cli/lib/utilities/addon-process-tree.js:4:32)
              
                Error: Input file contains unsupported image format

How to reproduce

mkdir ./public/images/posts

Notes

My best guess is that the code just lists everything in /public/images and then tries to convert every single item.

  • I would like to organise my images to subfolders
  • I would like the compilation not to fail because of "unsupported" content in /public/images. A warning for sure, but failing a build seems a bit too much?

Hosting your blog on Github/Github pages

I'm trying to host my blog created using ember ghost using either Github/Gitlab Pages.

Github Pages

When I try to host using Github Pages, I am deploying the /dist folder created using ember build on a http://username.github.io/reponame. However it fails to load the assets since its looking for the assets in http://username.github.io/assets/ rather than http://username.github.io/reponame/assets.

Gitlab Pages

When I try to host using Gitlab Pages by doing the same thing, I'm getting this error message in the console.

Refused to apply style from '<URL>' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

Navigation to Page

When we navigate to page/ and refresh on netlify we get a 404 because page/ is not statically built.

Can we statically build it?

Create your own theme

How do you create your own theme to work with ember ghost? Is there a guide for this?

Request; show feature metadata when clicking on barplot

When utilizing the barplot feature, it can sometimes be tricky to track down which node is corresponding to the interesting colors in the barplot - if you could click on the barplot column and pull up the same information as clicking on the corresponding node it would be really help exploratory analyses!

Allow Content Organized By Folders

In order to better organize content as the amount of content scales, I'd like to be able to place the posts in sub-directories within the content/ folder. empress-blog should continue to be able to load these posts, since all necessary metadata is contained within the headers of the posts themselves and file structure is unimportant to the generation of the blog.

However, if you try to do this, it throws an error attempting to build the app. It appears that empress-blog is built upon the assumption of a flat content/ file structure at this time.

how do I use a multi-line description?

currently, I have:

      description: `
        null: a keyword indicating that something has no value.\n
        vox populi: the voice of the people
      `,

and I've tried <br>, but I think the text is escaped?
(also, I tried an array of lines)

Is there anyway to indicate that I want multiple lines?

Multiple Tags in ABC Order

So i have the a post with the following in the top section. I would expect when I review the post, that the tag being shown would be editors, but its actually showing apple. I thought the top one was going to be the primary one

---
title: "Vim in VS Code"
authors:
  - jrock2004
date: "2019-05-24"
tags:
  - editors
  - apple
---

Date helper/Moment, why are they here?

Right now empress-blog includes a date helper which is not used by itself. The casper template uses it, but also provides its own (identical) implementation.

There's a couple of things:

  1. The date helper relies on moment, but moment is not listed as a dependency of empress-blog
  2. Moment is, after lodash, the biggest hardly used dependency in here. The date helper only uses a few features moment provides. An identical implementation in dayjs can be made (even with timeago support) which is only a couple of KB in size.

Screenshot 2020-03-28 at 14 15 39

I hope we can do one of two things here:

  1. Remove the date helper & moment from empress-blog, let templates figure it out.
  2. Replace the default implementation with a dayjs implementation making the bundle quite a bit smaller.

Example implementation:

// addon/helpers/date.js
import { helper } from '@ember/component/helper';
import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
dayjs.extend(relativeTime);

export function date([post], { format = 'MMM DD, YYYY', timeago }) {
  // set to published_at by default, if it's available
  // otherwise, this will print the current date
  const date = post?.date ? dayjs(post.date) : dayjs();

  return timeago ? date.fromNow() : date.format(format);
}

export default helper(date);

Add *.webp as default supported format

my /config/environment.js contained:

    'responsive-image': {
      extensions: ['jpg', 'jpeg', 'png', 'gif']
    }

Which initially prevented me from using this format on my blog. I'm not sure which layer adds this to the configuration, but having webp there as well today might not be a bad idea.

Enable Disqus comments to be turned on via settings in environment.js

The "please uncomment this block to enable Disqus comments" in the post.hbs template inside the ember-ghost-casper-template is not available to us to modify.

It seems like it should be fairly easy to wrap that in a conditional block, such that if you provide a Disqus ID inside the environment.js file, then it shows the comment block.

Presumably the right path is to expose the Disqus ID via the post.js controller from the environment.js, and then also submit an accompanying PR into the ember-ghost-casper-template to change that comment block in the post.hbs to a conditional based on the presence of the ID?

If that sounds about right, I'll get on and make those PRs.

Replace Autoprefixer browsers option to Browserslist config

Not sure if this means something should be changed for out-of-the-box experience, but on a new install, I get this message every time I run ember serve.

> ember serve

  Replace Autoprefixer browsers option to Browserslist config.
  Use browserslist key in package.json or .browserslistrc file.

  Using browsers option cause some error. Browserslist config
  can be used for Babel, Autoprefixer, postcss-normalize and other tools.

  If you really need to use option, rename it to overrideBrowserslist.

  Learn more at:
  https://github.com/browserslist/browserslist#readme
  https://twitter.com/browserslist

Make the "new" tag automatic

Right now we generate the new tag in the default blueprint and when you use the post blueprint it will create a post with the new tag by default, but this tag is a manual thing that needs to be administrated. e.g. when you create a new post the old ones still have the new tag unless you manually remove it ๐Ÿ˜ซ

The solution: make the new tag something that is automatically generated. This needs to be something that is backwards compatible, so any blog that already has a new tag it won't do anything and it will show a deprecation warning that the behaviour will become an error in the future

Rough todo list:

  • create a deprecation warning if the new tag already exists
  • create a broccoli filter that can generate the new tag based on the latest 4 posts
  • remove new tag from default blueprints
  • stop new posts from haveing the new tag when generated with a blueprint
  • write some tests to make sure it's working effectively

Make sure that each page load only requests exactly the amount of data that it needs

There are some legacy implementations in the data access layer of empress-blog that come from the earlier days of empress as a concept. Some of these have now been fixed in later empress "products" but other issues still need a bit of work to overcome.

I'm listing some of the things that can be done to improve the situation, this is not an exaustive list but it should cover the main points:

Todo

  • stop using store.query()
    • we have figured out a good way to improve the adapter to use findRecord() that will allow us to make use of the Ember Data cache ๐Ÿ‘
  • implement pagination
  • implement "includes"
    • this is useful in things like posts and tags so that we don't need to get authors and the latest posts in a tag after the page has rendered
  • make sure nothing is getting all posts
    • this will likely be solved as part of the pagination implementation

Install fails on Node 12

Following the quickstart guide, I get the error:

installing empress-blog-casper-template
  install addon ember-responsive-image
Command failed: npm install --save-dev --loglevel error ember-responsive-image
info sharp Using cached /Users/ryan/.npm/_libvips/libvips-8.7.0-darwin-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=12.16.2 runtime=node arch=x64 libc= platform=darwin)
In file included from ../src/common.cc:27:
../src/common.h:78:20: error: no member named 'Handle' in namespace 'v8'
  bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
               ~~~~^
../src/common.h:78:37: error: expected '(' for function-style cast or type construction
  bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
                          ~~~~~~~~~~^
../src/common.h:78:39: error: use of undeclared identifier 'obj'
  bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
                                      ^
../src/common.h:78:56: error: expected '(' for function-style cast or type construction
  bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);

It's not the fault of this module, but rather an issue with a transitive dependency on an old version of sharp (see simonihmig/responsive-image#51).

The solution recommended in the linked issue resolves it here as well, but you need to use yarn.

After doing npm init add the following to package.json:

  "resolutions": {
    "**/sharp": "^0.25.2"
  },

Then:

yarn import && rm package-lock.json

After that, npx ember-cli install empress-blog empress-blog-casper-template will work just fine.

Since presumably ember-responsive-image will fix its sharp dependency eventually, it may not be worth changing anything, but this issue might help someone else scratching their head when the quick start fails them.

Running the app errors with `outputPath` of undefined in fastboot

Cloned, npm install, npm start, visited localhost:4200

Node 8.9.1 and npm 6.1.0

TypeError: Cannot read property 'outputPath' of undefined
    at app.use (/Users/iradchenko/sandbox/ember-ghost/node_modules/ember-cli-fastboot/index.js:310:42)
    at Layer.handle [as handle_request] (/Users/iradchenko/sandbox/ember-ghost/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/Users/iradchenko/sandbox/ember-ghost/node_modules/express/lib/router/index.js:317:13)
    at /Users/iradchenko/sandbox/ember-ghost/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/Users/iradchenko/sandbox/ember-ghost/node_modules/express/lib/router/index.js:335:12)
    at next (/Users/iradchenko/sandbox/ember-ghost/node_modules/express/lib/router/index.js:275:10)
    at compression (/Users/iradchenko/sandbox/ember-ghost/node_modules/compression/index.js:220:5)
    at Layer.handle [as handle_request] (/Users/iradchenko/sandbox/ember-ghost/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/Users/iradchenko/sandbox/ember-ghost/node_modules/express/lib/router/index.js:317:13)
    at /Users/iradchenko/sandbox/ember-ghost/node_modules/express/lib/router/index.js:284:7

Don't require tags

I get this if tags is missing or empty

You have defined a post with tag "undefined" but there is no tag with that id. To create this tag run 'npx ember g tag undefined'

Import fails on undefined

Because the way safeDump defaults on skipInvalid: false, the importer is very fragile when one wants to use incomplete data set. Any field that has undefined value will make it fail.

Creating a post with special characters in the title causes problems

I created a post with a question-mark at the end via ember g post "Why build a Vans RV-14A?". Since the question mark is added to the end of the file name, the app can't resolve the json data. Once I realized what what happening it was easy to just remove the question mark from the filename to get everything working. Seems like maybe the generator should escape or otherwise remove any special characters from the title?

Introduce a "description" field to the frontmatter of posts

This would allow people to specify the short version of a post that could be used in the PostCard component (in the index) and in the SEO description field.

There are some design aspects that need to be ironed out on exactly how this would work but it should be implemented in an optional way, i.e. if you don't provide an explicit description you are given the "excerpt" implementation that currently works.

How to install to a subdirectory?

I updated the rootURL in config/environment.js but all the images are broken and I see errors in the console because it can't fetch the JSON data via AJAX from /content/content.json?path=content How can I install ember-ghost in a subdirectory?

Adding pagination to the main page

It would be nice to add pagination to the main page, cause after a moment of writing posts the main page size becomes bigger and consequently it takes more time to load.

Markdown table

This took me unnecessary too long to figure out. The default theme for empress-blog is empress-blog-casper-template. Which uses ember-cli-showdown to translate the Markdown to HTML.

But the default settings of showdown for tables is set to false:

tables: (boolean) [default false] Enable support for tables syntax

So one needs to set in their empress-blog environment.js:

module.exports = function(environment) {
  let ENV = {
    showdown: {
      tables: true
    },
 }
}'

Create a Page

So I want to create a page that is not a blog post. I am a little confused on how I should do this.

Do I just generate an ember route? Do I create an MD file under page? If so how do I add that to the nav?

Found an unknown transformation name cjs

I am trying to use ember ghost. I follow the instructions in the README.md and run the below command

npm install -g ember-cli

ember new super-blog
cd super-blog
ember install ember-ghost ember-ghost-casper-template

Now when I run npm start, I am getting the following error message.

Could not start watchman
Visit https://ember-cli.com/user-guide/#watchman for more info.
while import node_modules/downsize-cjs/index.js: found an unknown transformation name cjs. Available transformNames are: amd

Pagination v2

Introduce the new pagination concept

TODO: fill this out more

highlights:

  • introduce a new pagination-page entity that controls the pagination
  • make sure that posts aren't included in pagination-pages and just relying on ember-data (or otherwise) dynamic requests to improve caching

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.