tidying to remove path config, just hard-coding it
This commit is contained in:
parent
df2cc13167
commit
ae9fff231b
3 changed files with 3 additions and 13 deletions
|
@ -66,6 +66,3 @@ config :phoenix, :stacktrace_depth, 20
|
|||
|
||||
# Initialize plugs at runtime for faster development compilation
|
||||
config :phoenix, :plug_init_mode, :runtime
|
||||
|
||||
# Finally import the config/dev.secret.exs which loads secret config
|
||||
import_config "dev.secret.exs"
|
||||
|
|
|
@ -3,13 +3,7 @@ defmodule Home73k.Blog do
|
|||
|
||||
Application.ensure_all_started(:earmark)
|
||||
|
||||
@content_path Application.compile_env(:home73k, [:content_repo, :path], "./priv/content")
|
||||
|
||||
posts_paths =
|
||||
@content_path
|
||||
|> Path.expand()
|
||||
|> Path.join("**/*.md")
|
||||
|> Path.wildcard()
|
||||
posts_paths = "priv/content/**/*.md" |> Path.wildcard()
|
||||
|
||||
posts =
|
||||
for post_path <- posts_paths do
|
||||
|
|
|
@ -75,7 +75,7 @@ defmodule Home73k.Blog.Post do
|
|||
|
||||
# restrict corpus to letters & numbers,
|
||||
# then split to words (space delim), trimming as we go
|
||||
# then reject all 0, 1, 2-letter words, and words in @strip_words
|
||||
# then reject short & common words
|
||||
# reduce to unique words and join back to space-delim string
|
||||
corpus =
|
||||
Regex.replace(~r/[^a-z0-9 ]/, corpus, "")
|
||||
|
@ -146,8 +146,7 @@ defmodule Home73k.Blog.Post do
|
|||
end
|
||||
|
||||
# """ reject_word?
|
||||
# Determines if a word should be rejected, based on char length < 3,
|
||||
# or if word is in @strip_words
|
||||
# Returns true to reject short or common words
|
||||
# Used by parse_title_to_slug and build_corpus
|
||||
# """
|
||||
defp reject_word?(word), do: String.length(word) < 3 || word in @strip_words
|
||||
|
|
Loading…
Reference in a new issue