Code Monkey home page Code Monkey logo

obelisk's People

Contributors

benjamintanweihao avatar bennyhallett avatar cnorm35 avatar hardvain avatar optikfluffel avatar slogsdon 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

obelisk's Issues

Compile Error

Besides a slew of wantings starting with

==> anubis
warning: the dependency :anubis requires Elixir "~> 1.0.0" but you are running on v1.3.1

I get compile error:

== Compilation error on file lib/plug/conn/unfetched.ex ==
** (ArgumentError) Access is not a protocol
    (elixir) lib/protocol.ex:76: Protocol.assert_protocol!/2
    lib/plug/conn/unfetched.ex:9: (module)
    (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6

Publish Command

Need a command to publish the built site via various methods.

Task should do a build first to ensure it's up to date, but provide an option to not do a build.

$ mix obelisk publish
$ mix obelisk publish --no-build

Methods could include:

  • SSH/SCP
  • RSync
  • Github Pages

Add haml support

It'd be nice to support haml as a templating language as well as eex

server should auto build

Since the end product of obelix doesn't require it to run, the html and assets will surely be pushed to an other http serve, the server command should also build on file change.

Because building time is pretty much the only time that we need to run this command

Integration with Phoenix/Plug

Make it super simple to use the Phoenix layout templates, and have the static content part of your site generated at compile time from Markdown

Intermittent test failures for test doesn't send 404 for known files (Obelisk.Plug.ServerTest)

  1) test doesn't send 404 for known files (Obelisk.Plug.ServerTest)
     test/plug/server_test.exs:18
     ** (File.Error) could not write file stats "/Users/Mathis/Desktop/obelisk/build/index.html": no such file or directory
     stacktrace:
       (elixir) lib/file.ex:358: File.write_stat!/3
       (elixir) lib/file.ex:645: File.do_cp_file/4
       (elixir) lib/enum.ex:1623: Enum."-reduce/3-lists^foldl/2-0-"/3
       (elixir) lib/file.ex:577: File.cp_r/3
       test/plug/server_test.exs:21: (test)
  1) test doesn't send 404 for known files (Obelisk.Plug.ServerTest)
     test/plug/server_test.exs:18
     Expected truthy, got false
     code: conn.halted()
     stacktrace:
       test/plug/server_test.exs:27: (test)

Titles and description doesn't work

I tried out the generator by following the readme steps and the Yaml doesn't update the <title> tag or insert a description. Is there something that i'm doing wrong?

yamerl doesn't compile on windows

Unable to install obelisk on windows because yamerl compiling fails with the message:

==> yamerl (compile)
ERROR: sh(cmd /q /c awk '/^AC_INIT(/ { ver=; sub(/AC_INIT([[^]]+], [/, "", ver); sub(/]./, "", ver); print ver; } { next; }' configure.ac)
failed with return code 1 and the following output:
awk: cmd. line:1: /AC_INIT(/ { ver=; sub(/AC_INIT([[]]+], [/, "", ver); sub(/]./, "", ver); print ver; } { next; }
awk: cmd. line:1: ^ syntax error

Template Selection in Frontmatter

It should be possible to select a template in the frontmatter.

For example, your index page may need to use a different template, for a jumbotron or something, than the rest of your pages.

colon character in title borks

yaml and obelisk don't like having colons in the title.

perhaps it would be a good idea to url encode the title string arg from mix obelisk post

datafiles

I need to generate pages dynamically from a yaml datafile the way it is done in Middleman. Would it be possible in obelisk?

Intermittent test failures for test sends file if exists (Obelisk.Plug.IndexTest)

  1) test sends file if exists (Obelisk.Plug.IndexTest)
     test/plug/index_test.exs:30
     ** (File.Error) could not read file stats "/Users/Mathis/Desktop/obelisk/build/index.html": no such file or directory
     stacktrace:
       (elixir) lib/file.ex:289: File.stat!/2
       (plug) lib/plug/adapters/test/conn.ex:43: Plug.Adapters.Test.Conn.send_file/6
       (plug) lib/plug/conn.ex:349: Plug.Conn.send_file/5
       (obelisk) lib/obelisk/plug/index.ex:21: Obelisk.Plug.Index.call/2
       test/plug/index_test.exs:37: (test)

Ignore hidden files

While editing a post, the build task finds and processes the corresponding swap file, resulting in parse errors. I'd be happy to submit a pull request (probably for a filter statement in Obelisk.Tasks.Build), but I'd like to know how you want the matter handled.

Right now, all files are processed, regardless of filename, and one test, Build task compiled pages into the build dir, relies on this functionality to pass three tests rely on this functionality to pass. Constraining post filenames to YYYY-mm-dd-some-title.markdown breaks this these, but just omitting hidden files (beginning with ".") allows the test[s] to pass.

If the suggested filename formatting is to be enforced, I presume the following might do.

  defp is_valid_filename(filename) do
    try do
      <<year::4*8,  "-",
        month::2*8, "-",
        day::2*8,   "-",
        title_and_extension::binary
      >> = filename

      [title, "markdown"] = String.split title_and_extension, "." 

      Regex.match? ~r/^[a-zA-Z][a-zA-Z0-9\-]+$/, title

    rescue
      MatchError ->
        false
    end 
  end

Of course, if exploding is intolerable, all errors can be matched, but I don't believe it's necessary.

Let me know what you think, and thanks in advance.

Obelisk doesn't compile with elixir 1.3.1 ?

I'm using recent versions of Erlang and Elixir:

maurice@tessy> elixir -v
Erlang/OTP 19 [erts-8.0] [source] [64-bit] [smp:2:2] [async-threads:10] [kernel-poll:false]

Elixir 1.3.1

Following the instructions, my mix.exs looks like this:

defp deps do
  [{ :obelisk, "~> 0.7.1" }, { :yamerl, github: "yakaz/yamerl"} ]
end

mix deps.get goes well. But mix.deps.compile generates warnings and errors:

maurice@tessy> mix deps.compile
==> anubis
warning: the dependency :anubis requires Elixir "~> 1.0.0" but you are running on v1.3.1
Compiling 1 file (.ex)
Generated anubis app
==> chronos
Compiling 3 files (.ex)
warning: this clause cannot match because a previous clause at line 227 always matches
  lib/chronos/formatter.ex:229

warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
  lib/chronos.ex:13

Generated chronos app
==> yamerl
Compiling 27 files (.erl)
Generated yamerl app
==> ranch (compile)
Compiled src/ranch_transport.erl
Compiled src/ranch_sup.erl
Compiled src/ranch_server.erl
Compiled src/ranch_acceptor.erl
Compiled src/ranch_listener_sup.erl
Compiled src/ranch_protocol.erl
Compiled src/ranch.erl
Compiled src/ranch_acceptors_sup.erl
Compiled src/ranch_conns_sup.erl
Compiled src/ranch_app.erl
Compiled src/ranch_ssl.erl
Compiled src/ranch_tcp.erl
==> rss
warning: the dependency :rss requires Elixir "~> 1.0.0" but you are running on v1.3.1
Compiling 1 file (.ex)
Generated rss app
==> earmark
Compiling 9 files (.ex)
warning: the variable "blocks" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:

    case int do
      1 -> atom = :one
      2 -> atom = :two
    end

should be written as

    atom =
      case int do
        1 -> :one
        2 -> :two
      end

Unsafe variable found at:
  lib/earmark.ex:177

warning: the variable "context" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:

    case int do
      1 -> atom = :one
      2 -> atom = :two
    end

should be written as

    atom =
      case int do
        1 -> :one
        2 -> :two
      end

Unsafe variable found at:
  lib/earmark.ex:177

warning: the variable "line" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:

    case int do
      1 -> atom = :one
      2 -> atom = :two
    end

should be written as

    atom =
      case int do
        1 -> :one
        2 -> :two
      end

Unsafe variable found at:
  lib/earmark/helpers.ex:10

warning: parentheses are required when piping into a function call. For example:

    foo 1 |> bar 2 |> baz 3

is ambiguous and should be written as

    foo(1) |> bar(2) |> baz(3)

Ambiguous pipe found at:
  lib/earmark/inline.ex:307

warning: the variable "rule_updates" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:

    case int do
      1 -> atom = :one
      2 -> atom = :two
    end

should be written as

    atom =
      case int do
        1 -> :one
        2 -> :two
      end

Unsafe variable found at:
  lib/earmark/inline.ex:304

warning: the variable "rule_updates" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:

    case int do
      1 -> atom = :one
      2 -> atom = :two
    end

should be written as

    atom =
      case int do
        1 -> :one
        2 -> :two
      end

Unsafe variable found at:
  lib/earmark/inline.ex:302

warning: the variable "rule_updates" is unsafe as it has been set inside a case/cond/receive/if/&&/||.  Please explicitly return the variable value instead. For example:

    case int do
      1 -> atom = :one
      2 -> atom = :two
    end

should be written as

    atom =
      case int do
        1 -> :one
        2 -> :two
      end

Unsafe variable found at:
  lib/earmark/inline.ex:306

warning: the variable "html" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:

    case int do
      1 -> atom = :one
      2 -> atom = :two
    end

should be written as

    atom =
      case int do
        1 -> :one
        2 -> :two
      end

Unsafe variable found at:
  lib/earmark/html_renderer.ex:85

warning: the variable "rest" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:

    case int do
      1 -> atom = :one
      2 -> atom = :two
    end

should be written as

    atom =
      case int do
        1 -> :one
        2 -> :two
      end

Unsafe variable found at:
  lib/earmark/block.ex:175

warning: the variable "html_lines" is unsafe as it has been set inside a case/cond/receive/if/&&/||.     Please explicitly return the variable value instead. For example:

    case int do
      1 -> atom = :one
      2 -> atom = :two
    end

should be written as

    atom =
      case int do
        1 -> :one
        2 -> :two
      end

Unsafe variable found at:
  lib/earmark/block.ex:211

warning: the variable "rest" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:

    case int do
      1 -> atom = :one
      2 -> atom = :two
    end

should be written as

    atom =
      case int do
        1 -> :one
        2 -> :two
      end

Unsafe variable found at:
  lib/earmark/block.ex:212

Generated earmark app
==> cowlib (compile)
Compiled src/cow_cookie.erl
Compiled src/cow_http_te.erl
Compiled src/cow_mimetypes.erl
Compiled src/cow_http_hd.erl
Compiled src/cow_http.erl
Compiled src/cow_qs.erl
Compiled src/cow_date.erl
src/cow_multipart.erl:392: Warning: crypto:rand_bytes/1 is deprecated and will be removed in a future release; use crypto:strong_rand_bytes/1
Compiled src/cow_multipart.erl
Compiled src/cow_spdy.erl
==> cowboy (compile)
Compiled src/cowboy_middleware.erl
Compiled src/cowboy_sub_protocol.erl
Compiled src/cowboy_static.erl
Compiled src/cowboy_clock.erl
Compiled src/cowboy_router.erl
Compiled src/cowboy_http.erl
Compiled src/cowboy_rest.erl
Compiled src/cowboy_app.erl
Compiled src/cowboy.erl
Compiled src/cowboy_sup.erl
Compiled src/cowboy_loop_handler.erl
Compiled src/cowboy_bstr.erl
Compiled src/cowboy_spdy.erl
Compiled src/cowboy_http_handler.erl
Compiled src/cowboy_protocol.erl
Compiled src/cowboy_websocket.erl
Compiled src/cowboy_req.erl
Compiled src/cowboy_websocket_handler.erl
Compiled src/cowboy_handler.erl
==> plug
Compiling 38 files (.ex)
warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
  lib/plug/upload.ex:156


== Compilation error on file lib/plug/conn/unfetched.ex ==
** (ArgumentError) Access is not a protocol
    (elixir) lib/protocol.ex:76: Protocol.assert_protocol!/2
    lib/plug/conn/unfetched.ex:9: (module)
    (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6

could not compile dependency :plug, "mix compile" failed. You can recompile this dependency with     "mix deps.compile plug", update it with "mix deps.update plug" or clean it with "mix deps.clean plug"
/home/maurice/public_html/blog
maurice@tessy> 

Any idea?

Maurice

Can I take over this repo?

@BennyHallett I see from your personal website that you agree this isn't maintained anymore. It is, however, still widely used. I love using Obelisk, but it does need to be updated for newer versions of Elixir and the issue count is growing.

Since I use Obelisk for all of my personal sites, and I like the software, I'd like to ask if it would be alright if I created a fork of Obelisk and moved that over to be the official branch of the project (with your permission, of course)? I'd be happy to take over all of the issues as well.

If that's something you're okay with, let me know so I can get started on working with it. I would have emailed you but your email is difficult to track and this seemed to be the best place I could make this offer.

Use a different index than the blog index.

It'd be cool to be able to put the blog posts and index pages under a subdirectory, then compile the pages (with one named index.html) into the main directory.

This way the site could be generated without a blog part, or as a landing page with separate blog content.

Themes

Should be able to easily switch themes for your site.

Might mean we need to create a theme directory and move the assets directory in there. Would still need an external images directory for post images.

- /themes
  - /theme_name
    - /assets/*
    - layout.(eex|haml)
  - /theme_two
    - /assets/*
    - layout.(eex|haml)

Themes should be able to be downloaded directly from Github.

Config might look like this for a local theme


---
theme: theme_name
  from: :local

And this for a github one


---
theme: theme_name
  from: :github
  repo: user/repo

Or some generic git repo


---
theme: theme_name
  from: :git
  repo: git://server/user/repo.git

Ordered Content

I'd like to have to ability to create a set of pages that have ordered content, which could be used for creating a manual for a software product, or an online book.

I think it could be done with content placed in /pages, with some kind of convention around page numbering. I.E /pages/1-Introduction.markdown, and sub content like /pages/1-1-Subintro.markdown

When this content is being processed, we should maintain a data structure that represents the contents of these ordered pages, such that we can easily drop it into a sidebar.

Serve command should load index on root path

At the moment, to load up the page after a serve command, you need to point the browser at http://localhost:4000/index.html. It should also work for just http://localhost:4000

100% CPU when serving

When I run blog|โ‡’ mix obelisk server my CPU is pegged at 100%. Is this a known issue? Are there any work arounds?

Writing many unnecessary lines to .gitignore

I found that .gitignore had many lines written to it, I'm not sure how big of an issue this is, but at least was annoying me enough to inspire a bit of code.

I'm not sure how useful it is, only recently started writing Elixir code and only started looking at this codebase yesterday, but here it is FWIW: m11m@df4ee5f

Thanks!

Serve command shouldn't error

The serrve command is throwing errors in the shell in which it is kicked off, even though it seems to be working correctly. It shouldn't be doing this.

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.